Interface ControllerAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
ControllerBatchAdminSession
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.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasController(Id controllerId, Id aliasId) Adds anIdto aControllerfor the purpose of creating compatibility.booleanTests if this user can create controllers.booleancanCreateControllerWithRecordTypes(Type[] controllerRecordTypes) Tests if this user can create a singleControllerusing the desired record types.booleanTests if this user can delete controllers.booleanTests if this user can manageIdaliases for controllers.booleanTests if this user can update controllers.createController(ControllerForm controllerForm) Creates a newController.voiddeleteController(Id controllerId) Deletes aController.getControllerFormForCreate(Type[] controllerRecordTypes) Gets the controller form for creating new controllers.getControllerFormForUpdate(Id controllerId) Gets the controller form for updating an existing controller.Gets theSystemassociated with this session.Gets theSystemIdassociated with this session.voidupdateController(ControllerForm controllerForm) Updates an existing controller.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.
-
canCreateController
boolean canCreateController()Tests if this user can create controllers. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aControllerwill 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:
falseifControllercreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateControllerWithRecordTypes
Tests if this user can create a singleControllerusing the desired record types. WhileControlManager.getControllerRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificController. Providing an empty array tests if aControllercan be created with no records.- Parameters:
controllerRecordTypes- array of controller record types- Returns:
trueifControllercreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-controllerRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getControllerFormForCreate
ControllerForm getControllerFormForCreate(Type[] controllerRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the controller form for creating new controllers. A new form should be requested for each create transaction.- Parameters:
controllerRecordTypes- array of controller record types- Returns:
- the controller form
- Throws:
NullArgumentException-controllerRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createController
Controller createController(ControllerForm controllerForm) throws OperationFailedException, PermissionDeniedException Creates a newController.- Parameters:
controllerForm- the form for thisController- Returns:
- the new
Controller - Throws:
IllegalStateException-controllerFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-controllerFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-controllerFormdid not originate fromgetControllerFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateControllers
boolean canUpdateControllers()Tests if this user can update controllers. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aControllerwill 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:
falseifControllermodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getControllerFormForUpdate
ControllerForm getControllerFormForUpdate(Id controllerId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the controller form for updating an existing controller. A new controller form should be requested for each update transaction.- Parameters:
controllerId- theIdof theController- Returns:
- the controller form
- Throws:
NotFoundException-controllerIdis not foundNullArgumentException-controllerIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateController
void updateController(ControllerForm controllerForm) throws OperationFailedException, PermissionDeniedException Updates an existing controller.- Parameters:
controllerForm- the form containing the elements to be updated- Throws:
IllegalStateException-controllerFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-controllerFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-controllerFormdid not originate fromgetControllerFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteControllers
boolean canDeleteControllers()Tests if this user can delete controllers. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aControllerwill 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:
falseifControllerdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteController
void deleteController(Id controllerId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aController.- Parameters:
controllerId- theIdof theControllerto remove- Throws:
NotFoundException-controllerIdnot foundNullArgumentException-controllerIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageControllerAliases
boolean canManageControllerAliases()Tests if this user can manageIdaliases 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 aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifControlleraliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasController
void aliasController(Id controllerId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aControllerfor the purpose of creating compatibility. The primaryIdof theControlleris determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another controller, it is reassigned to the given controllerId.- Parameters:
controllerId- theIdof aControlleraliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-controllerIdnot foundNullArgumentException-controllerIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-