Interface PostEntryAdminSession

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

public interface PostEntryAdminSession extends OsidSession

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

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

The delete operations delete PostEntryForms . To unmap a PostEntry from the current Business , the PostEntryBusinessAssignmentSession should be used. These delete operations attempt to remove the PostEntryForm itself thus removing it from all known Business catalogs.

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

  • Method Details

    • getBusinessId

      Id getBusinessId()
      Gets the Business Id associated with this session.
      Returns:
      the Business Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getBusiness

      Gets the Business associated with this session.
      Returns:
      the business
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canCreatePostEntries

      boolean canCreatePostEntries()
      Tests if this user can create PostEntries . A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a PostEntry will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.
      Returns:
      false if PostEntry creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreatePostEntryWithRecordTypes

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

      PostEntryForm getPostEntryFormForCreate(Id postId, Type[] postEntryRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the post entry form for creating new post entries. A new form should be requested for each create transaction.
      Parameters:
      postId - a post Id
      postEntryRecordTypes - array of post entry record types
      Returns:
      the post entry form
      Throws:
      NotFoundException - postId is not found
      NullArgumentException - postId or postEntryRecordTypes 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.
    • createPostEntry

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

      boolean canUpdatePostEntries()
      Tests if this user can update PostEntries . A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a PostEntry will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.
      Returns:
      false if PostEntry modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getPostEntryFormForUpdate

      PostEntryForm getPostEntryFormForUpdate(Id postEntryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the post entry form for updating an existing post entries. A new post entry form should be requested for each update transaction.
      Parameters:
      postEntryId - the Id of the PostEntry
      Returns:
      the post entry form
      Throws:
      NotFoundException - postEntryId is not found
      NullArgumentException - postEntryId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • updatePostEntry

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

      boolean canDeletePostEntries()
      Tests if this user can delete PostEntries . A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a PostEntry will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.
      Returns:
      false if PostEntry deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deletePostEntry

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

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

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