Interface DictionaryAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
DictionaryBatchAdminSession
This session creates, updates, and deletes Dictionaries . 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
Dictionary , a DictionaryForm is requested using
getDictionaryFormForCreate() specifying the desired record Types
or none if no record Types are needed. The returned
DictionaryForm 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 DictionaryForm is submiited to a create
operation, it cannot be reused with another create operation unless the
first operation was unsuccessful. Each DictionaryForm corresponds
to an attempted transaction.
For updates, DictionaryForms are requested to the
Dictionary Id that is to be updated using
getDictionaryFormForUpdate() . Similarly, the DictionaryForm has
metadata about the data that can be updated and it can perform validation
before submitting the update. The DictionaryForm can only be used
once for a successful update and cannot be reused.
The delete operations delete Dictionaries .
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasDictionary(Id dictionaryId, Id aliasId) Adds anIdto aDictionaryfor the purpose of creating compatibility.booleanTests if this user can createDictionaries.booleancanCreateDictionaryWithRecordTypes(Type[] dictionaryRecordTypes) Tests if this user can create a singleDictionaryusing the desired record types.booleanTests if this user can deleteDictionaries.booleanTests if this user can manageIdaliases for dictionaries.booleanTests if this user can updateDictionaries.createDictionary(DictionaryForm dictionaryForm) Creates a newDictionary.voiddeleteDictionary(Id dictionaryId) Deletes aDictionary.getDictionaryFormForCreate(Type[] dictionaryRecordTypes) Gets the dictionary form for creating new dictionaries.getDictionaryFormForUpdate(Id dictionaryId) Gets the dictionary form for updating an existing dictionary.voidupdateDictionary(DictionaryForm dictionaryForm) Updates an existing dictionary.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
-
canCreateDictionaries
boolean canCreateDictionaries()Tests if this user can createDictionaries. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aDictionarywill 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:
falseifDictionarycreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateDictionaryWithRecordTypes
Tests if this user can create a singleDictionaryusing the desired record types. WhileDictionaryManager.getDictionaryRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificDictionary. Providing an empty array tests if aDictionarycan be created with no records.- Parameters:
dictionaryRecordTypes- array of dictionary record types- Returns:
trueifDictionarycreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-dictionaryRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getDictionaryFormForCreate
DictionaryForm getDictionaryFormForCreate(Type[] dictionaryRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the dictionary form for creating new dictionaries. A new form should be requested for each create transaction.- Parameters:
dictionaryRecordTypes- array of dictionary record types- Returns:
- the dictionary form
- Throws:
NullArgumentException-dictionaryRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createDictionary
Dictionary createDictionary(DictionaryForm dictionaryForm) throws OperationFailedException, PermissionDeniedException Creates a newDictionary.- Parameters:
dictionaryForm- the form for the newDictionary- Returns:
- the new
Dictionary - Throws:
IllegalStateException-dictionaryFormalready used in a create transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-dictionaryFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-dictionaryFormdid not originate fromgetDictionaryFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateDictionaries
boolean canUpdateDictionaries()Tests if this user can updateDictionaries. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a Dictionary will 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:
falseifDictionarymodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getDictionaryFormForUpdate
DictionaryForm getDictionaryFormForUpdate(Id dictionaryId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the dictionary form for updating an existing dictionary. A new dictionary form should be requested for each update transaction.- Parameters:
dictionaryId- theIdof theDictionary- Returns:
- the dictionary form
- Throws:
NotFoundException-dictionaryIdis not foundNullArgumentException-dictionaryIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateDictionary
void updateDictionary(DictionaryForm dictionaryForm) throws OperationFailedException, PermissionDeniedException Updates an existing dictionary.- Parameters:
dictionaryForm- the form containing the elements to be updated- Throws:
IllegalStateException-dictionaryFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-dictionaryFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- adictionaryFormdid not originate fromgetDictionaryFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteDictionaries
boolean canDeleteDictionaries()Tests if this user can deleteDictionaries. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aDictionarywill 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:
falseifDictionarydeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteDictionary
void deleteDictionary(Id dictionaryId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aDictionary.- Parameters:
dictionaryId- theIdof theDictionaryto delete- Throws:
NotFoundException-dictionaryIdnot foundNullArgumentException-dictionaryIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageDictionaryAliases
boolean canManageDictionaryAliases()Tests if this user can manageIdaliases for dictionaries. 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:
falseifDictionaryaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasDictionary
void aliasDictionary(Id dictionaryId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aDictionaryfor the purpose of creating compatibility. The primaryIdof theDictionaryis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another dictionary it is reassigned to the given dictionaryId.- Parameters:
dictionaryId- theIdof anDictionaryaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-dictionaryIdnot foundNullArgumentException-dictionaryIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-