Interface EngineAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, 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 . This session includes
an Id aliasing mechanism to assign an external Id to an
internally assigned Id.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasEngine(Id engineId, Id aliasId) Adds anIdto anEnginefor the purpose of creating compatibility.booleanTests if this user can createEngines.booleancanCreateEngineWithRecordTypes(Type[] engineRecordTypes) Tests if this user can create a singleEngineusing the desired record types.booleanTests if this user can deleteEngines.booleanTests if this user can manageIdaliases forEngines.booleanTests if this user can updateEngines.createEngine(EngineForm engineForm) Creates a newEngine.voiddeleteEngine(Id engineId) Deletes anEngine.getEngineFormForCreate(Type[] engineRecordTypes) Gets the engine form for creating new engines.getEngineFormForUpdate(Id engineId) Gets the engine form for updating an existing engine.voidupdateEngine(EngineForm engineForm) Updates an existing engine.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
-
canCreateEngines
boolean canCreateEngines()Tests if this user can createEngines. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating anEnginewill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer create operations to unauthorized users.- Returns:
falseifEnginecreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateEngineWithRecordTypes
Tests if this user can create a singleEngineusing the desired record types. WhileSearchManager.getEngineRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificEngine. Providing an empty array tests if anEnginecan be created with no records.- Parameters:
engineRecordTypes- array of engine record types- Returns:
trueifEnginecreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-engineRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getEngineFormForCreate
EngineForm getEngineFormForCreate(Type[] engineRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the engine form for creating new engines. A new form should be requested for each create transaction.- Parameters:
engineRecordTypes- array of engine record types- Returns:
- the engine form
- Throws:
NullArgumentException-engineRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get a form with given record types- Compliance:
mandatory- This method must be implemented.
-
createEngine
Engine createEngine(EngineForm engineForm) throws OperationFailedException, PermissionDeniedException Creates a newEngine.- Parameters:
engineForm- the form for thisEngine- Returns:
- the new
Engine - Throws:
IllegalStateException-engineFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-engineFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-engineFormdid not originate fromgetEngineFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateEngines
boolean canUpdateEngines()Tests if this user can updateEngines. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating anEnginewill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.- Returns:
falseifEnginemodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getEngineFormForUpdate
EngineForm getEngineFormForUpdate(Id engineId) throws OperationFailedException, PermissionDeniedException Gets the engine form for updating an existing engine. A new engine form should be requested for each update transaction.- Parameters:
engineId- theIdof theEngine- Returns:
- the engine form
- Throws:
NullArgumentException-engineIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateEngine
Updates an existing engine.- Parameters:
engineForm- the form containing the elements to be updated- Throws:
IllegalStateException-engineFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-engineIdorengineFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-engineFormdid not originate fromgetEngineFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteEngines
boolean canDeleteEngines()Tests if this user can deleteEngines. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting anEnginewill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer delete operations to unauthorized users.- Returns:
falseifEnginedeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteEngine
void deleteEngine(Id engineId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes anEngine.- Parameters:
engineId- theIdof theEngineto remove- Throws:
NotFoundException-engineIdnot foundNullArgumentException-engineIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageEngineAliases
boolean canManageEngineAliases()Tests if this user can manageIdaliases forEngines. 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:
falseifEnginealiasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasEngine
void aliasEngine(Id engineId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto anEnginefor the purpose of creating compatibility. The primaryIdof theEngineis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another engine, it is reassigned to the given engineId.- Parameters:
engineId- theIdof anEnginealiasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-engineIdnot foundNullArgumentException-engineIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-