public interface HierarchyAdminSession extends OsidSession
This session creates, updates, and deletes Hierarchies.
The data for create and update is provided by the consumer via the form
object. 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.
Modifier and Type | Method and Description |
---|---|
void |
aliasHierarchy(Id hierarchyId,
Id aliasId)
Adds an
Id to a Hierarchy for the
purpose of creating compatibility. |
boolean |
canCreateHierarchies()
Tests if this user can create
Hierarchy objects. |
boolean |
canCreateHierarchyWithRecordTypes(Type[] hierarchyRecordTypes)
Tests if this user can create a single
Hierarchy using
the desired record types. |
boolean |
canDeleteHierarchies()
Tests if this user can delete
Hierarchy objects. |
boolean |
canManageHierarchyAliases()
Tests if this user can manage
Id aliases for
Hierarchy objects. |
boolean |
canUpdateHierarchies()
Tests if this user can update
Hierarchy objects. |
Hierarchy |
createHierarchy(HierarchyForm hierarchyForm)
Creates a new
Hierarchy. |
void |
deleteHierarchy(Id hierarchyId)
Deletes a
Hierarchy. |
HierarchyForm |
getHierarchyFormForCreate(Type[] hierarchyRecordTypes)
Gets the hierarchy form for creating new hierarchies.
|
HierarchyForm |
getHierarchyFormForUpdate(Id hierarchyId)
Gets the hierarchy form for updating an existing hierarchy.
|
void |
updateHierarchy(HierarchyForm hierarchyForm)
Updates an existing hierarchy.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
boolean canCreateHierarchies()
Hierarchy
objects. A
return of true does not guarantee successful authorization. A return
of false indicates that it is known creating a Hierarchy
will result in a PERMISSION_DENIED.
This is
intended as a hint to an application that may not wish to offer create
operations to unauthorized users. false
if Hierarchy
creation is
not authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateHierarchyWithRecordTypes(Type[] hierarchyRecordTypes)
Hierarchy
using
the desired record types. While
HierarchyManager.getHierarchyRecordTypes()
can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific Hierarchy.
Providing an empty array tests if a Hierarchy
can be
created with no records.hierarchyRecordTypes
- array of hierarchy record types true
if Hierarchy
creation using
the specified Types
is supported, false
otherwiseNullArgumentException
- hierarchyRecordTypes
is null
mandatory
- This method must be implemented. HierarchyForm getHierarchyFormForCreate(Type[] hierarchyRecordTypes) throws OperationFailedException, PermissionDeniedException
Hierarchy
Type
is known.hierarchyRecordTypes
- array of hierarchy record typesNullArgumentException
- hierarchyRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. Hierarchy createHierarchy(HierarchyForm hierarchyForm) throws OperationFailedException, PermissionDeniedException
Hierarchy.
hierarchyForm
- the form for this Hierarchy
Hierarchy
IllegalStateException
- hierarchyForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- hierarchyForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- hierarchyForm
did
not originate from getHierarchyFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateHierarchies()
Hierarchy
objects. A
return of true does not guarantee successful authorization. A return
of false indicates that it is known updating a Hierarchy
will result in a PERMISSION_DENIED.
This is
intended as a hint to an application that may not wish to offer update
operations to unauthorized users. false
if Hierarchy
modification
is not authorized, true
otherwisemandatory
- This method must be implemented. HierarchyForm getHierarchyFormForUpdate(Id hierarchyId) throws NotFoundException, OperationFailedException, PermissionDeniedException
hierarchyId
- the Id
of the Hierarchy
NotFoundException
- hierarchyId
is not
foundNullArgumentException
- hierarchyId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateHierarchy(HierarchyForm hierarchyForm) throws OperationFailedException, PermissionDeniedException
hierarchyForm
- the form containing the elements to be updatedIllegalStateException
- hierarchyForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- hierarchyId
or
hierarchyForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- hierarchyForm
did
not originate from getHierarchyFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteHierarchies()
Hierarchy
objects. A
return of true does not guarantee successful authorization. A return
of false indicates that it is known deleting a Hierarchy
will result in a PERMISSION_DENIED.
This is
intended as a hint to an application that may not wish to offer delete
operations to unauthorized users. false
if Hierarchy
deletion is
not authorized, true
otherwisemandatory
- This method must be implemented. void deleteHierarchy(Id hierarchyId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Hierarchy.
hierarchyId
- the Id
of the Hierarchy
to removeNotFoundException
- hierarchyId
not
foundNullArgumentException
- hierarchyId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageHierarchyAliases()
Id
aliases for
Hierarchy
objects. A return of true does not guarantee
successful authorization. A return of false indicates that it is known
changing an alias will result in a PERMISSION_DENIED.
This is intended as a hint to an application that may opt not to offer
alias operations to an unauthorized user. false
if Hierarchy
aliasing is
not authorized, true
otherwisemandatory
- This method must be implemented. void aliasHierarchy(Id hierarchyId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a Hierarchy
for the
purpose of creating compatibility. The primary Id
of
the Hierarchy
is determined by the provider. The new
Id
performs as an alias to the primary Id.
If the alias is a pointer to another vault it is reassigned to
the given vault Id.
hierarchyId
- the Id
of an Hierarchy
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- hierarchyId
not
foundNullArgumentException
- hierarchyId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.