Interface HierarchyAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session creates, updates, and deletes Hierarchies . The
data for create and update is provided by the consumer via the form.
OsidForms are requested for each create or update and may not be
reused.
Create and update operations differ in their usage. To create a
Hierarchy , a HierarchyForm is requested using
getHierarchyFormForCreate() specifying the desired record Types
or none if no record Types are needed. The returned
HierarchyForm will indicate that it is to be used with a create operation
and can be used to examine metdata or validate data prior to creation.
Once the HierarchyForm is submiited to a create operation, it
cannot be reused with another create operation unless the first operation
was unsuccessful. Each HierarchyForm corresponds to an attempted
transaction.
For updates, HierarchyForms are requested to the
Hierarchy Id that is to be updated using
getHierarchyFormForUpdate() . Similarly, the HierarchyForm has
metadata about the data that can be updated and it can perform validation
before submitting the update. The HierarchyForm can only be used
once for a successful update and cannot be reused.
The delete operations delete Hierarchies .
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasHierarchy(Id hierarchyId, Id aliasId) Adds anIdto aHierarchyfor the purpose of creating compatibility.booleanTests if this user can createHierarchyobjects.booleancanCreateHierarchyWithRecordTypes(Type[] hierarchyRecordTypes) Tests if this user can create a singleHierarchyusing the desired record types.booleanTests if this user can deleteHierarchyobjects.booleanTests if this user can manageIdaliases forHierarchyobjects.booleanTests if this user can updateHierarchyobjects.createHierarchy(HierarchyForm hierarchyForm) Creates a newHierarchy.voiddeleteHierarchy(Id hierarchyId) Deletes aHierarchy.getHierarchyFormForCreate(Type[] hierarchyRecordTypes) Gets the hierarchy form for creating new hierarchies.getHierarchyFormForUpdate(Id hierarchyId) Gets the hierarchy form for updating an existing hierarchy.voidupdateHierarchy(HierarchyForm hierarchyForm) Updates an existing hierarchy.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
-
canCreateHierarchies
boolean canCreateHierarchies()Tests if this user can createHierarchyobjects. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aHierarchywill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer create operations to unauthorized users.- Returns:
falseifHierarchycreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateHierarchyWithRecordTypes
Tests if this user can create a singleHierarchyusing the desired record types. WhileHierarchyManager.getHierarchyRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificHierarchy. Providing an empty array tests if aHierarchycan be created with no records.- Parameters:
hierarchyRecordTypes- array of hierarchy record types- Returns:
trueifHierarchycreation using the specifiedTypesis supported,falseotherwise- Throws:
NullArgumentException-hierarchyRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getHierarchyFormForCreate
HierarchyForm getHierarchyFormForCreate(Type[] hierarchyRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the hierarchy form for creating new hierarchies. A new form should be requested for each create transaction. This method is used for creating new hierarchies, where only theHierarchyTypeis known.- Parameters:
hierarchyRecordTypes- array of hierarchy record types- Returns:
- the hierarchy form
- Throws:
NullArgumentException-hierarchyRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createHierarchy
Hierarchy createHierarchy(HierarchyForm hierarchyForm) throws OperationFailedException, PermissionDeniedException Creates a newHierarchy.- Parameters:
hierarchyForm- the form for thisHierarchy- Returns:
- the new
Hierarchy - Throws:
IllegalStateException-hierarchyFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-hierarchyFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-hierarchyFormdid not originate fromgetHierarchyFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateHierarchies
boolean canUpdateHierarchies()Tests if this user can updateHierarchyobjects. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aHierarchywill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.- Returns:
falseifHierarchymodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getHierarchyFormForUpdate
HierarchyForm getHierarchyFormForUpdate(Id hierarchyId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the hierarchy form for updating an existing hierarchy. A new hierarchy form should be requested for each update transaction.- Parameters:
hierarchyId- theIdof theHierarchy- Returns:
- the hierarchy form
- Throws:
NotFoundException-hierarchyIdis not foundNullArgumentException-hierarchyIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateHierarchy
void updateHierarchy(HierarchyForm hierarchyForm) throws OperationFailedException, PermissionDeniedException Updates an existing hierarchy.- Parameters:
hierarchyForm- the form containing the elements to be updated- Throws:
IllegalStateException-hierarchyFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-hierarchyIdorhierarchyFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-hierarchyFormdid not originate fromgetHierarchyFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteHierarchies
boolean canDeleteHierarchies()Tests if this user can deleteHierarchyobjects. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aHierarchywill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer delete operations to unauthorized users.- Returns:
falseifHierarchydeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteHierarchy
void deleteHierarchy(Id hierarchyId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aHierarchy.- Parameters:
hierarchyId- theIdof theHierarchyto remove- Throws:
NotFoundException-hierarchyIdnot foundNullArgumentException-hierarchyIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageHierarchyAliases
boolean canManageHierarchyAliases()Tests if this user can manageIdaliases forHierarchyobjects. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifHierarchyaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasHierarchy
void aliasHierarchy(Id hierarchyId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aHierarchyfor the purpose of creating compatibility. The primaryIdof theHierarchyis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another vault it is reassigned to the given vaultId.- Parameters:
hierarchyId- theIdof anHierarchyaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-hierarchyIdnot foundNullArgumentException-hierarchyIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-