Interface CustomerBusinessAssignmentSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, 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 Summary
Modifier and TypeMethodDescriptionvoidassignCustomerToBusiness(Id customerId, Id businessId) Adds an existingCustomerto aBusiness.booleanTests if this user can alter customer/business mappings.booleancanAssignCustomerToBusiness(Id businessId) Tests if this user can alter customer/business mappings.getAssignableBusinessIds(Id businessId) Gets a list of businesses including and under the given business node in which any customer can be assigned.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.voidreassignCustomerToBusiness(Id customerId, Id fromBusinessId, Id toBusinessId) Moves aCustomerfrom oneBusinessto another.voidunassignCustomerFromBusiness(Id customerId, Id businessId) Removes aCustomerfrom aBusiness.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
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 aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.- Returns:
falseif mapping is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canAssignCustomerToBusiness
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 aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer lookup operations to unauthorized users.- Parameters:
businessId- theIdof theBusiness- Returns:
falseif mapping is not authorized,trueotherwise- Throws:
NullArgumentException-businessIdisnull- Compliance:
mandatory- This method must be implemented.
-
getAssignableBusinessIds
Gets a list of businesses including and under the given business node in which any customer can be assigned.- Parameters:
businessId- theIdof theBusiness- Returns:
- list of assignable business
Ids - Throws:
NullArgumentException-businessIdisnullOperationFailedException- 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- theIdof theBusinesscustomerId- theIdof theCustomer- Returns:
- list of assignable business
Ids - Throws:
NullArgumentException-businessIdorcustomerIdisnullOperationFailedException- 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 existingCustomerto aBusiness.- Parameters:
customerId- theIdof theCustomerbusinessId- theIdof theBusiness- Throws:
AlreadyExistsException-customerIdis already assigned tobusinessIdNotFoundException-customerIdorbusinessIdnot foundNullArgumentException-customerIdorbusinessIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
unassignCustomerFromBusiness
void unassignCustomerFromBusiness(Id customerId, Id businessId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes aCustomerfrom aBusiness.- Parameters:
customerId- theIdof theCustomerbusinessId- theIdof theBusiness- Throws:
NotFoundException-customerIdorbusinessIdnot found orcustomerIdnot assigned tobusinessIdNullArgumentException-customerIdorbusinessIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
reassignCustomerToBusiness
void reassignCustomerToBusiness(Id customerId, Id fromBusinessId, Id toBusinessId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Moves aCustomerfrom oneBusinessto another. Mappings to otherBusinessesare unaffected.- Parameters:
customerId- theIdof theCustomerfromBusinessId- theIdof the currentBusinesstoBusinessId- theIdof the destinationBusiness- Throws:
AlreadyExistsException-customerIdalready assigned totoBusinessIdNotFoundException-customerId, fromBusinessId, ortoBusinessIdnot found orcustomerIdnot mapped tofromBusinessIdNullArgumentException-customerId, fromBusinessId, ortoBusinessIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-