Interface InputAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
InputBatchAdminSession
This session creates, updates, and deletes Inputs . 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
Input , a InputForm is requested using
getInputFormForCreate() specifying the desired device, controller, and
record Types or none if no record Types are needed. The
returned InputForm 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 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.
For updates, InputForms are requested to the Input
Id that is to be updated using getInputFormForUpdate() .
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.
The delete operations delete Inputs . To unmap a 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.
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier 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
-
getSystemId
Id getSystemId()Gets theSystemIdassociated with this session.- Returns:
- the
System Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getSystem
Gets theSystemassociated with this session.- Returns:
- the system
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateInputs
boolean canCreateInputs()Tests if this user can createInputs. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aInputwill 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:
falseifInputcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateInputWithRecordTypes
Tests if this user can create a singleInputusing the desired record types. WhileControlManager.getInputRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificInput. Providing an empty array tests if aInputcan be created with no records.- Parameters:
inputRecordTypes- array of input record types- Returns:
trueifInputcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-inputRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getInputFormForCreate
InputForm getInputFormForCreate(Id deviceId, Id controllerId, Type[] inputRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the input form for creating new inputs. A new form should be requested for each create transaction.- Parameters:
deviceId- a deviceIdcontrollerId- a controllerIdinputRecordTypes- array of input record types- Returns:
- the input form
- Throws:
NotFoundException-deviceIdorcontrollerIdis not foundNullArgumentException-deviceId, controllerId, orinputRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createInput
Creates a newInput.- Parameters:
inputForm- the form for thisInput- Returns:
- the new
Input - Throws:
IllegalStateException-inputFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-inputFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-inputFormdid not originate fromgetInputFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateInputs
boolean canUpdateInputs()Tests if this user can updateInputs. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aInputwill 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:
falseifInputmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getInputFormForUpdate
InputForm getInputFormForUpdate(Id inputId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the input form for updating an existing input. A new input form should be requested for each update transaction.- Parameters:
inputId- theIdof theInput- Returns:
- the input form
- Throws:
NotFoundException-inputIdis not foundNullArgumentException-inputIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateInput
Updates an existing input.- Parameters:
inputForm- the form containing the elements to be updated- Throws:
IllegalStateException-inputFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-inputFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-inputFormdid not originate fromgetInputFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteInputs
boolean canDeleteInputs()Tests if this user can deleteInputs. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aInputwill 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:
falseifInputdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteInput
void deleteInput(Id inputId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aInput.- Parameters:
inputId- theIdof theInputto remove- Throws:
NotFoundException-inputIdnot foundNullArgumentException-inputIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageInputAliases
boolean canManageInputAliases()Tests if this user can manageIdaliases forInputs. 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:
falseifInputaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasInput
void aliasInput(Id inputId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aInputfor the purpose of creating compatibility. The primaryIdof theInputis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another input, it is reassigned to the given inputId.- Parameters:
inputId- theIdof aInputaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-inputIdnot foundNullArgumentException-inputIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-