Interface ReplyAdminSession

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

public interface ReplyAdminSession extends OsidSession

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

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

The delete operations delete Replies . To unmap a Reply from the current Forum , the ReplyForumAssignmentSession should be used. These delete operations attempt to remove the Reply itself thus removing it from all known Forum catalogs.

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

  • Method Details

    • getForumId

      Id getForumId()
      Gets the Forum Id associated with this session.
      Returns:
      the Forum Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getForum

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

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

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

      ReplyForm getReplyFormForCreateToPost(Id postId, Type[] replyRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the reply form for creating new replies to a post. A new form should be requested for each create transaction.
      Parameters:
      postId - the Id for the post
      replyRecordTypes - array of reply record types
      Returns:
      the reply form
      Throws:
      NotFoundException - postId is not found
      NullArgumentException - postId or replyRecordTypes 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.
    • getReplyFormForCreateToReply

      ReplyForm getReplyFormForCreateToReply(Id replyId, Type[] replyRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the reply form for creating new replies to another reply. A new form should be requested for each create transaction.
      Parameters:
      replyId - the Id for the reply
      replyRecordTypes - array of reply record types
      Returns:
      the reply form
      Throws:
      NotFoundException - replyId is not found
      NullArgumentException - replyId or replyRecordTypes 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.
    • createReply

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

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

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

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

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

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

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

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