Interface CanonicalUnitCatalogueAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface CanonicalUnitCatalogueAssignmentSession extends OsidSession

This session provides methods to re-assign CanonicalUnits to Catalogues . A CanonicalUnit may map to multiple Catalogues and removing the last reference to a CanonicalUnit is the equivalent of deleting it. Each Catalogue may have its own authorizations governing who is allowed to operate on it.

Adding a reference of a CanonicalUnit to another Catalogue is not a copy operation (eg: does not change its Id ).

  • Method Details

    • canAssignCanonicalUnits

      boolean canAssignCanonicalUnits()
      Tests if this user can alter canonical unit/catalogue mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer lookup operations to unauthorized users.
      Returns:
      false if mapping is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canAssignCanonicalUnitsToCatalogue

      boolean canAssignCanonicalUnitsToCatalogue(Id catalogueId)
      Tests if this user can alter canonical unit/catalogue mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.
      Parameters:
      catalogueId - the Id of the Catalogue
      Returns:
      false if mapping is not authorized, true otherwise
      Throws:
      NullArgumentException - catalogueId is null
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableCatalogueIds

      IdList getAssignableCatalogueIds(Id catalogueId) throws OperationFailedException
      Gets a list of catalogues including and under the given catalogue node in which any canonical unit can be assigned.
      Parameters:
      catalogueId - the Id of the Catalogue
      Returns:
      list of assignable catalogue Ids
      Throws:
      NullArgumentException - catalogueId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableCatalogueIdsForCanonicalUnit

      IdList getAssignableCatalogueIdsForCanonicalUnit(Id catalogueId, Id canonicalUnitId) throws OperationFailedException
      Gets a list of catalogues including and under the given catalogue node in which a specific canonical unit can be assigned.
      Parameters:
      catalogueId - the Id of the Catalogue
      canonicalUnitId - the Id of the CanonicalUnit
      Returns:
      list of assignable catalogue Ids
      Throws:
      NullArgumentException - catalogueId or canonicalUnitId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • assignCanonicalUnitToCatalogue

      void assignCanonicalUnitToCatalogue(Id canonicalUnitId, Id catalogueId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an existing CanonicalUnit to a Catalogue .
      Parameters:
      canonicalUnitId - the Id of the CanonicalUnit
      catalogueId - the Id of the Catalogue
      Throws:
      AlreadyExistsException - canonicalUnitId already assigned to catalogueId
      NotFoundException - canonicalUnitId or catalogueId not found
      NullArgumentException - canonicalUnitId or catalogueId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • unassignCanonicalUnitFromCatalogue

      void unassignCanonicalUnitFromCatalogue(Id canonicalUnitId, Id catalogueId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Removes a CanonicalUnit from a Catalogue .
      Parameters:
      canonicalUnitId - the Id of the CanonicalUnit
      catalogueId - the Id of the Catalogue
      Throws:
      NotFoundException - canonicalUnitId or catalogueId not found or canonicalUnitId not mapped to catalogueId
      NullArgumentException - canonicalUnitId or catalogueId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • reassignCanonicalUnitToCatalogue

      void reassignCanonicalUnitToCatalogue(Id canonicalUnitId, Id fromCatalogueId, Id toCatalogueId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Moves a CanonicalUnit from one Catalogue to another. Mappings to other Catalogues are unaffected.
      Parameters:
      canonicalUnitId - the Id of the CanonicalUnit
      fromCatalogueId - the Id of the current Catalogue
      toCatalogueId - the Id of the destination Catalogue
      Throws:
      AlreadyExistsException - canonicalUnitId already assigned to toCatalogueId
      NotFoundException - canonicalUnitId, fromCatalogueId , or toCatalogueId not found or canonicalUnitId not mapped to fromCatalogueId
      NullArgumentException - canonicalUnitId, fromCatalogueId , or toCatalogueId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.