Interface SignalAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
SignalBatchAdminSession
This session creates, updates, and deletes Signals . 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
getSignalFormForCreate() specifying the desired record Types or
none if no record Types are needed. The returned
SignalForm 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 the 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.
For updates, SignalForms are requested to the Signal
Id that is to be updated using getSignalFormForUpdate() .
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.
The delete operations delete Signals . 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.
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier 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.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
-
getMapId
Id getMapId()Gets theMapIdassociated with this session.- Returns:
- the
Map Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getMap
Gets theMapassociated with this session.- Returns:
- the map
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateSignals
boolean canCreateSignals()Tests if this user can createSignals. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aSignalwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.- Returns:
falseifSignalcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateSignalWithRecordTypes
Tests if this user can create a singleSignalusing the desired record types. WhileMappingPathManager.getSignalRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificSignal. Providing an empty array tests if aSignalcan be created with no records.- Parameters:
signalRecordTypes- array of signal record types- Returns:
trueifSignalcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-signalRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getSignalFormForCreate
SignalForm getSignalFormForCreate(Id pathId, Type[] signalRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the signal form for creating new signals. A new form should be requested for each create transaction.- Parameters:
pathId-Idof the pathsignalRecordTypes- array of signal record types- Returns:
- the signal form
- Throws:
NotFoundException-pathIdis not foundNullArgumentException-pathIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form with given record types- Compliance:
mandatory- This method must be implemented.
-
createSignal
Signal createSignal(SignalForm signalForm) throws OperationFailedException, PermissionDeniedException Creates a newSignal.- Parameters:
signalForm- the form for thisSignal- Returns:
- the new
Signal - Throws:
IllegalStateException-signalFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-signalFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-signalFormdid not originate fromgetSignalFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateSignals
boolean canUpdateSignals()Tests if this user can updateSignals. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aSignalwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.- Returns:
falseifSignalmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getSignalFormForUpdate
SignalForm getSignalFormForUpdate(Id signalId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the signal form for updating an existing signal. A new signal form should be requested for each update transaction.- Parameters:
signalId- theIdof theSignal- Returns:
- the signal form
- Throws:
NotFoundException-signalIdis not foundNullArgumentException-signalIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateSignal
Updates an existing signal.- Parameters:
signalForm- the form containing the elements to be updated- Throws:
IllegalStateException-signalFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-signalIdorsignalFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-signalFormdid not originate fromgetSignalFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteSignals
boolean canDeleteSignals()Tests if this user can deleteSignals. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aSignalwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.- Returns:
falseifSignaldeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteSignal
void deleteSignal(Id signalId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aSignal.- Parameters:
signalId- theIdof theSignalto remove- Throws:
NotFoundException-signalIdnot foundNullArgumentException-signalIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageSignalAliases
boolean canManageSignalAliases()Tests if this user can manageIdaliases forSignals. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifSignalaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasSignal
void aliasSignal(Id signalId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aSignalfor the purpose of creating compatibility. The primaryIdof theSignalis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another signal, it is reassigned to the given signalId.- Parameters:
signalId- theIdof aSignalaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-signalIdnot foundNullArgumentException-signalIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-