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 TypeMethodDescriptionvoid
close()
Persists a new object.void
Removes a persistent object.Returns 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
.getAll
(Predicate<T> filter, Comparator<T> comparator) Returns all object of the store sorted by the givenComparator
Returns a timestamp of the last modified date.void
init
(SCMContextProvider context) This method is called when the SCM manager is started.void
Modifies a persistent object.void
Reloads an object from store and overwrites all changes.
-
Constructor Details
-
ManagerDecorator
-
-
Method Details
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
create
Description copied from interface:HandlerBase
Persists a new object.- Specified by:
create
in interfaceHandlerBase<T extends ModelObject>
-
delete
Description copied from interface:HandlerBase
Removes a persistent object.- Specified by:
delete
in interfaceHandlerBase<T extends ModelObject>
-
init
Description copied from interface:Initable
This method is called when the SCM manager is started. -
modify
Description copied from interface:HandlerBase
Modifies a persistent object.- Specified by:
modify
in interfaceHandlerBase<T extends ModelObject>
-
refresh
Description copied from interface:Manager
Reloads an object from store and overwrites all changes.- Specified by:
refresh
in interfaceManager<T extends ModelObject>
- Parameters:
object
- to refresh
-
get
Description copied from interface:Manager
Returns the object with the given id.- Specified by:
get
in interfaceManager<T extends ModelObject>
- Parameters:
id
- of the object- Returns:
- object with the given id
-
getAll
Description copied from interface:Manager
Returns aCollection
of all objects in the store.- Specified by:
getAll
in interfaceManager<T extends ModelObject>
-
getAll
Description copied from interface:Manager
Returns all object of the store sorted by the givenComparator
- Specified by:
getAll
in 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:Manager
Returns objects from the store which are starts at the given start parameter. The objects returned are limited by the limit parameter.- Specified by:
getAll
in 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:Manager
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.- Specified by:
getAll
in 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:LastModifiedAware
Returns a timestamp of the last modified date.- Specified by:
getLastModified
in interfaceLastModifiedAware
-