Interface FamilyAdminSession

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

public interface FamilyAdminSession extends OsidSession

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

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

The delete operations delete Families .

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

  • Method Details

    • canCreateFamilies

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

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

      FamilyForm getFamilyFormForCreate(Type[] familyRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the family form for creating new families. A new form should be requested for each create transaction.
      Parameters:
      familyRecordTypes - array of family record types
      Returns:
      the family form
      Throws:
      NullArgumentException - familyRecordTypes 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.
    • createFamily

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

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

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

      void updateFamily(FamilyForm familyForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing family.
      Parameters:
      familyForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - familyForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - familyId or familyForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - familyForm did not originate from getFamilyFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteFamilies

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

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

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

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