Interface InputBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, InputAdminSession, OsidSession, OsidSession
This session creates, updates, and deletes Inputs 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
Input , an InputForm is requested using
getInputFormsForCreate() specifying the desired device, controller, and
record Types or none if no record Types are needed. Each
of the returned InputForms 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 InputForm is submiited to a create
operation, it cannot be reused with another create operation unless the
first operation was unsuccessful. Each InputForm corresponds to an
attempted transaction.
The InputForms returned from getInputFormsForCreate()
may be linked to the originating request through the peer Ids of
the InputForm . In the case where there may be duplicates, any
InputForm of the same peer Ids may be used for a create
operation.
Once a batch of InputForm are submitted for create, a
CreateInput is returned for each InputForm , although the
ordering is not defined. Only errors that pertain to the entire create
operation are returned from createInputs() , errors specific to an
individual InputForm are indicated in the corresponding
CreateInput . CreateInputs may be linked to the originating
InputForm through the InputForm Id .
For updates, InputForms are requested to the Input
Id that is to be updated using getInputFormsForUpdate()
where the reference Id in the InputForm may be used to
link the request. Similarly, the InputForm has metadata about the
data that can be updated and it can perform validation before submitting
the update. The InputForm can only be used once for a successful
update and cannot be reused.
Once a batch of InputForms are submitted for update, an
UpdateInput is returned for each InputForm , although the
ordering is not defined. Only errors that pertain to the entire update
operation are returned from updateInputs() , errors specific to an
individual InputForm are indicated in the corresponding
UpdateInput . UpdateInputs may be linked to the originating
InputForm through the InputForm Id .
The delete operations delete Inputs in bulk. To unmap an
Input from the current System , the
InputSystemAssignmentSession should be used. These delete operations
attempt to remove the Input itself thus removing it from all known
System catalogs. Bulk delete operations return the results in
DeleteInputs .
-
Method Summary
Modifier and TypeMethodDescriptionaliasInputs(AliasRequestList aliasRequests) Adds anIdto anInputfor the purpose of creating compatibility.createInputs(InputBatchFormList inputForms) Creates a new set ofInputs.Deletes allInputsin thisSystem.Deletes inputs expired before the given date.deleteInputs(IdList inputIds) Deletes inputs for the givenIds.deleteInputsForController(Id controllerId) Deletes inputs for the givenController.deleteInputsForDevice(Id deviceId) Deletes inputs for the givenDevice.getInputFormsForCreate(InputPeerList peers, Type[] inputRecordTypes) Gets the input forms for creating a bunch of new inputs.getInputFormsForUpdate(IdList inputIds) Gets the input forms for updating an existing set of inputs.updateInputs(InputBatchFormList inputForms) Updates existing inputs.Methods inherited from interface InputAdminSession
aliasInput, canCreateInputs, canCreateInputWithRecordTypes, canDeleteInputs, canManageInputAliases, canUpdateInputs, createInput, deleteInput, getInputFormForCreate, getInputFormForUpdate, getSystem, getSystemId, updateInputModifier and TypeMethodDescriptionvoidaliasInput(Id inputId, Id aliasId) Adds anIdto aInputfor the purpose of creating compatibility.booleanTests if this user can createInputs.booleancanCreateInputWithRecordTypes(Type[] inputRecordTypes) Tests if this user can create a singleInputusing the desired record types.booleanTests if this user can deleteInputs.booleanTests if this user can manageIdaliases forInputs.booleanTests if this user can updateInputs.createInput(InputForm inputForm) Creates a newInput.voiddeleteInput(Id inputId) Deletes aInput.getInputFormForCreate(Id deviceId, Id controllerId, Type[] inputRecordTypes) Gets the input form for creating new inputs.getInputFormForUpdate(Id inputId) Gets the input form for updating an existing input.Gets theSystemassociated with this session.Gets theSystemIdassociated with this session.voidupdateInput(InputForm inputForm) Updates an existing input.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
-
getInputFormsForCreate
InputBatchFormList getInputFormsForCreate(InputPeerList peers, Type[] inputRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the input forms for creating a bunch of new inputs. A form is retrieved for each device and controller pair.- Parameters:
peers- list of device controller peersinputRecordTypes- array of input record types to be included in each create operation or an empty list if none- Returns:
- the input forms
- Throws:
NotFoundException- adeviceIdorcontrollerIdis not foundNullArgumentException-peersorinputRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createInputs
CreateResponseList createInputs(InputBatchFormList inputForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofInputs. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateInput.- Parameters:
inputForms- the input forms- Returns:
- the create responses
- Throws:
NullArgumentException-inputFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getInputFormsForUpdate
InputBatchFormList getInputFormsForUpdate(IdList inputIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the input forms for updating an existing set of inputs. A new input form should be requested for each update transaction.- Parameters:
inputIds- theIdsof theInput- Returns:
- the input form
- Throws:
NotFoundException- aninputIdis not foundNullArgumentException-inputIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateInputs
UpdateResponseList updateInputs(InputBatchFormList inputForms) throws OperationFailedException, PermissionDeniedException Updates existing inputs. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateInput.- Parameters:
inputForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-inputFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllInputs
Deletes allInputsin thisSystem.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteInputs
DeleteResponseList deleteInputs(IdList inputIds) throws OperationFailedException, PermissionDeniedException Deletes inputs for the givenIds.- Parameters:
inputIds- theIdsof the inputs to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-inputIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteInputsForDevice
DeleteResponseList deleteInputsForDevice(Id deviceId) throws OperationFailedException, PermissionDeniedException Deletes inputs for the givenDevice.- Parameters:
deviceId- a deviceIdId- Returns:
- the delete responses
- Throws:
NullArgumentException-deviceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteInputsForController
DeleteResponseList deleteInputsForController(Id controllerId) throws OperationFailedException, PermissionDeniedException Deletes inputs 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.
-
deleteIneffectiveInputsByDate
DeleteResponseList deleteIneffectiveInputsByDate(DateTime date) throws OperationFailedException, PermissionDeniedException Deletes inputs expired before the given date.- Parameters:
date- a date- Returns:
- the delete responses
- Throws:
NullArgumentException-dateisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasInputs
AliasResponseList aliasInputs(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto anInputfor the purpose of creating compatibility. The primaryIdof theInputis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another input, it is reassigned to the given inputId.- 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.
-