Package sonia.scm
Class ManagerDecorator<T extends ModelObject>
java.lang.Object
sonia.scm.ManagerDecorator<T>
- Type Parameters:
T- model type
- All Implemented Interfaces:
Closeable,AutoCloseable,HandlerBase<T>,Initable,LastModifiedAware,Manager<T>
- Direct Known Subclasses:
GroupManagerDecorator,RepositoryManagerDecorator,UserManagerDecorator
Basic decorator for manager classes.
- Since:
- 1.23
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Persists a new object.voidRemoves a persistent object.Returns the object with the given id.getAll()Returns aCollectionof 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.getAll(Predicate<T> filter, Comparator<T> comparator) Returns all object of the store sorted by the givenComparatorReturns a timestamp of the last modified date.voidinit(SCMContextProvider context) This method is called when the SCM manager is started.voidModifies a persistent object.voidReloads an object from store and overwrites all changes.
-
Constructor Details
-
ManagerDecorator
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
create
Description copied from interface:HandlerBasePersists a new object.- Specified by:
createin interfaceHandlerBase<T extends ModelObject>
-
delete
Description copied from interface:HandlerBaseRemoves a persistent object.- Specified by:
deletein interfaceHandlerBase<T extends ModelObject>
-
init
Description copied from interface:InitableThis method is called when the SCM manager is started. -
modify
Description copied from interface:HandlerBaseModifies a persistent object.- Specified by:
modifyin interfaceHandlerBase<T extends ModelObject>
-
refresh
Description copied from interface:ManagerReloads an object from store and overwrites all changes.- Specified by:
refreshin interfaceManager<T extends ModelObject>- Parameters:
object- to refresh
-
get
Description copied from interface:ManagerReturns the object with the given id.- Specified by:
getin interfaceManager<T extends ModelObject>- Parameters:
id- of the object- Returns:
- object with the given id
-
getAll
Description copied from interface:ManagerReturns aCollectionof all objects in the store.- Specified by:
getAllin interfaceManager<T extends ModelObject>
-
getAll
Description copied from interface:ManagerReturns all object of the store sorted by the givenComparator- Specified by:
getAllin interfaceManager<T extends ModelObject>- 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
-
getAll
Description copied from interface:ManagerReturns objects from the store which are starts at the given start parameter. The objects returned are limited by the limit parameter.- Specified by:
getAllin interfaceManager<T extends ModelObject>- Parameters:
start- parameterlimit- parameter- Returns:
- objects from the store which are starts at the given start parameter
-
getAll
Description copied from interface:ManagerReturns 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.- Specified by:
getAllin interfaceManager<T extends ModelObject>- Parameters:
comparator- to sort the returned objectsstart- parameterlimit- parameter- Returns:
- objects from the store which are starts at the given start parameter
-
getLastModified
Description copied from interface:LastModifiedAwareReturns a timestamp of the last modified date.- Specified by:
getLastModifiedin interfaceLastModifiedAware
-