Interface AccountHierarchyDesignSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session defines methods for managing a hierarchy of
Accounts . Each node in the hierarchy is a unique Account .
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddChildAccount(Id accountId, Id childId) Adds a child to an account.voidaddRootAccount(Id accountId) Adds a root account.booleanTests if this user can change the hierarchy.Gets the hierarchy associated with this session.Gets the hierarchyIdassociated with this session.voidreassignAccountToBusiness(Id accountId, Id fromBusinessId, Id toBusinessId) Moves anAccountfrom oneBusinessto another.voidremoveChildAccount(Id accountId, Id childId) Removes a child from an account.voidremoveChildAccounts(Id accountId) Removes all children from an account.voidremoveRootAccount(Id accountId) Removes a root account.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
-
getAccountHierarchyId
Id getAccountHierarchyId()Gets the hierarchyIdassociated with this session.- Returns:
- the hierarchy
Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getAccountHierarchy
Gets the hierarchy associated with this session.- Returns:
- the hierarchy associated with this session
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canModifyAccountHierarchy
boolean canModifyAccountHierarchy()Tests if this user can change the hierarchy. A return of true does not guarantee successful authorization. A return of false indicates that it is known performing any update will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer these operations to an unauthorized user.- Returns:
falseif changing this hierarchy is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
addRootAccount
void addRootAccount(Id accountId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds a root account.- Parameters:
accountId- theIdof an account- Throws:
AlreadyExistsException-accountIdis already in hierarchyNotFoundException-accountIdnot foundNullArgumentException-accountIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
removeRootAccount
void removeRootAccount(Id accountId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes a root account.- Parameters:
accountId- theIdof an account- Throws:
NotFoundException-accountIdnot foundNullArgumentException-accountIdisnullOperationFailedException- the root accountsPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
addChildAccount
void addChildAccount(Id accountId, Id childId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds a child to an account.- Parameters:
accountId- theIdof an accountchildId- theIdof the new child- Throws:
AlreadyExistsException-accountIdis already a parent ofchildIdNotFoundException-accountIdorchildIdnot foundNullArgumentException-accountIdorchildIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
removeChildAccount
void removeChildAccount(Id accountId, Id childId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes a child from an account.- Parameters:
accountId- theIdof an accountchildId- theIdof the new child- Throws:
NotFoundException-accountIdnot a parent ofchildIdNullArgumentException-accountIdorchildIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
removeChildAccounts
void removeChildAccounts(Id accountId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes all children from an account.- Parameters:
accountId- theIdof an account- Throws:
NotFoundException-accountIdnot foundNullArgumentException-accountIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
reassignAccountToBusiness
void reassignAccountToBusiness(Id accountId, Id fromBusinessId, Id toBusinessId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Moves anAccountfrom oneBusinessto another. Mappings to otherBusinessesare unaffected.- Parameters:
accountId- theIdof theAccountfromBusinessId- theIdof the currentBusinesstoBusinessId- theIdof the destinationBusiness- Throws:
AlreadyExistsException-accountIdalready assigned to toBusinessIdNotFoundException-accountId, fromBusinessId, ortoBusinessIdnot found oraccountIdnot mapped tofromBusinessIdNullArgumentException-accountId, fromBusinessId, ortoBusinessIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-