public interface EngineAdminSession extends OsidSession
This session creates, updates, and deletes Engines. 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 an
Engine, an EngineForm is requested using
getEngineFormForCreate() specifying the desired record
Types or none if no record Types are needed.
The returned EngineForm 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 EngineForm is submiited to
a create operation, it cannot be reused with another create operation
unless the first operation was unsuccessful. Each EngineForm
corresponds to an attempted transaction.
For updates, EngineForms are requested to the
Engine Id that is to be updated using
getEngineFormForUpdate(). Similarly, the EngineForm
has metadata about the data that can be updated and it can perform
validation before submitting the update. The EngineForm can
only be used once for a successful update and cannot be reused.
The delete operations delete Engines. It is safer to
remove all mappings to the Engine catalogs before deletion.
This session includes an Id aliasing mechanism to
assign an external Id to an internally assigned Id.
| Modifier and Type | Method and Description |
|---|---|
void |
aliasEngine(Id engineId,
Id aliasId)
Adds an
Id to an Engine for the purpose
of creating compatibility. |
boolean |
canCreateEngines()
Tests if this user can create
Engines. |
boolean |
canCreateEngineWithRecordTypes(Type[] engineRecordTypes)
Tests if this user can create a single
Engine using the
desired record interface types. |
boolean |
canDeleteEngines()
Tests if this user can delete
Engines. |
boolean |
canManageEngineAliases()
Tests if this user can manage
Id aliases for
Engines. |
boolean |
canUpdateEngines()
Tests if this user can update
Engines. |
Engine |
createEngine(EngineForm engineForm)
Creates a new
Engine. |
void |
deleteEngine(Id engineId)
Deletes an
Engine. |
EngineForm |
getEngineFormForCreate(Type[] engineRecordTypes)
Gets the engine form for creating new engines.
|
EngineForm |
getEngineFormForUpdate(Id engineId)
Gets the engine form for updating an existing engine.
|
void |
updateEngine(EngineForm engineForm)
Updates an existing engine.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseboolean canCreateEngines()
Engines. A return of true
does not guarantee successful authorization. A return of false
indicates that it is known creating an Engine will
result in a PERMISSION_DENIED. This is intended as a
hint to an application that may not wish to offer create operations to
unauthorized users. false if Engine creation is not
authorized, true otherwisemandatory - This method must be implemented. boolean canCreateEngineWithRecordTypes(Type[] engineRecordTypes)
Engine using the
desired record interface types. While
RulesManager.getEngineRecordTypes() can be used to examine
which record interfaces are supported, this method tests which
record(s) are required for creating a specific Engine.
Providing an empty array tests if an Engine can be
created with no records.engineRecordTypes - array of engine record types true if Engine creation using
the specified record Types is supported,
false otherwiseNullArgumentException - engineRecordTypes
is null mandatory - This method must be implemented. EngineForm getEngineFormForCreate(Type[] engineRecordTypes) throws OperationFailedException, PermissionDeniedException
engineRecordTypes - array of engine record typesNullArgumentException - engineRecordTypes
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - unable to get form with
requested record typesmandatory - This method must be implemented. Engine createEngine(EngineForm engineForm) throws OperationFailedException, PermissionDeniedException
Engine. engineForm - the form for this Engine Engine IllegalStateException - engineForm
already used in a create transactionInvalidArgumentException - one or more of the form
elements is invalidNullArgumentException - engineForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - engineForm did
not originate from getEngineFormForCreate() mandatory - This method must be implemented. boolean canUpdateEngines()
Engines. A return of true
does not guarantee successful authorization. A return of false
indicates that it is known updating an Engine will
result in a PERMISSION_DENIED. This is intended as a
hint to an application that may not wish to offer update operations to
unauthorized users. false if Engine modification is
not authorized, true otherwisemandatory - This method must be implemented. EngineForm getEngineFormForUpdate(Id engineId) throws NotFoundException, OperationFailedException, PermissionDeniedException
engineId - the Id of the Engine NotFoundException - engineId is not
foundNullArgumentException - engineId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void updateEngine(EngineForm engineForm) throws OperationFailedException, PermissionDeniedException
engineForm - the form containing the elements to be updatedIllegalStateException - engineForm
already used in an update transactionInvalidArgumentException - the form contains an invalid
valueNullArgumentException - engineForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - engineForm did
not originate from getEngineFormForUpdate() mandatory - This method must be implemented. boolean canDeleteEngines()
Engines. A return of true
does not guarantee successful authorization. A return of false
indicates that it is known deleting an Engine will
result in a PERMISSION_DENIED. This is intended as a
hint to an application that may not wish to offer delete operations to
unauthorized users. false if Engine deletion is not
authorized, true otherwisemandatory - This method must be implemented. void deleteEngine(Id engineId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Engine. engineId - the Id of the Engine to
removeNotFoundException - engineId not foundNullArgumentException - engineId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canManageEngineAliases()
Id aliases for
Engines. 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 Engine aliasing is not
authorized, true otherwisemandatory - This method must be implemented. void aliasEngine(Id engineId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id to an Engine for the purpose
of creating compatibility. The primary Id of the
Engine is determined by the provider. The new Id
performs as an alias to the primary Id. If the
alias is a pointer to another engine it is reassigned to the given
engine Id. engineId - the Id of an Engine aliasId - the alias Id AlreadyExistsException - aliasId is
already assignedNotFoundException - engineId not foundNullArgumentException - engineId or
aliasId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.