@PublicApi public interface

MessageHandlerContext

com.atlassian.jira.service.util.handler.MessageHandlerContext
Known Indirect Subclasses

@PublicApi

This interface is designed for plugins to consume (call its methods).

Clients of @PublicApi can expect that programs compiled against a given version will remain binary compatible with later versions of the @PublicApi as per each product's API policy as long as the client does not implement/extend @PublicApi interfaces or classes (refer to each product's API policy for the exact guarantee---usually binary compatibility is guaranteed at least across minor versions).

Note: since @PublicApi interfaces and classes are not designed to be implemented or extended by clients, we may perform certain types of binary-incompatible changes to these classes and interfaces, but these will not affect well-behaved clients that do not extend/implement these types (in general, only classes and interfaces annotated with @PublicSpi are safe to extend/implement).

Class Overview

Well-behaved MessageHandler implementations should use as much as possible this interface to create approprate entities. Depending on the mode the handler is run in the calls will be mutative for JIRA (in normal production run) or will create just dummy objects when run while testing message handler from administration screen.

Summary

Public Methods
ChangeItemBean createAttachment(File file, String filename, String contentType, User author, Issue issue)
Creates attachment (when run in real mode) or does nothing if run in dry run mode.
Comment createComment(Issue issue, User author, String body, boolean dispatchEvent)
Creates a new issue comment in JIRA or a dummy comment in dry run mode
Issue createIssue(User reporter, Issue issue)
Creates a new issue in JIRA or a dummy issue in dry run mode@return
User createUser(String username, String password, String email, String fullname, Integer userEventType)
Creates user in JIRA or just dummy user if run in dry run mode@return
MessageHandlerExecutionMonitor getMonitor()
boolean isRealRun()

Public Methods

public ChangeItemBean createAttachment (File file, String filename, String contentType, User author, Issue issue)

Creates attachment (when run in real mode) or does nothing if run in dry run mode.

Returns

public Comment createComment (Issue issue, User author, String body, boolean dispatchEvent)

Creates a new issue comment in JIRA or a dummy comment in dry run mode

public Issue createIssue (User reporter, Issue issue)

Creates a new issue in JIRA or a dummy issue in dry run mode@return

public User createUser (String username, String password, String email, String fullname, Integer userEventType)

Creates user in JIRA or just dummy user if run in dry run mode@return

Throws
PermissionException
CreateException
PermissionException

public MessageHandlerExecutionMonitor getMonitor ()

Returns
  • place where message handler should report its progress and problems with processing the message. Depending on the run mode it will be either logged in the log file (when real run) or showed to the user in UI (when run in test mode via configuring handler from UI)

public boolean isRealRun ()

Returns
  • true if the context works in production mode (when handlers are run from the service) or false if runs