Class MdibStorageImpl

    • Method Detail

      • findEntitiesByType

        public <T extends AbstractDescriptorCollection<MdibEntity> findEntitiesByType​(Class<T> type)
        Description copied from interface: MdibStorage
        Searches all entities that match a specific type.
        Specified by:
        findEntitiesByType in interface MdibStorage
        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: MdibStorage
        Resolves the children of a specific type given a parent handle.
        Specified by:
        getChildrenByType in interface MdibStorage
        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).
      • getState

        public Optional<AbstractState> getState​(String handle)
        Description copied from interface: MdibStorage
        Retrieves a specific abstract state of the hosted Mdib.
        Specified by:
        getState in interface MdibStorage
        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: MdibStorage
        Retrieves a specific state of the hosted Mdib.
        Specified by:
        getState in interface MdibStorage
        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:
        Optional of the requested state or Optional.empty() if not found or something went wrong.
      • getMultiStates

        public List<AbstractMultiState> getMultiStates​(String descriptorHandle)
        Description copied from interface: MdibStorage
        Finds all multi states of a certain handle.
        Specified by:
        getMultiStates in interface MdibStorage
        Parameters:
        descriptorHandle - the descriptor handle to seek.
        Returns:
        a list of the multi states of descriptorHandle.
      • getContextStates

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

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

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

        public <T extends AbstractContextStateList<T> findContextStatesByType​(Class<T> stateClass)
        Description copied from interface: MdibStorage
        Gets all context states of a specific type.
        Specified by:
        findContextStatesByType in interface MdibStorage
        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.
      • apply

        public WriteDescriptionResult apply​(MdibVersion mdibVersion,
                                            @Nullable
                                            BigInteger mdDescriptionVersion,
                                            @Nullable
                                            BigInteger mdStateVersion,
                                            MdibDescriptionModifications descriptionModifications)
        Description copied from interface: MdibStorage
        Applies description modifications on this object regardless of any consistency checks.

        Versions are applied without being verified.

        Specified by:
        apply in interface MdibStorage
        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

        public WriteStateResult apply​(MdibVersion mdibVersion,
                                      @Nullable
                                      BigInteger mdStateVersion,
                                      MdibStateModifications stateModifications)
        Description copied from interface: MdibStorage
        Applies state modifications on this object regardless of any consistency checks.

        Versions are applied without being verified.

        Specified by:
        apply in interface MdibStorage
        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.