Package sonia.scm
Interface Manager<T extends ModelObject>
- Type Parameters:
T
- type of the model object
- All Superinterfaces:
AutoCloseable
,Closeable
,HandlerBase<T>
,Initable
,LastModifiedAware
- All Known Subinterfaces:
GroupManager
,RepositoryManager
,RepositoryRoleManager
,TypeManager<T,
,H> UserManager
- All Known Implementing Classes:
AbstractGroupManager
,AbstractRepositoryManager
,AbstractRepositoryRoleManager
,AbstractUserManager
,GroupManagerDecorator
,ManagerDecorator
,RepositoryManagerDecorator
,UserManagerDecorator
Base interface for all manager classes.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the object with the given id.getAll()
Returns aCollection
of all objects in the store.getAll
(int start, int limit) Returns objects from the store which are starts at the given start parameter.getAll
(Comparator<T> comparator, int start, int limit) Returns objects from the store which are starts at the given start parameter sorted by the givenComparator
.default Collection<T>
Returns all object of the store unsortedgetAll
(Predicate<T> filter, Comparator<T> comparator) Returns all object of the store sorted by the givenComparator
default PageResult<T>
getPage
(Predicate<T> filter, Comparator<T> comparator, int pageNumber, int pageSize) Returns objects from the store divided into pages with the given page size for the given page number (zero based) and sorted by the givenComparator
.void
Reloads an object from store and overwrites all changes.Methods inherited from interface sonia.scm.HandlerBase
create, delete, modify
Methods inherited from interface sonia.scm.LastModifiedAware
getLastModified
-
Method Details
-
refresh
Reloads an object from store and overwrites all changes.- Parameters:
object
- to refresh- Throws:
NotFoundException
-
get
Returns the object with the given id.- Parameters:
id
- of the object- Returns:
- object with the given id
-
getAll
Collection<T> getAll()Returns aCollection
of all objects in the store. -
getAll
Returns all object of the store unsorted- Parameters:
filter
- to filter the returned objects- Returns:
- all object of the store sorted by the given
Comparator
- Since:
- 3.1.0
-
getAll
Returns all object of the store sorted by the givenComparator
- Parameters:
filter
- to filter the returned objectscomparator
- to sort the returned objects (may be null if no sorting is needed)- Returns:
- all object of the store sorted by the given
Comparator
- Since:
- 1.4
-
getAll
Returns objects from the store which are starts at the given start parameter. The objects returned are limited by the limit parameter.- Parameters:
start
- parameterlimit
- parameter- Returns:
- objects from the store which are starts at the given start parameter
- Since:
- 1.4
-
getAll
Returns objects from the store which are starts at the given start parameter sorted by the givenComparator
. The objects returned are limited by the limit parameter.- Parameters:
comparator
- to sort the returned objectsstart
- parameterlimit
- parameter- Returns:
- objects from the store which are starts at the given start parameter
- Since:
- 1.4
-
getPage
default PageResult<T> getPage(Predicate<T> filter, Comparator<T> comparator, int pageNumber, int pageSize) Returns objects from the store divided into pages with the given page size for the given page number (zero based) and sorted by the givenComparator
.This default implementation reads all items, first, so you might want to adapt this whenever reading is expensive!
- Parameters:
filter
- to filter returned objectscomparator
- to sort the returned objectspageNumber
- the number of the page to be returned (zero based)pageSize
- the size of the pages- Returns:
PageResult
with the objects from the store for the requested page. If the requested page number exceeds the existing pages, an empty page result is returned.- Since:
- 2.0
-