Interface RealmAdminSession

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

public interface RealmAdminSession extends OsidSession

This session creates, updates, and deletes Realms . 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 Realm , a RealmForm is requested using getRealmFormForCreate() specifying the desired record Types or none if no record Types are needed. The returned RealmForm 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 RealmForm is submitted to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each RealmForm corresponds to an attempted transaction.

For updates, RealmForms are requested to the Realm Id that is to be updated using getRealmFormForUpdate() . Similarly, the RealmForm has metadata about the data that can be updated and it can perform validation before submitting the update. The RealmForm can only be used once for a successful update and cannot be reused.

The delete operations delete Realms . It is safer to remove all mappings to the Realm catalogs before deletion.

This session includes an Id aliasing mechanism to assign an external Id to an internally assigned Id.

  • Method Details

    • canCreateRealms

      boolean canCreateRealms()
      Tests if this user can create Realms . A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a Realm 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.
      Returns:
      false if Realm creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateRealmWithRecordTypes

      boolean canCreateRealmWithRecordTypes(Type[] realmRecordTypes)
      Tests if this user can create a single Realm using the desired record types. While PersonnelManager.getRealmRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific Realm . Providing an empty array tests if a Realm can be created with no records.
      Parameters:
      realmRecordTypes - array of types
      Returns:
      true if Realm creation using the specified record Types is supported, false otherwise
      Throws:
      NullArgumentException - realmRecordTypes is null
      Compliance:
      mandatory - This method must be implemented.
    • getRealmFormForCreate

      RealmForm getRealmFormForCreate(Type[] realmRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the realm form for creating new realms. A new form should be requested for each create transaction.
      Parameters:
      realmRecordTypes - array of types
      Returns:
      the realm form
      Throws:
      NullArgumentException - realmRecordTypes is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - cannot get form for requested record types
      Compliance:
      mandatory - This method must be implemented.
    • createRealm

      Creates a new Realm .
      Parameters:
      realmForm - the form for this Realm
      Returns:
      the new Realm
      Throws:
      IllegalStateException - realmForm already used in a create transaction
      InvalidArgumentException - one or more of the form elements is invalid
      NullArgumentException - realmForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - realmForm did not originate from getRealmFormForCreate()
      Compliance:
      mandatory - This method must be implemented.
    • canUpdateRealms

      boolean canUpdateRealms()
      Tests if this user can update Realms . A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a Realm 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.
      Returns:
      false if Realm modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getRealmFormForUpdate

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

      void updateRealm(RealmForm realmForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing realm.
      Parameters:
      realmForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - realmForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - realmForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - realmForm did not originate from getRealmtFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteRealms

      boolean canDeleteRealms()
      Tests if this user can delete Realms A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a Realm 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.
      Returns:
      false if Realm deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deleteRealm

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

      boolean canManageRealmAliases()
      Tests if this user can manage Id aliases for Realms . 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 Realm aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasRealm

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