Interface CustomerBusinessAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface CustomerBusinessAssignmentSession extends OsidSession

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

  • Method Details

    • canAssignCustomers

      boolean canAssignCustomers()
      Tests if this user can alter customer/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.
    • canAssignCustomerToBusiness

      boolean canAssignCustomerToBusiness(Id businessId)
      Tests if this user can alter customer/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 customer 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.
    • getAssignableBusinessIdsForCustomer

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

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

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

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