Interface QualifierAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
QualifierBatchAdminSession
This session creates, updates, and deletes Qualifiers . 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
Qualifier , a QualifierForm is requested using
getQualifierFormForCreate() specifying the desired relationship peers and
record Types or none if no record Types are needed. The
returned QualifierForm 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 QualifierForm is submiited to a create
operation, it cannot be reused with another create operation unless the
first operation was unsuccessful. Each QualifierForm corresponds
to an attempted transaction.
For updates, QualifierForms are requested to the
Qualifier Id that is to be updated using
getQualifierFormForUpdate() . Similarly, the QualifierForm has
metadata about the data that can be updated and it can perform validation
before submitting the update. The QualifierForm can only be used
once for a successful update and cannot be reused.
The delete operations delete Qualifiers . To unmap a
Qualifier from the current Vault , the
QualifierVaultAssignmentSession should be used. These delete operations
attempt to remove the Qualifier itself thus removing it from all
known Vault catalogs.
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasQualifier(Id qualifierId, Id aliasId) Adds anIdto aQualifierfor the purpose of creating compatibility.booleanTests if this user can createQualifiers.booleancanCreateQualifierWithRecordTypes(Type[] qualifierRecordTypes) Tests if this user can create a singleQualifierusing the desired record types.booleanTests if this user can deleteQualifiers.booleanTests if this user can manageIdaliases forQualifiers.booleanTests if this user can updateQualifiers.createQualifier(QualifierForm qualifierForm) Creates a newQualifier.voiddeleteQualifier(Id qualifierId) Deletes aQualifier.getQualifierFormForCreate(Type[] qualifierRecordTypes) Gets the qualifier form for creating new qualifiers.getQualifierFormForUpdate(Id qualifierId) Gets the qualifier form for updating an existing qualifier.getVault()Gets theVaultassociated with this session.Gets theVaultIdassociated with this session.voidupdateQualifier(QualifierForm qualifierForm) Updates an existing qualifier.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
-
getVaultId
Id getVaultId()Gets theVaultIdassociated with this session.- Returns:
- the
Vault Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getVault
Gets theVaultassociated with this session.- Returns:
- the
Vaultassociated with this session - Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateQualifiers
boolean canCreateQualifiers()Tests if this user can createQualifiers. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aQualifierwill 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:
falseifQualifiercreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateQualifierWithRecordTypes
Tests if this user can create a singleQualifierusing the desired record types. WhileAuthorizationManager.getQualifierRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificQualifier. Providing an empty array tests if aQualifiercan be created with no records.- Parameters:
qualifierRecordTypes- array of qualifier record types- Returns:
trueifQualifiercreation using the specifiedTypesis supported,falseotherwise- Throws:
NullArgumentException-qualifierRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getQualifierFormForCreate
QualifierForm getQualifierFormForCreate(Type[] qualifierRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the qualifier form for creating new qualifiers. A new form should be requested for each create transaction.- Parameters:
qualifierRecordTypes- array of qualifier record types- Returns:
- the qualifier form
- Throws:
NullArgumentException-qualifierRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form with requested record types- Compliance:
mandatory- This method must be implemented.
-
createQualifier
Qualifier createQualifier(QualifierForm qualifierForm) throws OperationFailedException, PermissionDeniedException Creates a newQualifier.- Parameters:
qualifierForm- the form for thisQualifier- Returns:
- the new
Qualifier - Throws:
IllegalStateException-qualifierFormalready used for a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-qualifierFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-qualifierFormdid not originate fromgetQualifierFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateQualifiers
boolean canUpdateQualifiers()Tests if this user can updateQualifiers. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aQualifierwill 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:
falseifQualifiermodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getQualifierFormForUpdate
QualifierForm getQualifierFormForUpdate(Id qualifierId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the qualifier form for updating an existing qualifier. A new qualifier form should be requested for each update transaction.- Parameters:
qualifierId- theIdof theQualifier- Returns:
- the qualifier form
- Throws:
NotFoundException-qualifierIdis not foundNullArgumentException-qualifierIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateQualifier
void updateQualifier(QualifierForm qualifierForm) throws OperationFailedException, PermissionDeniedException Updates an existing qualifier.- Parameters:
qualifierForm- the form containing the elements to be updated- Throws:
IllegalStateException-qualifierFormalready used for an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-qualifierFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-qualifierFormdid not originate fromgetQualifierFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteQualifiers
boolean canDeleteQualifiers()Tests if this user can deleteQualifiers. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aQualifierwill 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:
falseifQualifierdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteQualifier
void deleteQualifier(Id qualifierId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aQualifier.- Parameters:
qualifierId- theIdof theQualifierto remove- Throws:
NotFoundException-qualifierIdnot foundNullArgumentException-qualifierIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageQualifierAliases
boolean canManageQualifierAliases()Tests if this user can manageIdaliases forQualifiers. 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:
falseifQualifieraliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasQualifier
void aliasQualifier(Id qualifierId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aQualifierfor the purpose of creating compatibility. The primaryIdof theQualifieris determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another qualifier, it is reassigned to the given qualifierId.- Parameters:
qualifierId- theIdof aQualifieraliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-qualifierIdnot foundNullArgumentException-qualifierIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-