Class AbstractTrsStore
- All Implemented Interfaces:
ResourceEventStore,TrsStore
- Direct Known Subclasses:
FileTrsStore
TrsStore fulfilling the contract of ResourceEventStore.- Since:
- 3.3.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intProven buffer size for base members consumption with good performance for memory and db storage.protected static final intProven buffer size for resource events consumption with good performance for memory and db storage. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractTrsStore(URI domain) Creates a new store instance representing the given OSLC domain. -
Method Summary
Modifier and TypeMethodDescriptionprotected final URIReturns the OSLC domain represented by this store.booleanisStoringEventsOf(Optional<String> projectAreaId) Determines whether the store is currently able to store events and, optionally, for a particular project.voidstore(ResourceEvent... resourceEvents) Stores one or a fewresource events.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.sodius.oslc.server.trs.store.ResourceEventStore
storeMethods inherited from interface com.sodius.oslc.server.trs.store.TrsStore
addBaseMembers, collectBaseMembers, collectChangeEventSeeds, countChangeEventSeeds, createSynchronizer, getControl, getFirstChangeEventSince, getStagingResourceEventStore, isResourceExposed, pollChangeEventSeeds, pushResourceEvents, rebase, removeChangeEventSeedsBefore, restore, saveControl, synchronizeResourceEvents
-
Field Details
-
BASE_BUFFER_SIZE
protected static final int BASE_BUFFER_SIZEProven buffer size for base members consumption with good performance for memory and db storage.- See Also:
-
EVENTS_BUFFER_SIZE
protected static final int EVENTS_BUFFER_SIZEProven buffer size for resource events consumption with good performance for memory and db storage.- See Also:
-
-
Constructor Details
-
AbstractTrsStore
Creates a new store instance representing the given OSLC domain.- Parameters:
domain- the OSLC domain- Throws:
NullPointerException- if the domain isnull- Since:
- 3.11.0
-
-
Method Details
-
getDomain
Returns the OSLC domain represented by this store.- Returns:
- the domain URI
- Since:
- 3.11.0
-
isStoringEventsOf
Description copied from interface:ResourceEventStoreDetermines whether the store is currently able to store events and, optionally, for a particular project.This method must not raise any exception,
falsemust be returned silently if any of them occurred while computing the result. Implementation must verify the correspondingbase is computedand afunctional useris set. If a project is given, it is then recommended to rely onTrsFeedManager.isExposedProjectArea(String).- Specified by:
isStoringEventsOfin interfaceResourceEventStore- Parameters:
projectAreaId- the optional project identifier.- Returns:
trueif TRS events should be stored
-
store
Description copied from interface:ResourceEventStoreStores one or a fewresource events. If a larger volume of events is to send at once, client is recommended to rather use theResourceEventStore.store(Function)method.Implementations MUST store events, without blocking the application, only if the
ResourceEventStore.isStoringEventsOf(Optional)method returnstrue, for each of the givenevent seeds, and must keep them hidden from the TRS feed up to theTrsStore.synchronizeResourceEvents()method is called.This method is intended to avoid raising
TrsStoreException, if something went wrong preventing the storage of the event, implementations must handle it silently.- Specified by:
storein interfaceResourceEventStore- Parameters:
resourceEvents- events to store.
-