Interface SignalBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession, SignalAdminSession
This session creates, updates, and deletes Signals 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
Signal , a SignalForm is requested using
getSignalFormsForCreate() specifying the desired path and record
Types or none if no record Types are needed. Each of the returned
SignalForms 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 SignalForm is submiited to a create operation, it
cannot be reused with another create operation unless the first operation
was unsuccessful. Each SignalForm corresponds to an attempted
transaction.
The SignalForms returned from
getSignalFormsForCreate() may be linked to the originating request
through the peer Ids of the SignalForm . In the case where
there may be duplicates, any SignalForm of the same peer
Ids may be used for a create operation.
Once a batch of SignalForms are submitted for create, a
CreateResponse is returned for each SignalForm , although the
ordering is not defined. Only errors that pertain to the entire create
operation are returned from createSignals() , errors specific to
an individual SignalForm are indicated in the corresponding
CreateResponse . CreateResponses may be linked to the originating
SignalForm through the SignalForm Id .
For updates, SignalForms are requested to the Signal
Id that is to be updated using getSignalFormsForUpdate()
where the reference Id in the SignalForm may be used to
link the request. Similarly, the SignalForm has metadata about the
data that can be updated and it can perform validation before submitting
the update. The SignalForm can only be used once for a successful
update and cannot be reused.
Once a batch of SignalForms are submitted for update, an
UpdateResponse is returned for each SignalForm , although
the ordering is not defined. Only errors that pertain to the entire update
operation are returned from updateSignals() , errors specific to
an individual SignalForm are indicated in the corresponding
UpdateResponse . UpdateResponses may be linked to the originating
SignalForm through the SignalForm Id .
The delete operations delete Signals in bulk. To unmap a
Signal from the current Map , the
SignalMapAssignmentSession should be used. These delete operations
attempt to remove the Signal itself thus removing it from all
known Map catalogs. Bulk delete operations return the results in
DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasSignals(AliasRequestList aliasRequests) Adds anIdto aSignalfor the purpose of creating compatibility.createSignals(SignalBatchFormList signalForms) Creates a new set ofSignals.Deletes allSignalsin thisMap.deleteSignals(IdList signalIds) Deletes signals for the givenIds.deleteSignalsForPath(Id pathId) Deletes signals for the given path.getSignalFormsForCreate(IdList pathIds, Type[] signalRecordTypes) Gets the signal forms for creating a bunch of new signals.getSignalFormsForUpdate(IdList signalIds) Gets the signal forms for updating an existing set of signals.updateSignals(SignalBatchFormList signalForms) Updates existing signals.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 SignalAdminSession
aliasSignal, canCreateSignals, canCreateSignalWithRecordTypes, canDeleteSignals, canManageSignalAliases, canUpdateSignals, createSignal, deleteSignal, getMap, getMapId, getSignalFormForCreate, getSignalFormForUpdate, updateSignalModifier and TypeMethodDescriptionvoidaliasSignal(Id signalId, Id aliasId) Adds anIdto aSignalfor the purpose of creating compatibility.booleanTests if this user can createSignals.booleancanCreateSignalWithRecordTypes(Type[] signalRecordTypes) Tests if this user can create a singleSignalusing the desired record types.booleanTests if this user can deleteSignals.booleanTests if this user can manageIdaliases forSignals.booleanTests if this user can updateSignals.createSignal(SignalForm signalForm) Creates a newSignal.voiddeleteSignal(Id signalId) Deletes aSignal.getMap()Gets theMapassociated with this session.getMapId()Gets theMapIdassociated with this session.getSignalFormForCreate(Id pathId, Type[] signalRecordTypes) Gets the signal form for creating new signals.getSignalFormForUpdate(Id signalId) Gets the signal form for updating an existing signal.voidupdateSignal(SignalForm signalForm) Updates an existing signal.
-
Method Details
-
getSignalFormsForCreate
SignalBatchFormList getSignalFormsForCreate(IdList pathIds, Type[] signalRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the signal forms for creating a bunch of new signals. A form is returned for each supplied path.- Parameters:
pathIds- a list of pathssignalRecordTypes- array of signal record types to be included in each create operation or an empty list if none- Returns:
- the signal forms
- Throws:
NotFoundException- apathIdis not foundNullArgumentException-pathIdsorsignalRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createSignals
CreateResponseList createSignals(SignalBatchFormList signalForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofSignals. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
signalForms- the signal forms- Returns:
- the create responses
- Throws:
NullArgumentException-signalFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getSignalFormsForUpdate
SignalBatchFormList getSignalFormsForUpdate(IdList signalIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the signal forms for updating an existing set of signals. A new signal form should be requested for each update transaction.- Parameters:
signalIds- theIdsof theSignal- Returns:
- the signal forms
- Throws:
NotFoundException- asignalIdis not foundNullArgumentException-signalIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateSignals
UpdateResponseList updateSignals(SignalBatchFormList signalForms) throws OperationFailedException, PermissionDeniedException Updates existing signals. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
signalForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-signalFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllSignals
Deletes allSignalsin thisMap.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteSignals
DeleteResponseList deleteSignals(IdList signalIds) throws OperationFailedException, PermissionDeniedException Deletes signals for the givenIds.- Parameters:
signalIds- theIdsof the signals to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-signalIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteSignalsForPath
DeleteResponseList deleteSignalsForPath(Id pathId) throws OperationFailedException, PermissionDeniedException Deletes signals for the given path.- Parameters:
pathId- theIdof a path- Returns:
- the delete responses
- Throws:
NullArgumentException-pathIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasSignals
AliasResponseList aliasSignals(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aSignalfor the purpose of creating compatibility. The primaryIdof theSignalis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another signal, it is reassigned to the given signalId.- 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.
-