Interface MdibStorage
-
- All Known Implementing Classes:
MdibStorageImpl
public interface MdibStorageRegistry-based access to MdibEntity instances derived from an Mdib.In this case "registry-based" means that there is fast (hash map) access to any
MdibEntityinstance if not mentioned otherwise.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description WriteDescriptionResultapply(MdibVersion mdibVersion, BigInteger mdDescriptionVersion, BigInteger mdStateVersion, MdibDescriptionModifications descriptionModifications)Applies description modifications on this object regardless of any consistency checks.WriteStateResultapply(MdibVersion mdibVersion, BigInteger mdStateVersion, MdibStateModifications stateModifications)Applies state modifications on this object regardless of any consistency checks.<T extends AbstractContextState>
List<T>findContextStatesByType(Class<T> stateClass)Gets all context states of a specific type.<T extends AbstractDescriptor>
Collection<MdibEntity>findEntitiesByType(Class<T> type)Searches all entities that match a specific type.<T extends AbstractDescriptor>
List<MdibEntity>getChildrenByType(String handle, Class<T> type)Resolves the children of a specific type given a parent handle.List<AbstractContextState>getContextStates()Gets all context states.List<AbstractContextState>getContextStates(String descriptorHandle)Finds all context states of a certain descriptor.<T extends AbstractContextState>
List<T>getContextStates(String descriptorHandle, Class<T> stateClass)Finds all context states of a certain descriptor given a state class.Optional<AbstractDescriptor>getDescriptor(String handle)Retrieves a specific abstract descriptor of the hostedMdib.<T extends AbstractDescriptor>
Optional<T>getDescriptor(String handle, Class<T> descrClass)Retrieves a specific descriptor of the hostedMdib.Optional<MdibEntity>getEntity(String handle)Gets anMdibEntityobject with a specific handle.BigIntegergetMdDescriptionVersion()The latest known MD description version.MdibVersiongetMdibVersion()The latest known MDIB version.BigIntegergetMdStateVersion()The latest known MD state version.List<AbstractMultiState>getMultiStates(String descriptorHandle)Finds all multi states of a certain handle.List<MdibEntity>getRootEntities()Gets allMdibEntityobjects that are root elements.Optional<AbstractState>getState(String handle)Retrieves a specific abstract state of the hostedMdib.<T extends AbstractState>
Optional<T>getState(String handle, Class<T> stateClass)Retrieves a specific state of the hostedMdib.
-
-
-
Method Detail
-
apply
WriteDescriptionResult apply(MdibVersion mdibVersion, @Nullable BigInteger mdDescriptionVersion, @Nullable BigInteger mdStateVersion, MdibDescriptionModifications descriptionModifications)
Applies description modifications on this object regardless of any consistency checks.Versions are applied without being verified.
- Parameters:
mdibVersion- the MDIB version to apply.mdDescriptionVersion- the MD description version to apply. Value null leaves version as is.mdStateVersion- the MD state version to apply. Value null leaves version as is.descriptionModifications- the modifications to apply.- Returns:
- a result set with inserted, updated and deleted entities.
-
apply
WriteStateResult apply(MdibVersion mdibVersion, @Nullable BigInteger mdStateVersion, MdibStateModifications stateModifications)
Applies state modifications on this object regardless of any consistency checks.Versions are applied without being verified.
- Parameters:
mdibVersion- the MDIB version to apply.mdStateVersion- the MD state version to apply. Value null leaves version as is.stateModifications- the modifications to apply.- Returns:
- a result set with updated states.
-
getMdibVersion
MdibVersion getMdibVersion()
The latest known MDIB version.- Returns:
- the latest known MDIB version.
- See Also:
MdibAccess.getMdibVersion()
-
getMdDescriptionVersion
BigInteger getMdDescriptionVersion()
The latest known MD description version.- Returns:
- the latest known MD description version.
- See Also:
MdibAccess.getMdDescriptionVersion()
-
getMdStateVersion
BigInteger getMdStateVersion()
The latest known MD state version.- Returns:
- The latest known MD state version.
- See Also:
MdibAccess.getMdStateVersion()
-
getDescriptor
<T extends AbstractDescriptor> Optional<T> getDescriptor(String handle, Class<T> descrClass)
Retrieves a specific descriptor of the hostedMdib.- Type Parameters:
T- any abstract descriptor.- Parameters:
handle- Handle name of the descriptor.descrClass- Class to cast to. If cast fails,Optional.empty()will be returned.- Returns:
Optionalof the requested descriptor orOptional.empty()if not found or something went wrong.
-
getDescriptor
Optional<AbstractDescriptor> getDescriptor(String handle)
Retrieves a specific abstract descriptor of the hostedMdib.- Parameters:
handle- Handle name of the descriptor.- Returns:
Optionalof the requested descriptor orOptional.empty()if not found or something went wrong.
-
getEntity
Optional<MdibEntity> getEntity(String handle)
Gets anMdibEntityobject with a specific handle.- Parameters:
handle- the handle to seek.- Returns:
- the entity of
Optional.empty()if not found.
-
findEntitiesByType
<T extends AbstractDescriptor> Collection<MdibEntity> findEntitiesByType(Class<T> type)
Searches all entities that match a specific type.- Type Parameters:
T- the descriptor type defined by the class.- Parameters:
type- the class to filter for.- Returns:
- a collection of entities where
typematches.
-
getChildrenByType
<T extends AbstractDescriptor> List<MdibEntity> getChildrenByType(String handle, Class<T> type)
Resolves the children of a specific type given a parent handle.- Type Parameters:
T- the descriptor type defined by the class.- Parameters:
handle- the parent handle of the entity.type- The class to filter for.- Returns:
- a list of children that matches
type(while preserving ordering).
-
getRootEntities
List<MdibEntity> getRootEntities()
Gets allMdibEntityobjects that are root elements.- Returns:
- the root elements, i.e., entities whose descriptors are of type
MdsDescriptor.
-
getState
Optional<AbstractState> getState(String handle)
Retrieves a specific abstract state of the hostedMdib.- Parameters:
handle- the state or descriptor handle of the state to request (descriptor handle is used in case of single states).- Returns:
Optionalof the requested state orOptional.empty()if not found or something went wrong.
-
getState
<T extends AbstractState> Optional<T> getState(String handle, Class<T> stateClass)
Retrieves a specific state of the hostedMdib.- Type Parameters:
T- any abstract state.- Parameters:
handle- the state or descriptor handle of the state to request (descriptor handle is used in case of single states).stateClass- the class to cast to. If cast fails,Optional.empty()will be returned.- Returns:
Optionalof the requested state orOptional.empty()if not found or something went wrong.
-
getContextStates
<T extends AbstractContextState> List<T> getContextStates(String descriptorHandle, Class<T> stateClass)
Finds all context states of a certain descriptor given a state class.- Type Parameters:
T- any abstract context state.- Parameters:
descriptorHandle- the descriptor handle to seek.stateClass- the class to filter for.- Returns:
- a list of the context states of
descriptorHandle. - See Also:
MdibAccess.getContextStates(String, Class)
-
getContextStates
List<AbstractContextState> getContextStates(String descriptorHandle)
Finds all context states of a certain descriptor.- Parameters:
descriptorHandle- the descriptor handle to seek.- Returns:
- a list of the context states of
descriptorHandle. - See Also:
MdibAccess.getContextStates(String)
-
getMultiStates
List<AbstractMultiState> getMultiStates(String descriptorHandle)
Finds all multi states of a certain handle.- Parameters:
descriptorHandle- the descriptor handle to seek.- Returns:
- a list of the multi states of
descriptorHandle.
-
getContextStates
List<AbstractContextState> getContextStates()
Gets all context states.Attention: collections may be created on function call, hence be careful with performance issues.
- Returns:
- a list of all context states.
-
findContextStatesByType
<T extends AbstractContextState> List<T> findContextStatesByType(Class<T> stateClass)
Gets all context states of a specific type.- Type Parameters:
T- the context type to filter for.- Parameters:
stateClass- the class information to filter for.- Returns:
- a list of all context states with the given type.
-
-