Interface CatalogVersionService

  • All Known Implementing Classes:
    DefaultCatalogVersionService

    public interface CatalogVersionService
    Service provides basic catalog version oriented functionality. Allows fetching catalog version information, managing session catalog versions and determining whether user is eligible for read/write operations within the given catalog version.
    • Method Detail

      • setSessionCatalogVersion

        void setSessionCatalogVersion​(java.lang.String catalogId,
                                      java.lang.String catalogVersionName)
        Sets the CatalogVersionModel specified by catalogId and catalogVersionName as the active CatalogVersion of the current session. Previously set active CatalogVersions are replaced.
        Parameters:
        catalogId - the id of the Catalog the CatalogVersion belongs to
        catalogVersionName - the name of the Catalog version
        Throws:
        UnknownIdentifierException - if no CatalogVersion with the specified catalog id and version exists
        AmbiguousIdentifierException - if more than one CatalogVersion is found with the specified catalog id and version
        java.lang.IllegalArgumentException - if catalogId or catalogVersionName is null
      • setSessionCatalogVersions

        void setSessionCatalogVersions​(java.util.Collection<CatalogVersionModel> catalogVersions)
        Sets the specified collection of CatalogVersionModels as the active CatalogVersions of the current session. The previous active session catalog versions are replaced.
        Parameters:
        catalogVersions - the catalogVersions to be set as active session CatalogVersions
        Throws:
        java.lang.IllegalArgumentException - if catalogVersions is null
      • addSessionCatalogVersion

        void addSessionCatalogVersion​(CatalogVersionModel catalogVersion)
        Adds the CatalogVersionModel specified by catalogId and catalogVersionName to the current active Session CatalogVersions.
        Parameters:
        catalogVersion - CatalogVersion to add
        Throws:
        java.lang.IllegalArgumentException - if catalogVersion is null
      • getSessionCatalogVersions

        java.util.Collection<CatalogVersionModel> getSessionCatalogVersions()
        Returns a collection of the CatalogVersionModels which are activated for the current session.
        Returns:
        an empty collection if no active catalog versions for the current session were found.
      • getCatalogVersion

        CatalogVersionModel getCatalogVersion​(java.lang.String catalogId,
                                              java.lang.String catalogVersionName)
        Returns the CatalogVersionModel with the specified catalogId and catalogVersionName.
        Parameters:
        catalogId - the id for the catalog
        catalogVersionName - the version string for the catalog version
        Returns:
        the CatalogVersion with the specified catalog id and version
        Throws:
        UnknownIdentifierException - if no CatalogVersion with the specified catalog id and version exists
        AmbiguousIdentifierException - if more than one CatalogVersion is found with the specified catalog id and version
        java.lang.IllegalArgumentException - if catalogId or catalogVersionName is null
      • getSessionCatalogVersionForCatalog

        CatalogVersionModel getSessionCatalogVersionForCatalog​(java.lang.String catalogId)
        Returns the CatalogVersionModel in the session with the specified catalogId. This method expects only one catalog version per catalog in the session, which is true for majority of cases. If this is not the case, the AmbiguousIdentifierException will be thrown.
        Parameters:
        catalogId - the Catalog id the CatalogVersion belongs to
        Returns:
        the catalog version in the session with the specified catalogId, or null if no such catalog version was found.
        Throws:
        java.lang.IllegalArgumentException - if catalogId is null
        AmbiguousIdentifierException - if more than one CatalogVersionModel can be found in the session with the specified catalogId
      • getSessionCatalogVersionsForCatalog

        java.util.Collection<CatalogVersionModel> getSessionCatalogVersionsForCatalog​(java.lang.String catalogId)
        Returns the CatalogVersionModels in the session of the CatalogModel matching the specified catalogId.
        Parameters:
        catalogId - the Catalog id the CatalogVersion belongs to
        Returns:
        the collection of CatalogVersionModels or empty collection if no matching catalog versions were found in the session.
        Throws:
        java.lang.IllegalArgumentException - if catalogId is null
      • getAllCatalogVersions

        java.util.Collection<CatalogVersionModel> getAllCatalogVersions()
        Returns all catalog versions defined in the system. Return empty collection if none was found.
      • findDuplicatedIds

        java.util.Collection<DuplicatedItemIdentifier> findDuplicatedIds​(CatalogVersionModel catalogVersionModel)
        Returs collection of duplicated items in given catalog.
        Parameters:
        catalogVersionModel -
        Returns: