Class ReadTransactionImpl

    • Constructor Detail

      • ReadTransactionImpl

        public ReadTransactionImpl​(MdibStorage mdibStorage,
                                   Lock lock)
    • Method Detail

      • getMdibVersion

        public MdibVersion getMdibVersion()
        Description copied from interface: MdibAccess
        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.

        Specified by:
        getMdibVersion in interface MdibAccess
        Returns:
        the latest known MDIB version.
      • getMdDescriptionVersion

        public BigInteger getMdDescriptionVersion()
        Description copied from interface: MdibAccess
        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.

        Specified by:
        getMdDescriptionVersion in interface MdibAccess
        Returns:
        the latest known MD description version.
      • getMdStateVersion

        public BigInteger getMdStateVersion()
        Description copied from interface: MdibAccess
        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.

        Specified by:
        getMdStateVersion in interface MdibAccess
        Returns:
        The latest known MD state version.
      • getState

        public Optional<AbstractState> getState​(String handle)
        Description copied from interface: MdibAccess
        Retrieves a specific abstract state of the hosted Mdib.
        Specified by:
        getState in interface MdibAccess
        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

        public <T extends AbstractStateOptional<T> getState​(String handle,
                                                              Class<T> stateClass)
        Description copied from interface: MdibAccess
        Retrieves a specific state of the hosted Mdib.
        Specified by:
        getState in interface MdibAccess
        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

        public <T extends AbstractContextStateList<T> getContextStates​(String descriptorHandle,
                                                                         Class<T> stateClass)
        Description copied from interface: MdibAccess
        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.

        Specified by:
        getContextStates in interface MdibAccess
        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

        public List<AbstractContextState> getContextStates​(String descriptorHandle)
        Description copied from interface: MdibAccess
        Finds all context states of a certain descriptor.

        Attention: collections may be created on function call, hence be careful with performance issues.

        Specified by:
        getContextStates in interface MdibAccess
        Parameters:
        descriptorHandle - the descriptor handle to seek.
        Returns:
        a list of the context states of descriptorHandle.
      • getContextStates

        public List<AbstractContextState> getContextStates()
        Description copied from interface: MdibAccess
        Gets all context states.

        Attention: collections may be created on function call, hence be careful with performance issues.

        Specified by:
        getContextStates in interface MdibAccess
        Returns:
        a list of all context states.
      • findContextStatesByType

        public <T extends AbstractContextStateList<T> findContextStatesByType​(Class<T> stateClass)
        Description copied from interface: MdibAccess
        Gets all context states of a specific type.

        Attention: collections may be created on function call, hence be careful with performance issues.

        Specified by:
        findContextStatesByType in interface MdibAccess
        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.
      • findEntitiesByType

        public <T extends AbstractDescriptorCollection<MdibEntity> findEntitiesByType​(Class<T> type)
        Description copied from interface: MdibAccess
        Searches all entities that match a specific type.
        Specified by:
        findEntitiesByType in interface MdibAccess
        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

        public <T extends AbstractDescriptorList<MdibEntity> getChildrenByType​(String handle,
                                                                                 Class<T> type)
        Description copied from interface: MdibAccess
        Resolves the children of a specific type given a parent handle.
        Specified by:
        getChildrenByType in interface MdibAccess
        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).