Interface DictionaryBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, DictionaryAdminSession, OsidSession, OsidSession
This session creates, updates, and deletes Dictionaries in
bulk. 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 an
Dictionary , an DictionaryForm is requested using
getDictionaryFormsForCreate() specifying the desired record Types
or none if no record Types are needed. Each of the returned
DictionaryForms 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 an 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.
The DictionaryForms returned from
getDictionaryFormsForCreate() may be linked to the originating request
through the peer Ids of the DictionaryForm . In the case
where there may be duplicates, any DictionaryForm of the same peer
Ids may be used for a create operation.
Once a batch of DictionaryForms are submitted for create, a
CreateResponse is returned for each DictionaryForm ,
although the ordering is not defined. Only errors that pertain to the
entire create operation are returned from createDictionaries() ,
errors specific to an individual DictionaryForm are indicated in
the corresponding CreateResponse . CreateResponses may be
linked to the originating DictionaryForm through the
DictionaryForm Id .
For updates, DictionaryForms are requested to the
Dictionary Id that is to be updated using
getDictionaryFormsForUpdate() where the reference Id in the
DictionaryForm may be used to link the request. 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.
Once a batch of DictionaryForms are submitted for update, an
UpdateResponse is returned for each DictionaryForm ,
although the ordering is not defined. Only errors that pertain to the
entire update operation are returned from updateDictionaries() ,
errors specific to an individual DictionaryForm are indicated in
the corresponding UpdateResponse . UpdateResponses may be
linked to the originating DictionaryForm through the
DictionaryForm Id .
The delete operations delete Dictionaries in bulk. Bulk delete
operations return the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasDictionaries(AliasRequestList aliasRequests) Adds anIdto anDictionaryfor the purpose of creating compatibility.createDictionaries(DictionaryBatchFormList dictionaryForms) Creates a new set ofDictionaries.Deletes allDictionaries.deleteDictionaries(IdList dictionaryIds) Deletes dictionaries for the givenIds.getDictionaryFormsForCreate(long number, Type[] dictionaryRecordTypes) Gets the dictionary forms for creating a bunch of new dictionaries.getDictionaryFormsForUpdate(IdList dictionaryIds) Gets the dictionary forms for updating an existing set of dictionaries.updateDictionaries(DictionaryBatchFormList dictionaryForms) Updates existing dictionaries.Methods inherited from interface DictionaryAdminSession
aliasDictionary, canCreateDictionaries, canCreateDictionaryWithRecordTypes, canDeleteDictionaries, canManageDictionaryAliases, canUpdateDictionaries, createDictionary, deleteDictionary, getDictionaryFormForCreate, getDictionaryFormForUpdate, updateDictionaryModifier 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
-
getDictionaryFormsForCreate
DictionaryBatchFormList getDictionaryFormsForCreate(long number, Type[] dictionaryRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the dictionary forms for creating a bunch of new dictionaries.- Parameters:
number- the number of forms to retrievedictionaryRecordTypes- array of dictionary record types to be included in each create operation or an empty list if none- Returns:
- the dictionary forms
- Throws:
NullArgumentException-dictionaryRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createDictionaries
CreateResponseList createDictionaries(DictionaryBatchFormList dictionaryForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofDictionaries. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
dictionaryForms- the dictionary forms- Returns:
- the create responses
- Throws:
NullArgumentException-dictionaryFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getDictionaryFormsForUpdate
DictionaryBatchFormList getDictionaryFormsForUpdate(IdList dictionaryIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the dictionary forms for updating an existing set of dictionaries. A new dictionary form should be requested for each update transaction.- Parameters:
dictionaryIds- theIdsof theDictionary- Returns:
- the dictionary form
- Throws:
NotFoundException- andictionaryIdis not foundNullArgumentException-dictionaryIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateDictionaries
UpdateResponseList updateDictionaries(DictionaryBatchFormList dictionaryForms) throws OperationFailedException, PermissionDeniedException Updates existing dictionaries. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
dictionaryForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-dictionaryFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllDictionaries
DeleteResponseList deleteAllDictionaries() throws OperationFailedException, PermissionDeniedExceptionDeletes allDictionaries.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteDictionaries
DeleteResponseList deleteDictionaries(IdList dictionaryIds) throws OperationFailedException, PermissionDeniedException Deletes dictionaries for the givenIds.- Parameters:
dictionaryIds- theIdsof the dictionaries to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-dictionaryIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasDictionaries
AliasResponseList aliasDictionaries(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto anDictionaryfor the purpose of creating compatibility. The primaryIdof theDictionaryis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another dictionary, it is reassigned to the given dictionaryId.- Parameters:
aliasRequests- the alias requests- Returns:
- the alias responses
- Throws:
NullArgumentException-aliasRequestsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-