Interface ForumAdminSession

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

public interface ForumAdminSession extends OsidSession

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

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

The delete operations delete Forums .

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

  • Method Details

    • canCreateForums

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

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

      ForumForm getForumFormForCreate(Type[] forumRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the forum form for creating new forums. A new form should be requested for each create transaction.
      Parameters:
      forumRecordTypes - array of forum record types
      Returns:
      the forum form
      Throws:
      NullArgumentException - forumRecordTypes 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.
    • createForum

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

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

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

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

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

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

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

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