Interface EntryBusinessAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface EntryBusinessAssignmentSession extends OsidSession

This session provides methods to re-assign Entries to Businesses . An Entry may appear in multiple Businesses and removing the last reference to an Entry 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 Entry to another Business is not a copy operation (eg: does not change its Id ).

  • Method Details

    • canAssignEntries

      boolean canAssignEntries()
      Tests if this user can alter entry/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.
    • canAssignEntriesToBusiness

      boolean canAssignEntriesToBusiness(Id businessId)
      Tests if this user can alter entry/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 entry 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.
    • getAssignableBusinessIdsForEntry

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

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

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

      void reassignEntryToBusiness(Id entryId, Id fromBusinessId, Id toBusinessId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Moves an Entry from one Business to another. Mappings to other Businesses are unaffected.
      Parameters:
      entryId - the Id of the Entry
      fromBusinessId - the Id of the current Business
      toBusinessId - the Id of the destination Business
      Throws:
      AlreadyExistsException - entryId already assigned to toBusinessId
      NotFoundException - entryId, fromBusinessId , or toBusinessId not found or entryId not mapped to fromBusinessId
      NullArgumentException - entryId, fromBusinessId , or toBusinessId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.