Interface JournalAdminSession

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

public interface JournalAdminSession extends OsidSession

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

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

The delete operations delete Journals .

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

  • Method Details

    • canCreateJournals

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

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

      JournalForm getJournalFormForCreate(Type[] journalRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the journal form for creating new journals. A new form should be requested for each create transaction.
      Parameters:
      journalRecordTypes - array of journal record types
      Returns:
      the journal form
      Throws:
      NullArgumentException - journalRecordTypes 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.
    • createJournal

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

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

      JournalForm getJournalFormForUpdate(Id journalId)
      Gets the journal form for updating an existing journal. A new journal form should be requested for each update transaction.
      Parameters:
      journalId - the Id of the Journal
      Returns:
      the journal form
      Throws:
      NullArgumentException - journalId is null
      Compliance:
      mandatory - This method must be implemented.
    • updateJournal

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

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

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

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

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