Interface ParameterBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession, ParameterAdminSession
This session creates, updates, and deletes Parameters 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
Parameter , a ParameterForm is requested using
getParameterFormsForCreate() specifying the desired record Types
or none if no record Types are needed. Each of the returned
ParameterForms 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 ParameterForm is submiited to a create operation,
it cannot be reused with another create operation unless the first
operation was unsuccessful. Each ParameterForm corresponds to an
attempted transaction.
The ParameterForms returned from
getParameterFormsForCreate() may be linked to the originating request
through the peer Ids of the ParameterForm . In the case
where there may be duplicates, any ParameterForm of the same peer
Ids may be used for a create operation.
Once a batch of ParameterForms are submitted for create, a
CreateResponse is returned for each ParameterForm ,
although the ordering is not defined. Only errors that pertain to the
entire create operation are returned from createParameters() ,
errors specific to an individual ParameterForm are indicated in
the corresponding CreateResponse . CreateResponses may be
linked to the originating ParameterForm through the
ParameterForm Id .
For updates, ParameterForms are requested to the
Parameter Id that is to be updated using
getParameterFormsForUpdate() where the reference Id in the
ParameterForm may be used to link the request. Similarly, the
ParameterForm has metadata about the data that can be updated and it can
perform validation before submitting the update. The ParameterForm
can only be used once for a successful update and cannot be reused.
Once a batch of ParameterForms are submitted for update, an
UpdateResponse is returned for each ParameterForm ,
although the ordering is not defined. Only errors that pertain to the
entire update operation are returned from updateParameters() ,
errors specific to an individual ParameterForm are indicated in
the corresponding UpdateResponse . UpdateResponses may be
linked to the originating ParameterForm through the
ParameterForm Id .
The delete operations delete Parameters in bulk. To unmap a
Parameter from the current Configuration , the
ParameterConfigurationAssignmentSession should be used. These delete
operations attempt to remove the Parameter itself thus removing it
from all known Configuration catalogs. Bulk delete operations
return the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasParameters(AliasRequestList aliasRequests) Adds anIdto aParameterfor the purpose of creating compatibility.createParameters(ParameterBatchFormList parameterForms) Creates a new set ofParameters.Deletes allParametersin thisConfiguration.deleteParameters(IdList parameterIds) Deletes parameters for the givenIds.getParameterFormsForCreate(long number, Type[] parameterRecordTypes) Gets the parameter forms for creating a bunch of new parameters.getParameterFormsForUpdate(IdList parameterIds) Gets the parameter forms for updating an existing set of parameters.updateParameters(ParameterBatchFormList parameterForms) Updates existing parameters.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 ParameterAdminSession
aliasParameter, canCreateParameters, canCreateParameterWithRecordTypes, canDeleteParameters, canManageParameterAliases, canUpdateParameters, createParameter, deleteParameter, getConfiguration, getConfigurationId, getParameterFormForCreate, getParameterFormForUpdate, updateParameterModifier and TypeMethodDescriptionvoidaliasParameter(Id parameterId, Id aliasId) Adds anIdto aParameterfor the purpose of creating compatibility.booleanTests if this user can createParameters.booleancanCreateParameterWithRecordTypes(Type[] parameterRecordTypes) Tests if this user can create a singleParameterusing the desired record types.booleanTests if this user can deleteParameters.booleanTests if this user can manageIdaliases forParameters.booleanTests if this user can updateParameters.createParameter(ParameterForm parameterForm) Creates a newParameter.voiddeleteParameter(Id parameterId) Deletes aParameter.Gets theConfigurationassociated with this session.Gets theConfigurationIdassociated with this session.getParameterFormForCreate(Type[] parameterRecordTypes) Gets the paramater form for creating new parameters.getParameterFormForUpdate(Id parameterId) Gets the parameter form for updating an existing parameters.voidupdateParameter(ParameterForm parameterForm) Updates an existing parameter.
-
Method Details
-
getParameterFormsForCreate
ParameterBatchFormList getParameterFormsForCreate(long number, Type[] parameterRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the parameter forms for creating a bunch of new parameters.- Parameters:
number- the number of forms to retrieveparameterRecordTypes- array of parameter record types to be included in each create operation or an empty list if none- Returns:
- the parameter forms
- Throws:
NullArgumentException-parameterRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createParameters
CreateResponseList createParameters(ParameterBatchFormList parameterForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofParameters. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
parameterForms- the parameter forms- Returns:
- the create responses
- Throws:
NullArgumentException-parameterFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getParameterFormsForUpdate
ParameterBatchFormList getParameterFormsForUpdate(IdList parameterIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the parameter forms for updating an existing set of parameters. A new parameter form should be requested for each update transaction.- Parameters:
parameterIds- theIdsof theParameter- Returns:
- the parameter form
- Throws:
NotFoundException- aparameterIdis not foundNullArgumentException-parameterIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateParameters
UpdateResponseList updateParameters(ParameterBatchFormList parameterForms) throws OperationFailedException, PermissionDeniedException Updates existing parameters. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
parameterForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-parameterFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllParameters
Deletes allParametersin thisConfiguration.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteParameters
DeleteResponseList deleteParameters(IdList parameterIds) throws OperationFailedException, PermissionDeniedException Deletes parameters for the givenIds.- Parameters:
parameterIds- theIdsof the parameters to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-parameterIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasParameters
AliasResponseList aliasParameters(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aParameterfor the purpose of creating compatibility. The primaryIdof theParameteris determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another parameter, it is reassigned to the given parameterId.- 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.
-