Interface FoundryAdminSession

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

public interface FoundryAdminSession extends OsidSession

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

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

The delete operations delete Foundries , It is safer to remove all mappings to the Foundry catalogs before deletion.

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

  • Method Details

    • canCreateFoundries

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

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

      FoundryForm getFoundryFormForCreate(Type[] foundryRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the foundry form for creating new foundries. A new form should be requested for each create transaction.
      Parameters:
      foundryRecordTypes - array of foundry record types
      Returns:
      the foundry form
      Throws:
      NullArgumentException - foundryRecordTypes 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.
    • createFoundry

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

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

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

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

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

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

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

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