Interface AccountBusinessAssignmentSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session provides methods to re-assign Accounts to
Businesses. An Account may appear in multiple Businesses
and removing the last reference to an Account 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 Account to another Business
is not a copy operation (eg: does not change its Id).
Like all OsidSessions,
AccountBusinessAssignmentSessions are dedicated to single processing
threads and a single authenticated user.
-
Method Summary
Modifier and TypeMethodDescriptionvoidassignAccountToBusiness(Id accountId, Id businessId) Adds an existingAccountto aBusiness.booleanTests if this user can alter account/business mappings.booleancanAssignAccountToBusiness(Id businessId) Tests if this user can alter account/business mappings.getAssignableBusinessIds(Id businessId) Gets a list of businesses including and under the given business node in which any account can be assigned.getAssignableBusinessIdsForAccount(Id businessId, Id accountId) Gets a list of businesses including and under the given business node in which a specific account can be assigned.voidunassignAccountFromBusiness(Id accountId, Id businessId) Removes anAccountfrom aBusiness.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatTypes, getLocales, isAuthenticated, startTransaction, supportsTransactions
-
Method Details
-
canAssignAccounts
boolean canAssignAccounts()Tests if this user can alter account/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.
-
canAssignAccountToBusiness
Tests if this user can alter account/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 account 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.
-
getAssignableBusinessIdsForAccount
IdList getAssignableBusinessIdsForAccount(Id businessId, Id accountId) throws OperationFailedException Gets a list of businesses including and under the given business node in which a specific account can be assigned.- Parameters:
businessId- theIdof theBusinessaccountId- theIdof theAccount- Returns:
- list of assignable business
Ids - Throws:
NullArgumentException-businessIdoraccountIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
assignAccountToBusiness
void assignAccountToBusiness(Id accountId, Id businessId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds an existingAccountto aBusiness.- Parameters:
accountId- theIdof theAccountbusinessId- theIdof theBusiness- Throws:
AlreadyExistsException-accountIdis already assigned tobusinessIdNotFoundException-accountIdorbusinessIdnot foundNullArgumentException-accountIdorbusinessIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
unassignAccountFromBusiness
void unassignAccountFromBusiness(Id accountId, Id businessId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes anAccountfrom aBusiness.- Parameters:
accountId- theIdof theAccountbusinessId- theIdof theBusiness- Throws:
NotFoundException-accountIdorbusinessIdnot found oraccountIdnot assigned tobusinessIdNullArgumentException-accountIdorbusinessIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-