Interface MdibAccess

    • 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 AbstractDescriptorOptional<T> getDescriptor​(String handle,
                                                                 Class<T> descrClass)
        Retrieves a specific descriptor of the hosted Mdib.
        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:
        Optional of the requested descriptor or Optional.empty() if not found or something went wrong.
      • findEntitiesByType

        <T extends AbstractDescriptorCollection<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 type matches.
      • getChildrenByType

        <T extends AbstractDescriptorList<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 all MdibEntity objects 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 hosted Mdib.
        Parameters:
        handle - the state or descriptor handle of the state to request (descriptor handle is used in case of single states).
        Returns:
        Optional of the requested state or Optional.empty() if not found or something went wrong.
      • getState

        <T extends AbstractStateOptional<T> getState​(String handle,
                                                       Class<T> stateClass)
        Retrieves a specific state of the hosted Mdib.
        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:
        Optional of the requested state or Optional.empty() if not found or something went wrong.
      • getContextStates

        <T extends AbstractContextStateList<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 AbstractContextStateList<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.