Interface ConfigurationBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, ConfigurationAdminSession, OsidSession, OsidSession
This session creates, updates, and deletes Configurations 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
Configuration , an ConfigurationForm is requested using
getConfigurationFormsForCreate() specifying the desired record
Types or none if no record Types are needed. Each of the
returned ConfigurationForms 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 ConfigurationForm is submiited to
a create operation, it cannot be reused with another create operation
unless the first operation was unsuccessful. Each
ConfigurationForm corresponds to an attempted transaction.
The ConfigurationForms returned from
getConfigurationFormsForCreate() may be linked to the originating request
through the peer Ids of the ConfigurationForm . In the
case where there may be duplicates, any ConfigurationForm of the
same peer Ids may be used for a create operation.
Once a batch of ConfigurationForms are submitted for create, a
CreateResponse is returned for each ConfigurationForm ,
although the ordering is not defined. Only errors that pertain to the
entire create operation are returned from createConfigurations() ,
errors specific to an individual ConfigurationForm are indicated
in the corresponding CreateResponse . CreateResponses may
be linked to the originating ConfigurationForm through the
ConfigurationForm Id .
For updates, ConfigurationForms are requested to the
Configuration Id that is to be updated using
getConfigurationFormsForUpdate() where the reference Id in the
ConfigurationForm may be used to link the request. Similarly, the
ConfigurationForm has metadata about the data that can be updated
and it can perform validation before submitting the update. The
ConfigurationForm can only be used once for a successful update and
cannot be reused.
Once a batch of ConfigurationForms are submitted for update,
an UpdateResponse is returned for each ConfigurationForm ,
although the ordering is not defined. Only errors that pertain to the
entire update operation are returned from updateConfigurations() ,
errors specific to an individual ConfigurationForm are indicated
in the corresponding UpdateResponse . UpdateResponses may
be linked to the originating ConfigurationForm through the
ConfigurationForm Id .
The delete operations delete Configurations in bulk. Bulk
delete operations return the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasConfigurations(AliasRequestList aliasRequests) Adds anIdto anConfigurationfor the purpose of creating compatibility.createConfigurations(ConfigurationBatchFormList configurationForms) Creates a new set ofConfigurations.Deletes allConfigurations.deleteConfigurations(IdList configurationIds) Deletes configurations for the givenIds.getConfigurationFormsForCreate(long number, Type[] configurationRecordTypes) Gets the configuration forms for creating a bunch of new configurations.getConfigurationFormsForUpdate(IdList configurationIds) Gets the configuration forms for updating an existing set of configurations.updateConfigurations(ConfigurationBatchFormList configurationForms) Updates existing configurations.Methods inherited from interface ConfigurationAdminSession
aliasConfiguration, canCreateConfigurations, canCreateConfigurationWithRecordTypes, canDeleteConfigurations, canManageConfigurationAliases, canUpdateConfigurations, createConfiguration, deleteConfiguration, getConfigurationFormForCreate, getConfigurationFormForUpdate, updateConfigurationModifier and TypeMethodDescriptionvoidaliasConfiguration(Id configurationId, Id aliasId) Adds anIdto aConfigurationfor the purpose of creating compatibility.booleanTests if this user can createConfigurations.booleancanCreateConfigurationWithRecordTypes(Type[] configurationRecordTypes) Tests if this user can create a singleConfigurationusing the desired record types.booleanTests if this user can deleteConfigurations.booleanTests if this user can manageIdaliases forConfigurations.booleanTests if this user can updateConfigurations.createConfiguration(ConfigurationForm configurationForm) Creates a newConfiguration.voiddeleteConfiguration(Id configurationId) Deletes aConfiguration.getConfigurationFormForCreate(Type[] configurationRecordTypes) Gets the configuration form for creating new configurations.getConfigurationFormForUpdate(Id configurationId) Gets the configuration form for updating existing configurations.voidupdateConfiguration(ConfigurationForm configurationForm) Updates an existingConfiguration.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
-
getConfigurationFormsForCreate
ConfigurationBatchFormList getConfigurationFormsForCreate(long number, Type[] configurationRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the configuration forms for creating a bunch of new configurations.- Parameters:
number- the number of forms to retrieveconfigurationRecordTypes- array of configuration record types to be included in each create operation or an empty list if none- Returns:
- the configuration forms
- Throws:
NullArgumentException-configurationRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createConfigurations
CreateResponseList createConfigurations(ConfigurationBatchFormList configurationForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofConfigurations. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
configurationForms- the configuration forms- Returns:
- the create responses
- Throws:
NullArgumentException-configurationFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getConfigurationFormsForUpdate
ConfigurationBatchFormList getConfigurationFormsForUpdate(IdList configurationIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the configuration forms for updating an existing set of configurations. A new configuration form should be requested for each update transaction.- Parameters:
configurationIds- theIdsof theConfiguration- Returns:
- the configuration form
- Throws:
NotFoundException- anconfigurationIdis not foundNullArgumentException-configurationIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateConfigurations
UpdateResponseList updateConfigurations(ConfigurationBatchFormList configurationForms) throws OperationFailedException, PermissionDeniedException Updates existing configurations. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
configurationForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-configurationFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllConfigurations
DeleteResponseList deleteAllConfigurations() throws OperationFailedException, PermissionDeniedExceptionDeletes allConfigurations.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteConfigurations
DeleteResponseList deleteConfigurations(IdList configurationIds) throws OperationFailedException, PermissionDeniedException Deletes configurations for the givenIds.- Parameters:
configurationIds- theIdsof the configurations to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-configurationIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasConfigurations
AliasResponseList aliasConfigurations(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto anConfigurationfor the purpose of creating compatibility. The primaryIdof theConfigurationis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another configuration, it is reassigned to the given entryId.- 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.
-