Interface SubjectTypeCollection<I>
-
- Type Parameters:
I- subject identifier type
public interface SubjectTypeCollection<I>
Collection providing a view of subjects of a given type within the PEX engine.- Since:
- 2.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Collection<CalculatedSubject>activeSubjects()Get an unmodifiable view of the calculated subjects currently active in this data store.Stream<I>allIdentifiers()Get a set of subject identifiers for every subject registered of this type.voidcacheAll()Request that all subjects of this type be loaded into the cache.CompletableFuture<CalculatedSubject>get(I identifier)Get the calculated subject data for a given subject.CompletableFuture<Boolean>isRegistered(I identifier)Query the backing data stores to see if a given subject is registeredvoidload(I identifier)Request that a subject of a given identifier is loaded into the cache.SubjectDataCache<I>persistentData()Access the persistent data for subjects of this typeSubjectDataCache<I>transientData()Access the transient data for subjects of this type.SubjectType<I>type()Set information configuring resolution for this subject type.voiduncache(I identifier)Request that a given identifier be removed from the cached data stores.
-
-
-
Method Detail
-
type
SubjectType<I> type()
Set information configuring resolution for this subject type.- Returns:
- the active type information
- Since:
- 2.0.0
-
cacheAll
void cacheAll()
Request that all subjects of this type be loaded into the cache.Be aware that on larger collections this may be a very expensive operation.
- Since:
- 2.0.0
-
activeSubjects
Collection<CalculatedSubject> activeSubjects()
Get an unmodifiable view of the calculated subjects currently active in this data store.This view may update at any time.
- Returns:
- An unmodifiable view of the subjects
- Since:
- 2.0.0
-
uncache
void uncache(I identifier)
Request that a given identifier be removed from the cached data stores.- Parameters:
identifier- The subject identifier to uncache.- Since:
- 2.0.0
-
get
CompletableFuture<CalculatedSubject> get(I identifier)
Get the calculated subject data for a given subject.The returned data allows querying subject data taking into account both persistent and transient data, inheritance, context priorities and inheritance, and any factors that may be implemented in the future.
- Parameters:
identifier- The identifier of the subject to get- Returns:
- A future providing the calculated subject
- Throws:
IllegalArgumentException- if the given identifier is not valid for this subject type- Since:
- 2.0.0
-
transientData
SubjectDataCache<I> transientData()
Access the transient data for subjects of this type.Operations on these data objects will only be stored in memory. If
SubjectType.transientHasPriority()is true, data set here will override the persistent data for subjects in this collection.- Returns:
- The transient data cache
- Since:
- 2.0.0
-
persistentData
SubjectDataCache<I> persistentData()
Access the persistent data for subjects of this type- Returns:
- The persistent data cache
- Since:
- 2.0.0
-
load
void load(I identifier)
Request that a subject of a given identifier is loaded into the cache. This operation completes asynchronously.- Parameters:
identifier- The identifier of the subject being loaded.- Since:
- 2.0.0
-
isRegistered
CompletableFuture<Boolean> isRegistered(I identifier)
Query the backing data stores to see if a given subject is registered- Parameters:
identifier- The identifier of the subject to query- Returns:
- A future returning whether or not this subject has data registered
- Since:
- 2.0.0
-
allIdentifiers
Stream<I> allIdentifiers()
Get a set of subject identifiers for every subject registered of this type.- Returns:
- All subject identifiers
- Since:
- 2.0.0
-
-