Interface MdibAccess
-
- All Known Subinterfaces:
LocalMdibAccess,ReadTransaction,RemoteMdibAccess
- All Known Implementing Classes:
LocalMdibAccessImpl,ReadTransactionImpl,RemoteMdibAccessImpl
public interface MdibAccessRead access to an MDIB storage.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <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 description version.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
-
getMdibVersion
MdibVersion getMdibVersion()
The latest known MDIB version.This object returns the last known MDIB version which in case of remote access may not necessarily reflect the MDIB version of the whole MDIB. For local access the MDIB version reflects the latest state.
- Returns:
- the latest known MDIB version.
-
getMdDescriptionVersion
BigInteger getMdDescriptionVersion()
The latest known MD description version.This object returns the last known MDIB version which in case of remote access may be outdated. For local access the MD description version reflects the latest state.
- Returns:
- the latest known MD description version.
-
getMdStateVersion
BigInteger getMdStateVersion()
The latest known MD description version.This object returns the last known MDIB version which in case of remote access may be outdated. For local access the MD description version reflects the latest state.
- Returns:
- The latest known MD state version.
-
getDescriptor
<T extends AbstractDescriptor> Optional<T> getDescriptor(String handle, Class<T> descrClass)
Retrieves a specific descriptor of the hostedMdib.- Type Parameters:
T- any descriptor type.- 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 state type.- 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.Attention: collections may be created on function call, hence be careful with performance issues.
- Type Parameters:
T- any context state type.- Parameters:
descriptorHandle- the descriptor handle to seek.stateClass- the class to filter for.- Returns:
- a list of the context states of
descriptorHandle.
-
getContextStates
List<AbstractContextState> getContextStates(String descriptorHandle)
Finds all context states of a certain descriptor.Attention: collections may be created on function call, hence be careful with performance issues.
- Parameters:
descriptorHandle- the descriptor handle to seek.- Returns:
- a list of the context 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.Attention: collections may be created on function call, hence be careful with performance issues.
- Type Parameters:
T- the type to filter for.- Parameters:
stateClass- the class information to filter for.- Returns:
- a list of all context states of the specific type.
-
-