public interface InputAdminSession extends OsidSession
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.
Modifier and Type | Method and Description |
---|---|
void |
aliasInput(Id inputId,
Id aliasId)
Adds an
Id to a Input for the purpose of
creating compatibility. |
boolean |
canCreateInputs()
Tests if this user can create
Inputs. |
boolean |
canCreateInputWithRecordTypes(Type[] inputRecordTypes)
Tests if this user can create a single
Input using the
desired record types. |
boolean |
canDeleteInputs()
Tests if this user can delete
Inputs. |
boolean |
canManageInputAliases()
Tests if this user can manage
Id aliases for
Inputs. |
boolean |
canUpdateInputs()
Tests if this user can update
Inputs. |
Input |
createInput(InputForm inputForm)
Creates a new
Input. |
void |
deleteInput(Id inputId)
Deletes a
Input. |
InputForm |
getInputFormForCreate(Id deviceId,
Id controllerId,
Type[] inputRecordTypes)
Gets the input form for creating new inputs.
|
InputForm |
getInputFormForUpdate(Id inputId)
Gets the input form for updating an existing input.
|
System |
getSystem()
Gets the
System associated with this session. |
Id |
getSystemId()
Gets the
System Id associated with this
session. |
void |
updateInput(InputForm inputForm)
Updates an existing input.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getSystemId()
System
Id
associated with this
session. System Id
associated with this sessionmandatory
- This method must be implemented. System getSystem() throws OperationFailedException, PermissionDeniedException
System
associated with this session.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canCreateInputs()
Inputs.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known creating a Input
will result
in a PERMISSION_DENIED.
This is intended as a hint to
an application that may opt not to offer create operations to an
unauthorized user. false
if Input
creation is not
authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateInputWithRecordTypes(Type[] inputRecordTypes)
Input
using the
desired record types. While
ControlManager.getInputRecordTypes()
can be used to examine
which records are supported, this method tests which record(s) are
required for creating a specific Input.
Providing an
empty array tests if a Input
can be created with no
records.inputRecordTypes
- array of input record types true
if Input
creation using the
specified record Types
is supported,
false
otherwiseNullArgumentException
- inputRecordTypes
is null
mandatory
- This method must be implemented. InputForm getInputFormForCreate(Id deviceId, Id controllerId, Type[] inputRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
deviceId
- a device Id
controllerId
- a controller Id
inputRecordTypes
- array of input record typesNotFoundException
- deviceId
or
controllerId
is not foundNullArgumentException
- deviceId, controllerId,
or inputRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. Input createInput(InputForm inputForm) throws OperationFailedException, PermissionDeniedException
Input.
inputForm
- the form for this Input
Input
IllegalStateException
- inputForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- inputForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- inputForm
did not
originate from getInputFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateInputs()
Inputs.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known updating a Input
will result
in a PERMISSION_DENIED.
This is intended as a hint to
an application that may opt not to offer update operations to an
unauthorized user. false
if Input
modification is
not authorized, true
otherwisemandatory
- This method must be implemented. InputForm getInputFormForUpdate(Id inputId) throws NotFoundException, OperationFailedException, PermissionDeniedException
inputId
- the Id
of the Input
NotFoundException
- inputId
is not foundNullArgumentException
- inputId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateInput(InputForm inputForm) throws OperationFailedException, PermissionDeniedException
inputForm
- the form containing the elements to be updatedIllegalStateException
- inputForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- inputForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- inputForm
did not
originate from getInputFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteInputs()
Inputs.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known deleting a Input
will result
in a PERMISSION_DENIED.
This is intended as a hint to
an application that may opt not to offer delete operations to an
unauthorized user. false
if Input
deletion is not
authorized, true
otherwisemandatory
- This method must be implemented. void deleteInput(Id inputId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Input.
inputId
- the Id
of the Input
to
removeNotFoundException
- inputId
not foundNullArgumentException
- inputId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageInputAliases()
Id
aliases for
Inputs.
A return of true does not guarantee successful
authorization. A return of false indicates that it is known changing
an alias will result in a PERMISSION_DENIED.
This is
intended as a hint to an application that may opt not to offer alias
operations to an unauthorized user. false
if Input
aliasing is not
authorized, true
otherwisemandatory
- This method must be implemented. void aliasInput(Id inputId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a Input
for the purpose of
creating compatibility. The primary Id
of the
Input
is determined by the provider. The new Id
performs as an alias to the primary Id.
If the alias is
a pointer to another input, it is reassigned to the given input
Id.
inputId
- the Id
of a Input
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- inputId
not foundNullArgumentException
- inputId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.