Interface SceneAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
SceneBatchAdminSession
This session creates, updates, and deletes Scenes . 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
Scene , a SceneForm is requested using
getSceneFormForCreate() specifying the desired record Types or
none if no record Types are needed. The returned SceneForm
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
SceneForm is submiited to a create operation, it cannot be reused
with another create operation unless the first operation was unsuccessful.
Each SceneForm corresponds to an attempted transaction.
For updates, SceneForms are requested to the Scene
Id that is to be updated using getSceneFormForUpdate() .
Similarly, the SceneForm has metadata about the data that can be
updated and it can perform validation before submitting the update. The
SceneForm can only be used once for a successful update and cannot
be reused.
The delete operations delete Scenes . To unmap a Scene
from the current System , the SceneSystemAssignmentSession
should be used. These delete operations attempt to remove the
Scene 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 TypeMethodDescriptionvoidaliasScene(Id sceneId, Id aliasId) Adds anIdto aScenefor the purpose of creating compatibility.booleanTests if this user can create scenes.booleancanCreateSceneWithRecordTypes(Type[] sceneRecordTypes) Tests if this user can create a singleSceneusing the desired record types.booleanTests if this user can delete scenes.booleanTests if this user can manageIdaliases forScenes.booleanTests if this user can update scenes.createScene(SceneForm sceneForm) Creates a newScene.voiddeleteScene(Id sceneId) Deletes aScene.getSceneFormForCreate(Type[] sceneRecordTypes) Gets the scene form for creating new scenes.getSceneFormForUpdate(Id sceneId) Gets the scene form for updating an existing scene.Gets theSystemassociated with this session.Gets theSystemIdassociated with this session.voidupdateScene(SceneForm sceneForm) Updates an existing scene.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.
-
canCreateScenes
boolean canCreateScenes()Tests if this user can create scenes. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aScenewill 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:
falseifScenecreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateSceneWithRecordTypes
Tests if this user can create a singleSceneusing the desired record types. WhileControlManager.getSceneRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificScene. Providing an empty array tests if aScenecan be created with no records.- Parameters:
sceneRecordTypes- array of scene record types- Returns:
trueifScenecreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-sceneRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getSceneFormForCreate
SceneForm getSceneFormForCreate(Type[] sceneRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the scene form for creating new scenes. A new form should be requested for each create transaction.- Parameters:
sceneRecordTypes- array of scene record types- Returns:
- the scene form
- Throws:
NullArgumentException-sceneRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createScene
Scene createScene(SceneForm sceneForm) throws NotFoundException, OperationFailedException, PermissionDeniedException Creates a newScene.- Parameters:
sceneForm- the form for thisScene- Returns:
- the new
Scene - Throws:
IllegalStateException-sceneFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNotFoundException-resourceIdoractionIdis not foundNullArgumentException-sceneFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-sceneFormdid not originate fromgetSceneFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateScenes
boolean canUpdateScenes()Tests if this user can update scenes. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aScenewill 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:
falseifScenemodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getSceneFormForUpdate
SceneForm getSceneFormForUpdate(Id sceneId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the scene form for updating an existing scene. A new scene form should be requested for each update transaction.- Parameters:
sceneId- theIdof theScene- Returns:
- the scene form
- Throws:
NotFoundException-sceneIdis not foundNullArgumentException-sceneIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateScene
Updates an existing scene.- Parameters:
sceneForm- the form containing the elements to be updated- Throws:
IllegalStateException-sceneFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-sceneFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-sceneFormdid not originate fromgetSceneFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteScenes
boolean canDeleteScenes()Tests if this user can delete scenes. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aScenewill 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:
falseifScenedeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteScene
void deleteScene(Id sceneId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aScene.- Parameters:
sceneId- theIdof theSceneto remove- Throws:
NotFoundException-sceneIdnot foundNullArgumentException-sceneIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageSceneAliases
boolean canManageSceneAliases()Tests if this user can manageIdaliases forScenes. 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:
falseifScenealiasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasScene
void aliasScene(Id sceneId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aScenefor the purpose of creating compatibility. The primaryIdof theSceneis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another scene, it is reassigned to the given sceneId.- Parameters:
sceneId- theIdof aScenealiasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-sceneIdnot foundNullArgumentException-sceneIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-