org.javaswift.joss.model
Interface ListHolder<Child extends ListSubject>

Type Parameters:
Child - the entity that is held by the ListHolder
All Known Subinterfaces:
Account, Container, Website
All Known Implementing Classes:
AbstractAccount, AbstractContainer, AbstractWebsite, AccountImpl, AccountMock, ContainerImpl, ContainerMock, WebsiteImpl, WebsiteMock

public interface ListHolder<Child extends ListSubject>

ListHolder instances hold lists of child entities. In the current model, only Account and Container are ListHolders.


Method Summary
 int getCount()
          The number of child entities (ListSubjects) that are being held by the ListHolder
 int getMaxPageSize()
          The ObjectStore server will force a maximum page size.
 PaginationMap getPaginationMap(int pageSize)
          Returns a PaginationMap of a listing of Containers.
 PaginationMap getPaginationMap(String prefix, int pageSize)
          Returns a PaginationMap of a listing of Containers.
 Collection<Child> list()
          Returns all the containers in an Account.
 Collection<Child> list(PaginationMap paginationMap, int page)
          Returns a number equal to pageSize of Container elements, starting with the first element after the Container named the same as marker.
 Collection<Child> list(String prefix, String marker, int pageSize)
          Returns a number equal to pageSize of Container elements, starting with the first element after the Container named the same as marker.
 

Method Detail

list

Collection<Child> list()
Returns all the containers in an Account. Note that this method returns a maxmimum of 9,999 Containers and no more (see http://docs.openstack.org/api/openstack-object-storage/1.0/content/list-objects.html)

Returns:
the containers in an Account

list

Collection<Child> list(String prefix,
                       String marker,
                       int pageSize)
Returns a number equal to pageSize of Container elements, starting with the first element after the Container named the same as marker.

Parameters:
marker - the last element on the previous page
pageSize - the number of elements to return
Returns:
page of Containers in an Account with a total of pageSize elements

list

Collection<Child> list(PaginationMap paginationMap,
                       int page)
Returns a number equal to pageSize of Container elements, starting with the first element after the Container named the same as marker.

Parameters:
paginationMap - the map that is fetched with getPaginationMap and maps from page to marker
page - the page to return the Containers for
Returns:
page of Containers in an Account with a total of pageSize elements

getPaginationMap

PaginationMap getPaginationMap(int pageSize)
Returns a PaginationMap of a listing of Containers. The map can be used to supply the OpenStack API with a marker (ie, last record on the previous page) and a limit (ie, page size). BE AWARE: this method iterates over ALL Container names to draw up the map, therefore it must be considered an expensive call.

Parameters:
pageSize - number of elements on a single page
Returns:
the pagination map for all the Container elements in Account

getPaginationMap

PaginationMap getPaginationMap(String prefix,
                               int pageSize)
Returns a PaginationMap of a listing of Containers. The map can be used to supply the OpenStack API with a marker (ie, last record on the previous page) and a limit (ie, page size). BE AWARE: this method iterates over ALL Container names to draw up the map, therefore it must be considered an expensive call.

Parameters:
prefix - the names must start with the prefix or else will be filtered out
pageSize - number of elements on a single page
Returns:
the pagination map for all the Container elements in Account

getCount

int getCount()
The number of child entities (ListSubjects) that are being held by the ListHolder

Returns:
number of child entities

getMaxPageSize

int getMaxPageSize()
The ObjectStore server will force a maximum page size. This value helps to determine blocks that must be read, which is used internally for setting up a pagination map.

Returns:
maximum page size for the child entity


Copyright © 2012-2014 42 BV. All Rights Reserved.