OSID Logo
OSID Specifications
search package
Version 3.0.0
Release Candidate Preview
Interfaceosid.search.EngineAdminSession
Implementsosid.OsidSession
Description

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.

MethodcanCreateEngines
Description

Tests if this user can create 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.

Returnboolean false if Engine creation is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodcanCreateEngineWithRecordTypes
Description

Tests if this user can create a single Engine using the desired record types. While SearchManager.getEngineRecordTypes() can be used to examine which records 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.

Parametersosid.type.Type[]engineRecordTypesarray of engine record types
Returnboolean true if Engine creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT engineRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetEngineFormForCreate
Description

Gets the engine form for creating new engines. A new form should be requested for each create transaction.

Parametersosid.type.Type[]engineRecordTypesarray of engine record types
Returnosid.search.EngineFormthe engine form
ErrorsNULL_ARGUMENT engineRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get a form with given record types
CompliancemandatoryThis method must be implemented.
MethodcreateEngine
Description

Creates a new Engine.

Parametersosid.search.EngineFormengineFormthe form for this Engine
Returnosid.search.Enginethe new Engine
ErrorsILLEGAL_STATE engineForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT engineForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED engineForm did not originate from getEngineFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateEngines
Description

Tests if this user can update 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.

Returnboolean false if Engine modification is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodgetEngineFormForUpdate
Description

Gets the engine form for updating an existing engine. A new engine form should be requested for each update transaction.

Parametersosid.id.IdengineIdthe Id of the Engine
Returnosid.search.EngineFormthe engine form
ErrorsNULL_ARGUMENT engineId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateEngine
Description

Updates an existing engine.

Parametersosid.search.EngineFormengineFormthe form containing the elements to be updated
ErrorsILLEGAL_STATE engineForm already used in an update transaction
INVALID_ARGUMENTthe form contains an invalid value
NULL_ARGUMENT engineId or engineForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED engineForm did not originate from getEngineFormForUpdate()
CompliancemandatoryThis method must be implemented.
MethodcanDeleteEngines
Description

Tests if this user can delete 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.

Returnboolean false if Engine deletion is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethoddeleteEngine
Description

Deletes an Engine.

Parametersosid.id.IdengineIdthe Id of the Engine to remove
ErrorsNOT_FOUND engineId not found
NULL_ARGUMENT engineId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageEngineAliases
Description

Tests if this user can manage 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.

Returnboolean false if Engine aliasing is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodaliasEngine
Description

Adds an 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.

Parametersosid.id.IdengineIdthe Id of an Engine
osid.id.IdaliasIdthe alias Id
ErrorsALREADY_EXISTS aliasId is already assigned
NOT_FOUND engineId not found
NULL_ARGUMENT engineId or aliasId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.