- Add the Codota plugin to your IDE and get smart completions
private void myMethod () {Dictionary d =
new Hashtable()
Bundle bundle;bundle.getHeaders()
new Properties()
- Smart code suggestions by Codota
}
private ResponseEntity<RestEntity> handleList(String instanceId) throws RestException { LOG.debug("Retrieving full list of bags on storage instance: {}", instanceId); List<RestBag> bags = new ArrayList<>(); try { DBInstance instance = getInstance(instanceFactory, instanceId); for(Bag bag : instance.getBags()) { StorageService storageService = storageServiceFactory.getStorageService(instance.getInstanceId(), bag.getName()); bags.add(new RestBag(instance.getInstanceId(), bag.getName(), storageService.getSize(), storageService.getDiskSize())); } } catch(JasDBStorageException e) { throw new RestException("Unable to load bags", e); } return ok(new BagCollection(bags)); }
@Override public List<RemoteBag> getBags(RemotingContext context, String instance) throws RemoteException { String connectionString = new RestConnectionBuilder().instance(instance).bags().getConnectionString(); ClientResponse clientResponse = doRequest(context, connectionString); try { BagCollection bagCollection = new JsonRestResponseHandler().deserialize(BagCollection.class, clientResponse.getEntityInputStream()); List<RemoteBag> mappedBags = new ArrayList<>(); for(RestBag bag : bagCollection.getBags()) { mappedBags.add(new RemoteBag(bag.getInstanceId(), bag.getName(), new ArrayList<>(), bag.getSize(), bag.getDiskSize())); } return mappedBags; } catch(RestException e) { throw new RemoteException("Unable to parse remote bag data", e); } finally { clientResponse.close(); } }