Interface HierarchyAdminSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface HierarchyAdminSession extends OsidSession

This session creates, updates, and deletes Hierarchies . The data for create and update is provided by the consumer via the form. OsidForms are requested for each create or update and may not be reused.

Create and update operations differ in their usage. To create a Hierarchy , a HierarchyForm is requested using getHierarchyFormForCreate() specifying the desired record Types or none if no record Types are needed. The returned HierarchyForm 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 HierarchyForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each HierarchyForm corresponds to an attempted transaction.

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

The delete operations delete Hierarchies .

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

  • Method Details

    • canCreateHierarchies

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

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

      HierarchyForm getHierarchyFormForCreate(Type[] hierarchyRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the hierarchy form for creating new hierarchies. A new form should be requested for each create transaction. This method is used for creating new hierarchies, where only the Hierarchy Type is known.
      Parameters:
      hierarchyRecordTypes - array of hierarchy record types
      Returns:
      the hierarchy form
      Throws:
      NullArgumentException - hierarchyRecordTypes 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.
    • createHierarchy

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

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

      HierarchyForm getHierarchyFormForUpdate(Id hierarchyId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the hierarchy form for updating an existing hierarchy. A new hierarchy form should be requested for each update transaction.
      Parameters:
      hierarchyId - the Id of the Hierarchy
      Returns:
      the hierarchy form
      Throws:
      NotFoundException - hierarchyId is not found
      NullArgumentException - hierarchyId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • updateHierarchy

      void updateHierarchy(HierarchyForm hierarchyForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing hierarchy.
      Parameters:
      hierarchyForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - hierarchyForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - hierarchyId or hierarchyForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - hierarchyForm did not originate from getHierarchyFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteHierarchies

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

      void deleteHierarchy(Id hierarchyId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Deletes a Hierarchy .
      Parameters:
      hierarchyId - the Id of the Hierarchy to remove
      Throws:
      NotFoundException - hierarchyId not found
      NullArgumentException - hierarchyId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManageHierarchyAliases

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

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