Interface RelationshipEnablerAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session creates, updates, and deletes RelationshipEnablers
. 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
RelationshipEnabler , a RelationshipEnablerForm is requested
using getRelationshipEnablerFormForCreate() specifying desired
record Types or none if no record Types are needed. The
returned RelationshipEnablerForm 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 RelationshipEnablerForm
is submiited to a create operation, it cannot be reused with another
create operation unless the first operation was unsuccessful. Each
RelationshipEnablerForm corresponds to an attempted transaction.
For updates, RelationshipEnablerForms are requested to the
RelationshipEnabler Id that is to be updated using
getRelationshipEnablerFormForUpdate() . Similarly, the
RelationshipEnablerForm has metadata about the data that can be updated
and it can perform validation before submitting the update. The
RelationshipEnablerForm can only be used once for a successful update and
cannot be reused.
The delete operations delete RelationshipEnablers . To unmap a
RelationshipEnabler from the current Family , the
RelationshipEnablerFamilyAssignmentSession should be used. These delete
operations attempt to remove the Node itself thus removing it from
all known Family catalogs.
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasRelationshipEnabler(Id relationshipEnablerId, Id aliasId) Adds anIdto aRelationshipEnablerfor the purpose of creating compatibility.booleanTests if this user can create relationship enablers.booleancanCreateRelationshipEnablerWithRecordTypes(Type[] relationshipEnablerRecordTypes) Tests if this user can create a singleRelationshipEnablerusing the desired record types.booleanTests if this user can delete relationship enablers.booleanTests if this user can manageIdaliases for relationship enablers.booleanTests if this user can update relationship enablers.createRelationshipEnabler(RelationshipEnablerForm relationshipEnablerForm) Creates a newRelationshipEnabler.voiddeleteRelationshipEnabler(Id relationshipEnablerId) Deletes aRelationshipEnabler.Gets theFamilyassociated with this session.Gets theFamilyIdassociated with this session.getRelationshipEnablerFormForCreate(Type[] relationshipEnablerRecordTypes) Gets the relationship enabler form for creating new relationship enablers.getRelationshipEnablerFormForUpdate(Id relationshipEnablerId) Gets the relationship enabler form for updating an existing relationship enabler.voidupdateRelationshipEnabler(RelationshipEnablerForm relationshipEnablerForm) Updates an existing relationship enabler.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
-
getFamilyId
Id getFamilyId()Gets theFamilyIdassociated with this session.- Returns:
- the
Family Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getFamily
Gets theFamilyassociated with this session.- Returns:
- the family
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateRelationshipEnabler
boolean canCreateRelationshipEnabler()Tests if this user can create relationship enablers. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aRelationshipEnablerwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.- Returns:
falseifRelationshipEnablercreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateRelationshipEnablerWithRecordTypes
Tests if this user can create a singleRelationshipEnablerusing the desired record types. WhileRelationshipRulesManager.getRelationshipEnablerRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificRelationshipEnabler. Providing an empty array tests if aRelationshipEnablercan be created with no records.- Parameters:
relationshipEnablerRecordTypes- array of relationship enabler record types- Returns:
trueifRelationshipEnablercreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-relationshipEnablerRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getRelationshipEnablerFormForCreate
RelationshipEnablerForm getRelationshipEnablerFormForCreate(Type[] relationshipEnablerRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the relationship enabler form for creating new relationship enablers. A new form should be requested for each create transaction.- Parameters:
relationshipEnablerRecordTypes- array of relationship enabler record types- Returns:
- the relationship enabler form
- Throws:
NullArgumentException-relationshipEnablerRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createRelationshipEnabler
RelationshipEnabler createRelationshipEnabler(RelationshipEnablerForm relationshipEnablerForm) throws OperationFailedException, PermissionDeniedException Creates a newRelationshipEnabler.- Parameters:
relationshipEnablerForm- the form for thisRelationshipEnabler- Returns:
- the new
RelationshipEnabler - Throws:
IllegalStateException-relationshipEnablerFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-relationshipEnablerFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-relationshipEnablerFormdid not originate fromgetRelationshipEnablerFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateRelationshipEnablers
boolean canUpdateRelationshipEnablers()Tests if this user can update relationship enablers. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aRelationshipEnablerwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.- Returns:
falseifRelationshipEnablermodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getRelationshipEnablerFormForUpdate
RelationshipEnablerForm getRelationshipEnablerFormForUpdate(Id relationshipEnablerId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the relationship enabler form for updating an existing relationship enabler. A new relationship enabler form should be requested for each update transaction.- Parameters:
relationshipEnablerId- theIdof theRelationshipEnabler- Returns:
- the relationship enabler form
- Throws:
NotFoundException-relationshipEnablerIdis not foundNullArgumentException-relationshipEnablerIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateRelationshipEnabler
void updateRelationshipEnabler(RelationshipEnablerForm relationshipEnablerForm) throws OperationFailedException, PermissionDeniedException Updates an existing relationship enabler.- Parameters:
relationshipEnablerForm- the form containing the elements to be updated- Throws:
IllegalStateException-relationshipEnablerFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-relationshipEnablerFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-relationshipEnablerFormdid not originate fromgetRelationshipEnablerFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteRelationshipEnablers
boolean canDeleteRelationshipEnablers()Tests if this user can delete relationship enablers. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aRelationshipEnablerwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.- Returns:
falseifRelationshipEnablerdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteRelationshipEnabler
void deleteRelationshipEnabler(Id relationshipEnablerId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aRelationshipEnabler.- Parameters:
relationshipEnablerId- theIdof theRelationshipEnablerto remove- Throws:
NotFoundException-relationshipEnablerIdnot foundNullArgumentException-relationshipEnablerIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageRelationshipEnablerAliases
boolean canManageRelationshipEnablerAliases()Tests if this user can manageIdaliases for relationship enablers. 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:
falseifRelationshipEnableraliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasRelationshipEnabler
void aliasRelationshipEnabler(Id relationshipEnablerId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aRelationshipEnablerfor the purpose of creating compatibility. The primaryIdof theRelationshipEnableris determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another relationship enabler. it is reassigned to the given relationship enablerId.- Parameters:
relationshipEnablerId- theIdof aRelationshipEnableraliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-relationshipEnablerIdnot foundNullArgumentException-relationshipEnablerIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-