protected List<Instance> getMatchingInstances(List<String> patterns) { List<Instance> instances = new ArrayList<>(); Instance[] allInstances = instanceService.getInstances(); for (Instance instance : allInstances) { if (match(instance.getName(), patterns)) { instances.add(instance); } } if (instances.isEmpty()) { throw new IllegalArgumentException("No matching instances"); } return instances; }
protected List<Instance> getMatchingInstances(List<String> patterns) { List<Instance> instances = new ArrayList<>(); Instance[] allInstances = instanceService.getInstances(); for (Instance instance : allInstances) { if (match(instance.getName(), patterns)) { instances.add(instance); } } if (instances.isEmpty()) { throw new IllegalArgumentException("No matching instances"); } return instances; }
private String getRightColumnValue(Instance instance) { if (javaOpts) { return instance.getJavaOpts(); } else if (location) { return instance.getLocation(); } else { return instance.getName(); } }
private String getRightColumnValue(Instance instance) { if (javaOpts) { return instance.getJavaOpts(); } else if (location) { return instance.getLocation(); } else { return instance.getName(); } }
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); }
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); }
private static CompositeDataSupport mapInstance(Instance instance, CompositeType comp) throws OpenDataException { String state; try { state = instance.getState(); } catch (Exception e) { state = "Error"; } Object[] itemValues = new Object[] {instance.getPid(), instance.getName(), instance.isRoot(), instance.getSshPort(), instance.getSshHost(), instance.getRmiRegistryPort(), instance.getRmiRegistryHost(), instance.getRmiServerPort(), instance.getRmiServerHost(), state, instance.getLocation(), instance.getJavaOpts()}; return new CompositeDataSupport(comp, InstancesMBean.INSTANCE, itemValues); }
private static CompositeDataSupport mapInstance(Instance instance, CompositeType comp) throws OpenDataException { String state; try { state = instance.getState(); } catch (Exception e) { state = "Error"; } Object[] itemValues = new Object[] {instance.getPid(), instance.getName(), instance.isRoot(), instance.getSshPort(), instance.getSshHost(), instance.getRmiRegistryPort(), instance.getRmiRegistryHost(), instance.getRmiServerPort(), instance.getRmiServerHost(), state, instance.getLocation(), instance.getJavaOpts()}; return new CompositeDataSupport(comp, InstancesMBean.INSTANCE, itemValues); }
jw.value(instance.getPid()); jw.key("name"); jw.value(instance.getName()); jw.key("sshPort"); jw.value(instance.getSshPort());