public interface CustomerBusinessAssignmentSession extends OsidSession
This session provides methods to re-assign Customers
to
Business
objects A Customer
may appear in
multiple Business
objects 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
).
Modifier and Type | Method and Description |
---|---|
void |
assignCustomerToBusiness(Id customerId,
Id businessId)
Adds an existing
Customer to a Business. |
boolean |
canAssignCustomers()
Tests if this user can alter customer/business mappings.
|
boolean |
canAssignCustomerToBusiness(Id businessId)
Tests if this user can alter customer/business mappings.
|
IdList |
getAssignableBusinessIds(Id businessId)
Gets a list of businesses including and under the given business node
in which any customer can be assigned.
|
IdList |
getAssignableBusinessIdsForCustomer(Id businessId,
Id customerId)
Gets a list of businesses including and under the given business node
in which a specific customer can be assigned.
|
void |
unassignCustomerFromBusiness(Id customerId,
Id businessId)
Removes a
Customer from a Business. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
boolean canAssignCustomers()
PERMISSION_DENIED.
This is intended as a hint to
an application that may opt not to offer assignment operations to
unauthorized users. false
if mapping is not authorized, true
otherwisemandatory
- This method must be implemented. boolean canAssignCustomerToBusiness(Id businessId)
PERMISSION_DENIED.
This is intended as a hint to
an application that may opt not to offer lookup operations to
unauthorized users.businessId
- the Id
of the Business
false
if mapping is not authorized, true
otherwiseNullArgumentException
- businessId
is
null
mandatory
- This method must be implemented. IdList getAssignableBusinessIds(Id businessId) throws OperationFailedException
businessId
- the Id
of the Business
Ids
NullArgumentException
- businessId
is
null
OperationFailedException
- unable to complete requestmandatory
- This method must be implemented. IdList getAssignableBusinessIdsForCustomer(Id businessId, Id customerId) throws OperationFailedException
businessId
- the Id
of the Business
customerId
- the Id
of the Customer
Ids
NullArgumentException
- businessId
or
customerId
is null
OperationFailedException
- unable to complete requestmandatory
- This method must be implemented. void assignCustomerToBusiness(Id customerId, Id businessId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Customer
to a Business.
customerId
- the Id
of the Customer
businessId
- the Id
of the Business
AlreadyExistsException
- customerId
is
already assigned to businessId
NotFoundException
- customerId
or
businessId
not foundNullArgumentException
- customerId
or
businessId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void unassignCustomerFromBusiness(Id customerId, Id businessId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Customer
from a Business.
customerId
- the Id
of the Customer
businessId
- the Id
of the Business
NotFoundException
- customerId
or
businessId
not found or customerId
not
assigned to businessId
NullArgumentException
- customerId
or
businessId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.