Tabnine Logo
BagCollection
Code IndexAdd Tabnine to your IDE (free)

How to use
BagCollection
in
com.oberasoftware.jasdb.rest.model

Best Java code snippets using com.oberasoftware.jasdb.rest.model.BagCollection (Showing top 2 results out of 315)

origin: oberasoftware/jasdb

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));
}
origin: oberasoftware/jasdb

@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();
  }
}
com.oberasoftware.jasdb.rest.modelBagCollection

Most used methods

  • <init>
  • getBags

Popular in Java

  • Reactive rest calls using spring rest template
  • runOnUiThread (Activity)
  • setContentView (Activity)
  • getResourceAsStream (ClassLoader)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now