Interface StorageManager<T>
- Type Parameters:
T
- type of the managed element
- All Known Subinterfaces:
ProjectManager
,RepositoryManager
public interface StorageManager<T>
An abstract interface to define operations performed on the storage.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close
(Supplier<CentralDogmaException> failureCauseSupplier) Closes this manager.Returns a newly-created element with the specifiedname
and the specifiedcreationTimeMillis
by the specifiedAuthor
.default T
Returns a newly-created element with the specifiedname
by the specifiedAuthor
.void
Ensures that this manager is open.boolean
Returnstrue
if an element with the specifiedname
exists.Returns an element with the specifiedname
.list()
Returns all elements as aMap
of the name and the element.Returns all removed elements as aMap
of the name and the removal timestamp.void
markForPurge
(String name) Marks the specifiedname
element for purge.void
Purges a set of names for the elements which have been marked for purge.void
Removes an element with the specifiedname
.Restores an element with the specifiedname
.
-
Method Details
-
close
Closes this manager.- Parameters:
failureCauseSupplier
- the supplier which provides a reason why it is closed
-
exists
Returnstrue
if an element with the specifiedname
exists.- Parameters:
name
- the name of an element
-
get
Returns an element with the specifiedname
.- Parameters:
name
- the name of an element- Throws:
CentralDogmaException
- if no element with the specifiedname
exists
-
create
Returns a newly-created element with the specifiedname
by the specifiedAuthor
.- Parameters:
name
- the name of an element which is supposed to be createdauthor
- the author who is creating the new element
-
create
Returns a newly-created element with the specifiedname
and the specifiedcreationTimeMillis
by the specifiedAuthor
.- Parameters:
name
- the name of an element which is supposed to be createdcreationTimeMillis
- the creation time in millisecondsauthor
- the author who is creating the new element
-
list
Returns all elements as aMap
of the name and the element. -
listRemoved
Returns all removed elements as aMap
of the name and the removal timestamp. -
remove
Removes an element with the specifiedname
.- Parameters:
name
- the name of an element which is supposed to be removed
-
unremove
Restores an element with the specifiedname
.- Parameters:
name
- the name of an element which is supposed to be restored
-
purgeMarked
void purgeMarked()Purges a set of names for the elements which have been marked for purge. -
markForPurge
Marks the specifiedname
element for purge.- Parameters:
name
- the name of an element which is supposed to be purged
-
ensureOpen
void ensureOpen()Ensures that this manager is open.- Throws:
IllegalStateException
- if this manager is not initialized yetCentralDogmaException
- if this manager has already been closed with a cause. Seeclose(Supplier)
method.
-