public interface DeviceBatchAdminSession extends DeviceAdminSession
This session creates, updates, and deletes Devices
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
Device,
a DeviceForm
is requested using
getDeviceFormsForCreate()
specifying the desired record
Types
or none if no record Types
are needed. Each
of the returned DeviceForms
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 DeviceForm
is
submiited to a create operation, it cannot be reused with another create
operation unless the first operation was unsuccessful. Each
DeviceForm
corresponds to an attempted transaction.
The DeviceForms
returned from
getDeviceFormsForCreate()
may be linked to the originating request
through the peer Ids
of the DeviceForm.
In
the case where there may be duplicates, any DeviceForm
of
the same peer Ids
may be used for a create operation.
Once a batch of DeviceForm
are submitted for create, a
CreateDevice
is returned for each DeviceForm,
although the ordering is not defined. Only errors that pertain to
the entire create operation are returned from createDevices(),
errors specific to an individual DeviceForm
are
indicated in the corresponding CreateDevice.
CreateDevices
may be linked to the originating DeviceForm
through the DeviceForm
Id
.
For updates, DeviceForms
are requested to the
Device
Id
that is to be updated using
getDeviceFormsForUpdate()
where the reference Id
in
the DeviceForm
may be used to link the request. Similarly,
the DeviceForm
has metadata about the data that can be
updated and it can perform validation before submitting the update. The
DeviceForm
can only be used once for a successful update
and cannot be reused.
Once a batch of DeviceForms
are submitted for update,
an UpdateDevice
is returned for each DeviceForm,
although the ordering is not defined. Only errors that pertain to
the entire update operation are returned from updateDevices(),
errors specific to an individual DeviceForm
are
indicated in the corresponding UpdateDevice.
UpdateDevices
may be linked to the originating DeviceForm
through the DeviceForm
Id.
The delete operations delete Devices
in bulk. To unmap
a Device
from the current System,
the
DeviceSystemAssignmentSession
should be used. These delete
operations attempt to remove the Device
itself thus
removing it from all known System
catalogs. Bulk delete
operations return the results in DeleteDevices.
Modifier and Type | Method and Description |
---|---|
AliasResponseList |
aliasDevices(AliasRequestList aliasRequests)
Adds an
Id to a Device for the purpose
of creating compatibility. |
CreateResponseList |
createDevices(DeviceBatchFormList deviceForms)
Creates a new set of
Devices. |
DeleteResponseList |
deleteAllDevices()
Deletes all
Devices in this System. |
DeleteResponseList |
deleteDevices(IdList deviceIds)
Deletes devices for the given
Ids. |
DeviceBatchFormList |
getDeviceFormsForCreate(long n,
Type[] deviceRecordTypes)
Gets the device forms for creating a bunch of new devices.
|
DeviceBatchFormList |
getDeviceFormsForUpdate(IdList deviceIds)
Gets the device forms for updating an existing set of devices.
|
UpdateResponseList |
updateDevices(DeviceBatchFormList deviceForms)
Updates existing devices.
|
aliasDevice, canCreateDevices, canCreateDeviceWithRecordTypes, canDeleteDevices, canManageDeviceAliases, canUpdateDevices, createDevice, deleteDevice, getDeviceFormForCreate, getDeviceFormForUpdate, getSystem, getSystemId, updateDevice
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
DeviceBatchFormList getDeviceFormsForCreate(long n, Type[] deviceRecordTypes) throws OperationFailedException, PermissionDeniedException
n
- the number of forms to retrievedeviceRecordTypes
- array of device record types to be included
in each create operation or an empty list if noneNullArgumentException
- deviceRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to request forms with
given record typesmandatory
- This method must be implemented. CreateResponseList createDevices(DeviceBatchFormList deviceForms) throws OperationFailedException, PermissionDeniedException
Devices.
This method returns an
error if the entire operation fails. Otherwise, the status of an
individual create operation is indicated in the
BatchCreateDevice
.deviceForms
- the device formsNullArgumentException
- deviceForms
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeviceBatchFormList getDeviceFormsForUpdate(IdList deviceIds) throws NotFoundException, OperationFailedException, PermissionDeniedException
deviceIds
- the Ids
of the Device
NotFoundException
- a deviceId
is not
foundNullArgumentException
- deviceIds
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. UpdateResponseList updateDevices(DeviceBatchFormList deviceForms) throws OperationFailedException, PermissionDeniedException
BatchCreateDevice
.deviceForms
- the form containing the elements to be updatedNullArgumentException
- deviceForms
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteAllDevices() throws OperationFailedException, PermissionDeniedException
Devices
in this System.
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteDevices(IdList deviceIds) throws OperationFailedException, PermissionDeniedException
Ids.
deviceIds
- the Ids
of the devices to deleteNullArgumentException
- deviceIds
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. AliasResponseList aliasDevices(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException
Id
to a Device
for the purpose
of creating compatibility. The primary Id
of the
Device
is determined by the provider. The new Id
is an alias to the primary Id.
If the alias is
a pointer to another device, it is reassigned to the given device
Id.
aliasRequests
- the alias requestsNullArgumentException
- aliasRequests
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.