private String getRightColumnValue(Instance instance) { if (javaOpts) { return instance.getJavaOpts(); } else if (location) { return instance.getLocation(); } else { return instance.getName(); } }
private boolean stopInstance(String name) { try { Instance instance = instanceService.getInstance(name); if (instance != null) { instance.stop(); return true; } } catch (Exception ex) { Logger.getLogger(InstancePlugin.class.getName()).log(Level.SEVERE, null, ex); } return false; }
protected boolean acceptsInstance(Instance instance) { try { return instance.getState().equals(Instance.STOPPED); } catch (Exception e) { return false; } }
private boolean destroyInstance(String name) { try { Instance instance = instanceService.getInstance(name); if (instance != null) { instance.destroy(); return true; } } catch (Exception ex) { Logger.getLogger(InstancePlugin.class.getName()).log(Level.SEVERE, null, ex); } return false; }
private boolean startInstance(String name, String javaOpts) { try { Instance instance = instanceService.getInstance(name); if (instance != null) { instance.start(javaOpts); return true; } } catch (Exception ex) { Logger.getLogger(InstancePlugin.class.getName()).log(Level.SEVERE, null, ex); } return false; }
public int complete(Session session, CommandLine commandLine, List<String> candidates) { StringsCompleter delegate = new StringsCompleter(); for (Instance instance : instanceService.getInstances()) { if (acceptsInstance(instance)) { delegate.getStrings().add(instance.getName()); } } return delegate.complete(session, commandLine, candidates); }
protected Object doExecute() throws Exception { Map<String, URL> textResources = getResources(textResourceLocation); Map<String, URL> binaryResources = getResources(binaryResourceLocations); InstanceSettings settings = new InstanceSettings(sshPort, rmiRegistryPort, rmiServerPort, location, javaOpts, null, null, null, textResources, binaryResources); getInstanceService().cloneInstance(name, cloneName, settings, verbose); return null; }
private Instance getExistingInstance(String name) { Instance i = instanceService.getInstance(name); if (i == null) { throw new IllegalArgumentException("Instance '" + name + "' does not exist"); } return i; }
protected Object doExecute() throws Exception { getExistingInstance(instance).changeSshHost(host); return null; } }
protected Object doExecute() throws Exception { getExistingInstance(instance).changeRmiServerPort(port); return null; }
protected Object doExecute() throws Exception { getExistingInstance(instance).changeRmiRegistryPort(port); return null; }
protected Object doExecute() throws Exception { getInstanceService().renameInstance(instance, newName, verbose); return null; }
protected Object doExecute() throws Exception { getExistingInstance(instance).changeJavaOpts(javaOpts); return null; }
private String getRightColumnValue(Instance instance) { if (javaOpts) { return instance.getJavaOpts(); } else if (location) { return instance.getLocation(); } else { return instance.getName(); } }
protected Object doExecute() throws Exception { Map<String, URL> textResources = getResources(textResourceLocation); Map<String, URL> binaryResources = getResources(binaryResourceLocations); InstanceSettings settings = new InstanceSettings(sshPort, rmiRegistryPort, rmiServerPort, location, javaOpts, null, null, null, textResources, binaryResources); getInstanceService().cloneInstance(name, cloneName, settings, verbose); return null; }
protected boolean acceptsInstance(Instance instance) { try { return instance.getState().equals(Instance.STARTED); } catch (Exception e) { return false; } } }
protected Instance getExistingInstance(String name) { Instance i = instanceService.getInstance(name); if (i == null) { throw new IllegalArgumentException("Instances '" + name + "' does not exist"); } return i; }
protected Object doExecute() throws Exception { getExistingInstance(instance).changeSshHost(host); return null; } }
protected boolean acceptsInstance(Instance instance) { try { return instance.getState().equals(Instance.STARTED); } catch (Exception e) { return false; } } }
protected boolean acceptsInstance(Instance instance) { try { return instance.getState().equals(Instance.STOPPED); } catch (Exception e) { return false; } }