Package de.espirit.firstspirit.agency
Interface StoreElementAgent
public interface StoreElementAgent
Definition for an agent offering direct access to store elements by referencing information.
Example:
SpecialistsBroker.requireSpecialist(StoreElementAgent.TYPE)
- Since:
- 4.2.405
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SpecialistType<StoreElementAgent>The specialized agent's type to be used for requesting the agent from aSpecialistsBroker. -
Method Summary
Modifier and TypeMethodDescription@Nullable ReferenceableloadReference(@NotNull String reference, boolean release) Load a reference with the given reference descriptor.@Nullable IDProviderloadStoreElement(@NotNull String uid, IDProvider.UidType uidType, boolean release) Load a store object with the givenuidanduidType.<T extends IDProvider>
Optional<T>requestStoreElement(@NotNull String uid, @NotNull Class<T> type) Locates a store element by itsuidin the current store.<T extends IDProvider>
Optional<T>requestStoreElement(@NotNull String uid, @NotNull Class<T> type, boolean release) Locates a store element by itsuid.<T extends IDProvider>
TrequireStoreElement(@NotNull String uid, @NotNull Class<T> type) Locates a store element by itsuidin the current store.<T extends IDProvider>
TrequireStoreElement(@NotNull String uid, @NotNull Class<T> type, boolean release) Locates a store element by itsuid.
-
Field Details
-
TYPE
The specialized agent's type to be used for requesting the agent from aSpecialistsBroker.- Since:
- 4.2.405
-
-
Method Details
-
loadStoreElement
@Nullable @Nullable IDProvider loadStoreElement(@NotNull @NotNull String uid, @NotNull IDProvider.UidType uidType, boolean release) throws AccessDeniedException Load a store object with the givenuidanduidType.- Parameters:
uid- The uid of the requested object.uidType- The type of the requested object.release- Indicator for loading objects being released,true, or current,false.- Returns:
- The loaded object or
null, if the object is not available. - Throws:
AccessDeniedException- If access to the requested element has been denied.- Since:
- 4.2.405
-
loadReference
@Nullable @Nullable Referenceable loadReference(@NotNull @NotNull String reference, boolean release) Load a reference with the given reference descriptor.- Parameters:
reference- The reference descriptor of the requested object.release- Indicator for loading objects being released,true, or current,false.- Returns:
- The loaded reference or
null, if the object is not available. - Since:
- 4.2.405
-
requestStoreElement
<T extends IDProvider> Optional<T> requestStoreElement(@NotNull @NotNull String uid, @NotNull @NotNull Class<T> type, boolean release) Locates a store element by itsuid.- Type Parameters:
T- The element type to search for. This has to be a (sub-)class of a type containing aUID_TYPEfield. Examples arePageandMediabut neitherDatasetnorSection.- Parameters:
uid- The uid of the store element, must not benull.type- The expected type of the element, used for determining the correctStore.release- Indicates if released (true) or current (false) elements should be returned.- Returns:
- An
Optionalcontaining the store element or an emptyOptionalif no element could be found. - Throws:
AccessDeniedException- If access to the requested element has been denied.- Since:
- 5.2.260400
-
requestStoreElement
<T extends IDProvider> Optional<T> requestStoreElement(@NotNull @NotNull String uid, @NotNull @NotNull Class<T> type) Locates a store element by itsuidin the current store.- Type Parameters:
T- The element type to search for. This has to be a (sub-)class of a type containing aUID_TYPEfield. Examples arePageandMediabut neitherDatasetnorSection.- Parameters:
uid- The uid of the store element, must not benull.type- The expected type of the element, used for determining the correctStore.- Returns:
- An
Optionalcontaining the store element or an emptyOptionalif no element could be found. - Throws:
AccessDeniedException- If access to the requested element has been denied.- Since:
- 5.2.260400
-
requireStoreElement
@NotNull <T extends IDProvider> T requireStoreElement(@NotNull @NotNull String uid, @NotNull @NotNull Class<T> type, boolean release) Locates a store element by itsuid.- Type Parameters:
T- The element type to search for. This has to be a (sub-)class of a type containing aUID_TYPEfield. Examples arePageandMediabut neitherDatasetnorSection.- Parameters:
uid- The uid of the store element, must not benull.type- The expected type of the element, used for determining the correctStore.release- Indicates if released (true) or current (false) elements should be returned.- Returns:
- The store element, never
null. - Throws:
AccessDeniedException- If access to the requested element has been denied.NoSuchElementException- If no element could be found.- Since:
- 5.2.260400
-
requireStoreElement
@NotNull <T extends IDProvider> T requireStoreElement(@NotNull @NotNull String uid, @NotNull @NotNull Class<T> type) Locates a store element by itsuidin the current store.- Type Parameters:
T- The element type to search for. This has to be a (sub-)class of a type containing aUID_TYPEfield. Examples arePageandMediabut neitherDatasetnorSection.- Parameters:
uid- The uid of the store element, must not benull.type- The expected type of the element, used for determining the correctStore.- Returns:
- The store element, never
null. - Throws:
AccessDeniedException- If access to the requested element has been denied.NoSuchElementException- If no element could be found.- Since:
- 5.2.260400
-