Interface DirectionCookbookAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface DirectionCookbookAssignmentSession extends OsidSession

This session provides methods to re-assign Directions to Cookbook mappings. A Direction may appear in multiple Cookbook objects and removing the last reference to a Direction 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 Direction to another Cookbook is not a copy operation (eg: does not change its Id ).

  • Method Details

    • canAssignDirections

      boolean canAssignDirections()
      Tests if this user can alter direction/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 lookup operations to unauthorized users.
      Returns:
      false if direction is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canAssignDirectionsToCookbook

      boolean canAssignDirectionsToCookbook(Id cookbookId)
      Tests if this user can alter direction/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 lookup 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 direction 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.
    • getAssignableCookbookIdsForDirection

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

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

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

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