Interface SceneAdminSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
All Known Subinterfaces:
SceneBatchAdminSession

public interface SceneAdminSession extends OsidSession

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 Details

    • getSystemId

      Id getSystemId()
      Gets the System Id associated with this session.
      Returns:
      the System Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getSystem

      Gets the System associated with this session.
      Returns:
      the system
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - 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 a Scene will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.
      Returns:
      false if Scene creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateSceneWithRecordTypes

      boolean canCreateSceneWithRecordTypes(Type[] sceneRecordTypes)
      Tests if this user can create a single Scene using the desired record types. While ControlManager.getSceneRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific Scene . Providing an empty array tests if a Scene can be created with no records.
      Parameters:
      sceneRecordTypes - array of scene record types
      Returns:
      true if Scene creation using the specified record Types is supported, false otherwise
      Throws:
      NullArgumentException - sceneRecordTypes is null
      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 - sceneRecordTypes is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - unable to get form for requested record types
      Compliance:
      mandatory - This method must be implemented.
    • createScene

      Creates a new Scene .
      Parameters:
      sceneForm - the form for this Scene
      Returns:
      the new Scene
      Throws:
      IllegalStateException - sceneForm already used in a create transaction
      InvalidArgumentException - one or more of the form elements is invalid
      NotFoundException - resourceId or actionId is not found
      NullArgumentException - sceneForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - sceneForm did not originate from getSceneFormForCreate()
      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 a Scene will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.
      Returns:
      false if Scene modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getSceneFormForUpdate

      Gets the scene form for updating an existing scene. A new scene form should be requested for each update transaction.
      Parameters:
      sceneId - the Id of the Scene
      Returns:
      the scene form
      Throws:
      NotFoundException - sceneId is not found
      NullArgumentException - sceneId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • updateScene

      void updateScene(SceneForm sceneForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing scene.
      Parameters:
      sceneForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - sceneForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - sceneForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - sceneForm did not originate from getSceneFormForUpdate()
      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 a Scene will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.
      Returns:
      false if Scene deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deleteScene

      Deletes a Scene .
      Parameters:
      sceneId - the Id of the Scene to remove
      Throws:
      NotFoundException - sceneId not found
      NullArgumentException - sceneId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManageSceneAliases

      boolean canManageSceneAliases()
      Tests if this user can manage Id aliases for Scenes . 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.
      Returns:
      false if Scene aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasScene

      Adds an Id to a Scene for the purpose of creating compatibility. The primary Id of the Scene is determined by the provider. The new Id performs as an alias to the primary Id . If the alias is a pointer to another scene, it is reassigned to the given scene Id .
      Parameters:
      sceneId - the Id of a Scene
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is already assigned
      NotFoundException - sceneId not found
      NullArgumentException - sceneId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.