Interface ProcedureCookbookAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface ProcedureCookbookAssignmentSession extends OsidSession

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

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

  • Method Details

    • canAssignProcedures

      boolean canAssignProcedures()
      Tests if this user can alter procedure/cookbook 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.
    • canAssignProceduresToCookbook

      boolean canAssignProceduresToCookbook(Id cookbookId)
      Tests if this user can alter procedure/cookbook 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:
      cookbookId - the Id of the Cookbook
      Returns:
      false if mapping is not authorized, true otherwise
      Throws:
      NullArgumentException - cookbookId is null
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableCookbookIds

      IdList getAssignableCookbookIds(Id cookbookId) throws OperationFailedException
      Gets a list of cookbooks including and under the given cookbook node in which any procedure can be assigned.
      Parameters:
      cookbookId - the Id of the Cookbook
      Returns:
      list of assignable cookbook Ids
      Throws:
      NullArgumentException - cookbookId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableCookbookIdsForProcedure

      IdList getAssignableCookbookIdsForProcedure(Id cookbookId, Id procedureId) throws OperationFailedException
      Gets a list of cookbooks including and under the given cookbook node in which a specific procedure can be assigned.
      Parameters:
      cookbookId - the Id of the Cookbook
      procedureId - the Id of the Procedure
      Returns:
      list of assignable cookbook Ids
      Throws:
      NullArgumentException - cookbookId or procedureId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • assignProcedureToCookbook

      void assignProcedureToCookbook(Id procedureId, Id cookbookId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an existing Procedure to an Cookbook .
      Parameters:
      procedureId - the Id of the Procedure
      cookbookId - the Id of the Cookbook
      Throws:
      AlreadyExistsException - procedureId is already assigned to cookbookId
      NotFoundException - procedureId or cookbookId not found
      NullArgumentException - procedureId or cookbookId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • unassignProcedureFromCookbook

      void unassignProcedureFromCookbook(Id procedureId, Id cookbookId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Removes a Procedure from an Cookbook .
      Parameters:
      procedureId - the Id of the Procedure
      cookbookId - the Id of the Cookbook
      Throws:
      NotFoundException - procedureId or cookbookId not found or proecdureId not assigned to cookbookId
      NullArgumentException - procedureId or cookbookId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • reassignProcedureToCookbook

      void reassignProcedureToCookbook(Id procedureId, Id fromCookbookId, Id toCookbookId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Moves a Procedure from one Cookbook to another. Mappings to other Cookbooks are unaffected.
      Parameters:
      procedureId - the Id of the Procedure
      fromCookbookId - the Id of the current Cookbook
      toCookbookId - the Id of the destination Cookbook
      Throws:
      AlreadyExistsException - procedureId already assigned to toCookbookId
      NotFoundException - procedureId, fromCookbookId , or toCookbookId not found or procedureId not mapped to fromCookbookId
      NullArgumentException - procedureId, fromCookbookId , or toCookbookId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.