Interface ValueBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession, ValueAdminSession
This session creates, updates, and deletes Values 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
Value , a ValueForm is requested using
getValueFormsForCreate() specifying the desired parameter and record
Types or none if no record Types are needed. Each of the
returned ValueForms 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 ValueForm is submiited to a create operation,
it cannot be reused with another create operation unless the first
operation was unsuccessful. Each ValueForm corresponds to an
attempted transaction.
The ValueForms returned from getValueFormsForCreate()
may be linked to the originating request through the peer Ids of
the ValueForm . In the case where there may be duplicates, any
ValueForm of the same peer Ids may be used for a create
operation.
Once a batch of ValueForms are submitted for create, a
CreateResponse is returned for each ValueForm , although the
ordering is not defined. Only errors that pertain to the entire create
operation are returned from createValues() , errors specific to an
individual ValueForm are indicated in the corresponding
CreateResponse . CreateResponses may be linked to the originating
ValueForm through the ValueForm Id .
For updates, ValueForms are requested to the Value
Id that is to be updated using getValueFormsForUpdate()
where the reference Id in the ValueForm may be used to
link the request. Similarly, the ValueForm has metadata about the
data that can be updated and it can perform validation before submitting
the update. The ValueForm can only be used once for a successful
update and cannot be reused.
Once a batch of ValueForms are submitted for update, an
UpdateResponse is returned for each ValueForm , although the
ordering is not defined. Only errors that pertain to the entire update
operation are returned from updateValues() , errors specific to an
individual ValueForm are indicated in the corresponding
UpdateResponse . UpdateResponses may be linked to the originating
ValueForm through the ValueForm Id .
The delete operations delete Values in bulk. To unmap a
Value from the current Configuration , the
ValueConfigurationAssignmentSession should be used. These delete
operations attempt to remove the Value itself thus removing it
from all known Configuration catalogs. Bulk delete operations
return the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasValues(AliasRequestList aliasRequests) Adds anIdto aValuefor the purpose of creating compatibility.createValues(ValueBatchFormList valueForms) Creates a new set ofValues.Deletes allValuesin thisConfiguration.deleteValues(IdList valueIds) Deletes values for the givenIds.deleteValuesForParameter(Id parameterId) Deletes values for the given parameter.getValueFormsForCreate(IdList parameterIdList, Type[] valueRecordTypes) Gets the value forms for creating a bunch of new values.getValueFormsForUpdate(IdList valueIds) Gets the value forms for updating an existing set of values.updateValues(ValueBatchFormList valueForms) Updates existing values.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 ValueAdminSession
aliasValue, canCreateValues, canCreateValueWithRecordTypes, canDeleteValues, canManageValueAliases, canUpdateValues, createValue, deleteValue, getConfiguration, getConfigurationId, getValueFormForCreate, getValueFormForUpdate, supportValueConditions, updateValueModifier and TypeMethodDescriptionvoidaliasValue(Id valueId, Id aliasId) Adds anIdto aValuefor the purpose of creating compatibility.booleanTests if this user can createValues.booleancanCreateValueWithRecordTypes(Type[] valueRecordTypes) Tests if this user can create a singleValueusing the desired record types.booleanTests if this user can deleteValues.booleanTests if this user can manageIdaliases forValues.booleanTests if this user can updateValues.createValue(ValueForm valueForm) Creates a value.voiddeleteValue(Id valueId) Deletes the specified value.Gets theConfigurationassociated with this session.Gets theConfigurationIdassociated with this session.getValueFormForCreate(Id parameterId, Type[] valueRecordTypes) Gets the form for creating new values.getValueFormForUpdate(Id valueId) Gets the value form for updating an existing value.booleanTests if applying conditions to values is supported.voidupdateValue(ValueForm valueForm) Updates an existing value.
-
Method Details
-
getValueFormsForCreate
ValueBatchFormList getValueFormsForCreate(IdList parameterIdList, Type[] valueRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the value forms for creating a bunch of new values. A form is returned for each supplied parameter.- Parameters:
parameterIdList- the number of forms to retrievevalueRecordTypes- array of value record types to be included in each create operation or an empty list if none- Returns:
- the value forms
- Throws:
NotFoundException- a parameterIdis not foundNullArgumentException-parameterIdListorvalueRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createValues
CreateResponseList createValues(ValueBatchFormList valueForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofValues. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
valueForms- the value forms- Returns:
- the create responses
- Throws:
NullArgumentException-valueFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getValueFormsForUpdate
ValueBatchFormList getValueFormsForUpdate(IdList valueIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the value forms for updating an existing set of values. A new value form should be requested for each update transaction.- Parameters:
valueIds- theIdsof theValue- Returns:
- the value form
- Throws:
NotFoundException- avalueIdis not foundNullArgumentException-valueIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateValues
UpdateResponseList updateValues(ValueBatchFormList valueForms) throws OperationFailedException, PermissionDeniedException Updates existing values. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
valueForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-valueFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllValues
Deletes allValuesin thisConfiguration.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteValues
DeleteResponseList deleteValues(IdList valueIds) throws OperationFailedException, PermissionDeniedException Deletes values for the givenIds.- Parameters:
valueIds- theIdsof the values to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-valueIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteValuesForParameter
DeleteResponseList deleteValuesForParameter(Id parameterId) throws OperationFailedException, PermissionDeniedException Deletes values for the given parameter.- Parameters:
parameterId- a parameterIds- Returns:
- the delete responses
- Throws:
NullArgumentException-parameterIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasValues
AliasResponseList aliasValues(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aValuefor the purpose of creating compatibility. The primaryIdof theValueis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another value, it is reassigned to the given valueId.- 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.
-