private List<InstanceRest> loadInstances() throws RestException { List<InstanceRest> instances = new ArrayList<>(); for(DBInstance instance : instanceFactory.listInstances()) { instances.add(new InstanceRest(instance.getPath(), "OK", engineManager.getEngineVersion(), instance.getInstanceId())); } return instances; }
private InstanceRest loadInstance(String instanceId) throws RestException { try { DBInstance dbInstance = instanceFactory.getInstance(instanceId); return new InstanceRest(dbInstance.getPath(), "OK", engineManager.getEngineVersion(), dbInstance.getInstanceId()); } catch(ConfigurationException e) { throw new RestException("Unable to retrieve the instance", e); } }