Interface SettingBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession, SettingAdminSession
This session creates, updates, and deletes Settings 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 a
Setting , a SettingForm is requested using
getSettingFormsForCreate() specifying the desired controller and record
Types or none if no record Types are needed. Each of the
returned SettingForms 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 a SettingForm is submiited to a create
operation, it cannot be reused with another create operation unless the
first operation was unsuccessful. Each SettingForm corresponds to
an attempted transaction.
The SettingForms returned from
getSettingFormsForCreate() may be linked to the originating request
through the peer Ids of the SettingForm . In the case
where there may be duplicates, any SettingForm of the same peer
Ids may be used for a create operation.
Once a batch of SettingForm are submitted for create, a
CreateSetting is returned for each SettingForm , although the
ordering is not defined. Only errors that pertain to the entire create
operation are returned from createSettings() , errors specific to
an individual SettingForm are indicated in the corresponding
CreateSetting . CreateSettings may be linked to the
originating SettingForm through the SettingForm Id
.
For updates, SettingForms are requested to the Setting
Id that is to be updated using getSettingFormsForUpdate()
where the reference Id in the SettingForm may be used to
link the request. Similarly, the SettingForm has metadata about
the data that can be updated and it can perform validation before
submitting the update. The SettingForm can only be used once for a
successful update and cannot be reused.
Once a batch of SettingForms are submitted for update, an
UpdateSetting is returned for each SettingForm , although
the ordering is not defined. Only errors that pertain to the entire update
operation are returned from updateSettings() , errors specific to
an individual SettingForm are indicated in the corresponding
UpdateSetting . UpdateSettings may be linked to the
originating SettingForm through the SettingForm Id
.
The delete operations delete Settings in bulk. To unmap a
Setting from the current System , the
SettingSystemAssignmentSession should be used. These delete operations
attempt to remove the Setting itself thus removing it from all
known System catalogs. Bulk delete operations return the results
in DeleteSettings .
-
Method Summary
Modifier and TypeMethodDescriptionaliasSettings(AliasRequestList aliasRequests) Adds anIdto aSettingfor the purpose of creating compatibility.createSettings(SettingBatchFormList settingForms) Creates a new set ofSettings.Deletes allSettingsin thisSystem.deleteSettings(IdList settingIds) Deletes settings for the givenIds.deleteSettingsForController(Id controllerId) Deletes settings for the givenController.getSettingFormsForCreate(IdList controllerIds, Type[] settingRecordTypes) Gets the setting forms for creating a bunch of new settings.getSettingFormsForUpdate(IdList settingIds) Gets the setting forms for updating an existing set of settings.updateSettings(SettingBatchFormList settingForms) Updates existing settings.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.Methods inherited from interface SettingAdminSession
aliasSetting, canCreateSettings, canCreateSettingWithRecordTypes, canDeleteSettings, canManageSettingAliases, canUpdateSettings, createSetting, deleteSetting, getSettingFormForCreate, getSettingFormForUpdate, getSystem, getSystemId, updateSettingModifier and TypeMethodDescriptionvoidaliasSetting(Id settingId, Id aliasId) Adds anIdto aSettingfor the purpose of creating compatibility.booleanTests if this user can create settings.booleancanCreateSettingWithRecordTypes(Type[] settingRecordTypes) Tests if this user can create a singleSettingusing the desired record types.booleanTests if this user can delete settings.booleanTests if this user can manageIdaliases forSettings.booleanTests if this user can update settings.createSetting(SettingForm settingForm) Creates a newSetting.voiddeleteSetting(Id settingId) Deletes aSetting.getSettingFormForCreate(Id controllerId, Type[] settingRecordTypes) Gets the setting form for creating new settings.getSettingFormForUpdate(Id settingId) Gets the setting form for updating an existing setting.Gets theSystemassociated with this session.Gets theSystemIdassociated with this session.voidupdateSetting(SettingForm settingForm) Updates an existing setting.
-
Method Details
-
getSettingFormsForCreate
SettingBatchFormList getSettingFormsForCreate(IdList controllerIds, Type[] settingRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the setting forms for creating a bunch of new settings. A form is retrieved for each controller.- Parameters:
controllerIds- list of controllerIdssettingRecordTypes- array of setting record types to be included in each create operation or an empty list if none- Returns:
- the setting forms
- Throws:
NotFoundException- acontrollerIdis not foundNullArgumentException-controllerIdsorsettingRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createSettings
CreateResponseList createSettings(SettingBatchFormList settingForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofSettings. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateSetting.- Parameters:
settingForms- the setting forms- Returns:
- the create responses
- Throws:
NullArgumentException-settingFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getSettingFormsForUpdate
SettingBatchFormList getSettingFormsForUpdate(IdList settingIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the setting forms for updating an existing set of settings. A new setting form should be requested for each update transaction.- Parameters:
settingIds- theIdsof theSetting- Returns:
- the setting form
- Throws:
NotFoundException- asettingIdis not foundNullArgumentException-settingIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateSettings
UpdateResponseList updateSettings(SettingBatchFormList settingForms) throws OperationFailedException, PermissionDeniedException Updates existing settings. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateSetting.- Parameters:
settingForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-settingFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllSettings
Deletes allSettingsin thisSystem.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteSettings
DeleteResponseList deleteSettings(IdList settingIds) throws OperationFailedException, PermissionDeniedException Deletes settings for the givenIds.- Parameters:
settingIds- theIdsof the settings to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-settingIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteSettingsForController
DeleteResponseList deleteSettingsForController(Id controllerId) throws OperationFailedException, PermissionDeniedException Deletes settings for the givenController.- Parameters:
controllerId- a controllerId- Returns:
- the delete responses
- Throws:
NullArgumentException-controllerIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasSettings
AliasResponseList aliasSettings(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aSettingfor the purpose of creating compatibility. The primaryIdof theSettingis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another setting, it is reassigned to the given settingId.- 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.
-