Interface ActivityBusinessAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface ActivityBusinessAssignmentSession extends OsidSession

This session provides methods to re-assign Activities to Businesses . An Activity may appear in multiple Businesses and removing the last reference to an Activity is the equivalent of deleting it. Each Business may have its own authorizations governing who is allowed to operate on it.

Adding a reference of an Activity to another Business is not a copy operation (eg: does not change its Id ).

  • Method Details

    • canAssignActivities

      boolean canAssignActivities()
      Tests if this user can alter activity/business 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.
    • canAssignActivitiesToBusiness

      boolean canAssignActivitiesToBusiness(Id businessId)
      Tests if this user can alter activity/business 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:
      businessId - the Id of the Business
      Returns:
      false if mapping is not authorized, true otherwise
      Throws:
      NullArgumentException - businessId is null
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableBusinessIds

      IdList getAssignableBusinessIds(Id businessId) throws OperationFailedException
      Gets a list of businesses including and under the given business node in which any activity can be assigned.
      Parameters:
      businessId - the Id of the Business
      Returns:
      list of assignable business Ids
      Throws:
      NullArgumentException - businessId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableBusinessIdsForActivity

      IdList getAssignableBusinessIdsForActivity(Id businessId, Id activityId) throws OperationFailedException
      Gets a list of businesses including and under the given business node in which a specific activity can be assigned.
      Parameters:
      businessId - the Id of the Business
      activityId - the Id of the Activity
      Returns:
      list of assignable business Ids
      Throws:
      NullArgumentException - businessId or activityId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • assignActivityToBusiness

      void assignActivityToBusiness(Id activityId, Id businessId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an existing Activity to a Business .
      Parameters:
      activityId - the Id of the Activity
      businessId - the Id of the Business
      Throws:
      AlreadyExistsException - activityId is already assigned to businessId
      NotFoundException - activityId or businessId not found
      NullArgumentException - activityId or businessId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • unassignActivityFromBusiness

      void unassignActivityFromBusiness(Id activityId, Id businessId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Removes an Activity from a Business .
      Parameters:
      activityId - the Id of the Activity
      businessId - the Id of the Business
      Throws:
      NotFoundException - activityId or businessId not found or activityId not assigned to businessId
      NullArgumentException - activityId or businessId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.