Interface IdentifierManager


  • public interface IdentifierManager
    This interface provides the means for managing Identifiers which includes retrieval, creation, updating and managing the states of Identifiers. Identifiers are identified by an ID which is therefore system-wide unique.

    If the provided identifier (or its identifying attributes) of a method does not exist, an UnknownEntityException will be thrown.

    • Method Detail

      • getLatestIdentifiers

        Collection<Identifier> getLatestIdentifiers​(SessionToken session,
                                                    boolean productionOnly)
        Gets the latest revisions (IN_PRODUCTION and/or OUTDATED) of all identifiers known by this manager.
        Parameters:
        session - The session which is used to check for access rights on this method.
        productionOnly - Whether only the revisions IN_PRODUCTCION should be retrieved.
        Returns:
        The latest revisions of all identifiers IN_PRODUCTION and/or OUTDATED known by this manager.
      • getLatestIdentifiersIterator

        RemoteIterator<List<Identifier>> getLatestIdentifiersIterator​(SessionToken session,
                                                                      boolean productionOnly)
        The same as getLatestIdentifiers(SessionToken, boolean) but with partial retrieval of the identifiers.
        Parameters:
        session - The session which is used to check for access rights on this method.
        productionOnly - Whether only the revisions IN_PRODUCTCION should be retrieved.
        Returns:
        The latest revisions of all identifiers IN_PRODUCTION and/or OUTDATED known by this manager as iterator. The caller is responsible for closing.
      • getIdentifiersRevision

        Collection<Identifier> getIdentifiersRevision​(SessionToken session,
                                                      long revision)
        Gets all identifiers the designated revision known by this manager. These are either IN_PRODUCTION or OUTDATED depending on whether they have been changed or set to outdated from the designated to the latest revision.
        Parameters:
        session - The session which is used to check for access rights on this method.
        revision - The revision of which to retrieve all identifiers known by this manager.
        Returns:
        All identifiers of the designated revision known by this manager.
      • getIdentifiersRevisionIterator

        RemoteIterator<List<Identifier>> getIdentifiersRevisionIterator​(SessionToken session,
                                                                        long revision)
        The same as getIdentifiersRevision(SessionToken, long) but with partial retrieval of the identifiers.
        Parameters:
        session - The session which is used to check for access rights on this method.
        revision - The revision of which to retrieve all identifiers known by this manager as iterator.
        Returns:
        All identifiers of the designated revision known by this manager. The caller is responsible for closing.
      • getLatestIdentifier

        Identifier getLatestIdentifier​(SessionToken session,
                                       UUID identifierID)
        Gets the latest revision of the designated identifier.
        Parameters:
        session - The session which is used to check for access rights on this method.
        identifierID - The ID of the identifier of which to retrieve the latest revision.
        Returns:
        The latest revision of the identifier having the designated ID.
        Throws:
        UnknownEntityException - If the designated identifier does not exist, an UnknownEntityException will be thrown.
      • getIdentifierRevision

        Identifier getIdentifierRevision​(SessionToken session,
                                         UUID identifierID,
                                         long revision)
        Gets the designated revision of the designated identifier.
        Parameters:
        session - The session which is used to check for access rights on this method.
        identifierID - The ID of the identifier of which to retrieve a specific revision.
        revision - The revision of the identifier which to retrieve.
        Returns:
        The designated revision of the designated identifier.
        Throws:
        UnknownEntityException - If the designated identifier or the revision does not exist, an UnknownEntityException will be thrown.
      • getIdentifierRevisions

        List<Identifier> getIdentifierRevisions​(SessionToken session,
                                                UUID identifierID)
        Gets all revisions of the designated identifier or an empty list in case there are no revisions yet.
        Parameters:
        session - The session which is used to check for access rights on this method.
        identifierID - The ID of the identifier of which to retrieve all revisions.
        Returns:
        All revisions of the designated identifier.
        Throws:
        UnknownEntityException - If the designated identifier does not exist, an UnknownEntityException will be thrown.
      • getIdentifierRevisionsIterator

        RemoteIterator<List<Identifier>> getIdentifierRevisionsIterator​(SessionToken session,
                                                                        UUID identifierID)
        The same as getIdentifierRevisions(SessionToken, UUID) but with partial retrieval of the identifiers.
        Parameters:
        session - The session which is used to check for access rights on this method.
        identifierID - The ID of the identifier of which to retrieve all revisions.
        Returns:
        All revisions of the designated identifier as iterator. The caller is responsible for closing.
        Throws:
        UnknownEntityException - If the designated identifier does not exist, an UnknownEntityException will be thrown.
      • getDevelopmentIdentifiers

        Collection<Identifier> getDevelopmentIdentifiers​(SessionToken session,
                                                         long branch)
        Gets the development versions of all identifiers in the designated branch known by this manager. The development versions stem from the base revision of the designated branch, that is, unchanged entities are copies of the corresponding base revisions while changed entities are modified with respect to the base revision. Therefore the returned (referenced) entities may be IN_DEVELOPMENT (changed entities), IN_PRODUCTION (unchanged entities whereas the base revision is the latest revision) or OUTDATED (unchanged entities).
        Parameters:
        session - The session which is used to check for access rights on this method.
        branch - The branch of which to retrieve all identifiers.
        Returns:
        The development versions of all identifiers in the designated branch (changed or unchanged entities) known by this manager.
        Throws:
        UnknownEntityException - If the designated branch is currently unused, an UnknownEntityException will be thrown.
      • getDevelopmentIdentifiersIterator

        RemoteIterator<List<Identifier>> getDevelopmentIdentifiersIterator​(SessionToken session,
                                                                           long branch)
        The same as getDevelopmentIdentifiers(SessionToken, long) but with partial retrieval of the identifiers.
        Parameters:
        session - The session which is used to check for access rights on this method.
        branch - The branch of which to retrieve all identifiers.
        Returns:
        The development versions of all identifiers in the designated branch (changed or unchanged entities) known by this manager as iterator. The caller is responsible for closing.
        Throws:
        UnknownEntityException - If the designated branch is currently unused, an UnknownEntityException will be thrown.
      • getDevelopmentIdentifier

        Identifier getDevelopmentIdentifier​(SessionToken session,
                                            UUID identifierID,
                                            long branch)
        Gets the development version of the designated identifier in the designated branch. The returned entity will be IN_DEVELOPMENT if it has already been changed with respect to its base revision. Otherwise the entity will a copy of the base revision of the branch and therefore IN_PRODUCTION (in case the base revision is the latest revision) or OUTDATED (in case the base revision is already outdated). This copy will be set IN_DEVELOPMENT as soon as it is stored the first time.
        Parameters:
        session - The session which is used to check for access rights on this method.
        identifierID - The ID of the identifier of which to retrieve the development version of the designated branch.
        branch - The branch of which to retrieve the corresponding identifier (or a new copy of the corresponding base revision entity in case it has not been changed before in this branch).
        Returns:
        The development revision of the identifier in the designated branch.
        Throws:
        UnknownEntityException - If the designated identifier does not exist or the designated branch is currently unused, an UnknownEntityException will be thrown.
      • storeDevelopmentIdentifier

        void storeDevelopmentIdentifier​(SessionToken session,
                                        Identifier identifier,
                                        long branch)
        Stores the designated identifier in the designated branch and sets it IN_DEVELOPMENT if not done yet. All changes are therefore persisted. The branch is usually the same as specified when retrieving the identifier for development. However, it can be changed but the content of the target branch will be overwritten. This can be used to copy changes between branches.
        To store a new identifier just set its primary key to a non-existing one and store it. If the key exists, the identifier will be updated instead of added!
        Parameters:
        session - The session which is used to check for access rights on this method and to identify the storing agent and the corresponding organisational position.
        identifier - The identifier providing the new attributes to be set. Identifiers are identified by their ID, therefore the ID will not be able to be changed if there is at least one production revision.
        branch - The branch in which to store the corresponding identifier.
        Throws:
        UnknownEntityException - If the designated branch is currently unused, an UnknownEntityException will be thrown.
      • revertDevelopmentIdentifier

        void revertDevelopmentIdentifier​(SessionToken session,
                                         UUID identifierID,
                                         long branch)
        Reverts the designated development identifier in the designated branch that is all changes will be undone and the identifier will logically be the same as the base revision of the branch.
        Parameters:
        session - The session which is used to check for access rights on this method.
        identifierID - The ID of the identifier of which to delete the development version in the designated branch.
        branch - The branch in which to revert the designated identifier and therefore undoing made changes.
        Throws:
        UnknownEntityException - If the designated identifier does not exist in the designated branch or does not exist at all or the designated branch is currently unused, an UnknownEntityException will be thrown.
      • simulateUpdateOfDevelopmentIdentifier

        CheckReport simulateUpdateOfDevelopmentIdentifier​(SessionToken session,
                                                          UUID identifierID,
                                                          long branch)
        Simulates updating of the designated identifier in the designated branch, that is only the designated identifier of the branch is checked for whether it can be updated to the latest revision. The returned check report therefore contains all conflicts due to versioning. These occur for concurrent changes in the designated branch and changing the latest revision (by releasing a new one). If conflicts occur, checking only for one identifier instead of checking the whole branch will provide a much simpler way to resolve these conflicts.
        When checking an identifier that does not have any changes in the designated branch, the check report will contain no entries, indicating that there will be no problems when updating.
        Parameters:
        session - The session which is used to check for access rights on this method.
        identifierID - The ID of the identifier which to check for versioning conflicts due to updating to the latest revision.
        branch - The branch in which to check the designated identifier for versioning conflicts when updating.
        Returns:
        A check report providing information on versioning on the designated identifier only.
        Throws:
        UnknownEntityException - If the designated identifier does not exist in the designated branch or does not exist at all, an UnknownEntityException will be thrown.
      • outdateIdentifier

        void outdateIdentifier​(SessionToken session,
                               UUID identifierID)
        Outdates the latest revision of the designated identifier explicitly which prevents its usage afterwards. This state will indirectly outdate using entities (operations and activity template definitions). However, their state will not be changed explicitly, rather before using them the states of their identifiers have to be checked. The latest revision may be used for a development version which in turn may be released later.
        Outdating an OUTDATED identifier will be ignored.
        Parameters:
        session - The session which is used to check for access rights on this method and to identify the outdating agent and the corresponding organisational position.
        identifierID - The ID of the identifier of which to explicitly outdate the latest revision.
        Throws:
        UnknownEntityException - If the designated identifier does not exist, an UnknownEntityException will be thrown.