Interface PackageDepotAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface PackageDepotAssignmentSession extends OsidSession

This session provides methods to re-assign Packages to Depots . A Package may map to multiple Depots and removing the last reference to an Package is the equivalent of deleting it. Each Depot may have its own authorizations governing who is allowed to operate on it.

Moving or adding a reference of a Package to another Depot is not a copy operation (eg: does not change its Id ).

  • Method Details

    • canAssignPackages

      boolean canAssignPackages()
      Tests if this user can alter package/depot 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.
      Returns:
      false if mapping is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canAssignPackagesToDepot

      boolean canAssignPackagesToDepot(Id depotId)
      Tests if this user can alter package/depot 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:
      depotId - the Id of the Depot
      Returns:
      false if mapping is not authorized, true otherwise
      Throws:
      NullArgumentException - depotId is null
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableDepotIds

      IdList getAssignableDepotIds(Id depotId) throws OperationFailedException
      Gets a list of depot including and under the given depot node in which any package can be assigned.
      Parameters:
      depotId - the Id of the Depot
      Returns:
      list of assignable depot Ids
      Throws:
      NullArgumentException - depotId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableDepotIdsForPackage

      IdList getAssignableDepotIdsForPackage(Id depotId, Id packageId) throws OperationFailedException
      Gets a list of depot including and under the given depot node in which a specific package can be assigned.
      Parameters:
      depotId - the Id of the Depot
      packageId - the Id of the Package
      Returns:
      list of assignable depot Ids
      Throws:
      NullArgumentException - depotId or packageId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • assignPackageToDepot

      void assignPackageToDepot(Id packageId, Id depotId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an existing Package to a Depot .
      Parameters:
      packageId - the Id of the Package
      depotId - the Id of the Depot
      Throws:
      AlreadyExistsException - packageId is already assigned to depotId
      NotFoundException - packageId or depotId not found
      NullArgumentException - packageId or depotId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • unassignPackageFromDepot

      void unassignPackageFromDepot(Id packageId, Id depotId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Removes a Package from a Depot .
      Parameters:
      packageId - the Id of the Package
      depotId - the Id of the Depot
      Throws:
      NotFoundException - packageId or depotId not found or packageId not assigned to depotId
      NullArgumentException - packageId or depotId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • reassignPackageToDepot

      void reassignPackageToDepot(Id packageId, Id fromDepotId, Id toDepotId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Moves a Package from one Depot to another. Mappings to other Depots are unaffected.
      Parameters:
      packageId - the Id of the Package
      fromDepotId - the Id of the current Depot
      toDepotId - the Id of the destination Depot
      Throws:
      AlreadyExistsException - packageId already assigned to toDepotId
      NotFoundException - packageId, fromDepotId , or toDepotId not found or packageId not mapped to fromDepotId
      NullArgumentException - packageId, fromDepotId , or toDepotId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.