public interface ControllerAdminSession extends OsidSession
This session creates, updates, and deletes Controllers.
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
Controller,
a ControllerForm
is requested using
getControllerFormForCreate()
specifying the record
Types
or none if no record Types
are needed. The
returned ControllerForm
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 ControllerForm
is
submiited to a create operation, it cannot be reused with another create
operation unless the first operation was unsuccessful. Each
ControllerForm
corresponds to an attempted transaction.
For updates, ControllerForms
are requested to the
Controller
Id
that is to be updated using
getControllerFormForUpdate().
Similarly, the
ControllerForm
has metadata about the data that can be updated and
it can perform validation before submitting the update. The
ControllerForm
can only be used once for a successful update and
cannot be reused.
The delete operations delete Controllers.
To unmap a
Controller
from the current System,
the
ControllerSystemAssignmentSession
should be used. These
delete operations attempt to remove the Controller
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 |
aliasController(Id controllerId,
Id aliasId)
Adds an
Id to a Controller for the
purpose of creating compatibility. |
boolean |
canCreateController()
Tests if this user can create controllers.
|
boolean |
canCreateControllerWithRecordTypes(Type[] controllerRecordTypes)
Tests if this user can create a single
Controller using
the desired record types. |
boolean |
canDeleteControllers()
Tests if this user can delete controllers.
|
boolean |
canManageControllerAliases()
Tests if this user can manage
Id aliases for
controllers. |
boolean |
canUpdateControllers()
Tests if this user can update controllers.
|
Controller |
createController(ControllerForm controllerForm)
Creates a new
Controller. |
void |
deleteController(Id controllerId)
Deletes a
Controller. |
ControllerForm |
getControllerFormForCreate(Type[] controllerRecordTypes)
Gets the controller form for creating new controllers.
|
ControllerForm |
getControllerFormForUpdate(Id controllerId)
Gets the controller form for updating an existing controller.
|
System |
getSystem()
Gets the
System associated with this session. |
Id |
getSystemId()
Gets the
System Id associated with this
session. |
void |
updateController(ControllerForm controllerForm)
Updates an existing controller.
|
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 canCreateController()
Controller
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 Controller
creation is
not authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateControllerWithRecordTypes(Type[] controllerRecordTypes)
Controller
using
the desired record types. While
ControlManager.getControllerRecordTypes()
can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific Controller.
Providing an empty array tests if a Controller
can be
created with no records.controllerRecordTypes
- array of controller record types true
if Controller
creation
using the specified record Types
is supported,
false
otherwiseNullArgumentException
- controllerRecordTypes
is null
mandatory
- This method must be implemented. ControllerForm getControllerFormForCreate(Type[] controllerRecordTypes) throws OperationFailedException, PermissionDeniedException
controllerRecordTypes
- array of controller record typesNullArgumentException
- controllerRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. Controller createController(ControllerForm controllerForm) throws OperationFailedException, PermissionDeniedException
Controller.
controllerForm
- the form for this Controller
Controller
IllegalStateException
- controllerForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- controllerForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- controllerForm
did not originate from getControllerFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateControllers()
Controller
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 Controller
modification
is not authorized, true
otherwisemandatory
- This method must be implemented. ControllerForm getControllerFormForUpdate(Id controllerId) throws NotFoundException, OperationFailedException, PermissionDeniedException
controllerId
- the Id
of the Controller
NotFoundException
- controllerId
is not
foundNullArgumentException
- controllerId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateController(ControllerForm controllerForm) throws OperationFailedException, PermissionDeniedException
controllerForm
- the form containing the elements to be updatedIllegalStateException
- controllerForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- controllerForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- controllerForm
did not originate from getControllerFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteControllers()
Controller
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 Controller
deletion is
not authorized, true
otherwisemandatory
- This method must be implemented. void deleteController(Id controllerId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Controller.
controllerId
- the Id
of the Controller
to removeNotFoundException
- controllerId
not
foundNullArgumentException
- controllerId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageControllerAliases()
Id
aliases for
controllers. 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 Controller
aliasing is
not authorized, true
otherwisemandatory
- This method must be implemented. void aliasController(Id controllerId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a Controller
for the
purpose of creating compatibility. The primary Id
of
the Controller
is determined by the provider. The new
Id
performs as an alias to the primary Id
. If the alias is a pointer to another controller, it is
reassigned to the given controller Id.
controllerId
- the Id
of a Controller
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- controllerId
not
foundNullArgumentException
- controllerId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.