@PublicApi public class

JiraServiceContextImpl

extends Object
implements JiraServiceContext
java.lang.Object
   ↳ com.atlassian.jira.bc.JiraServiceContextImpl

@PublicApi

This class 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

Default implementation of the JiraServiceContext. For now, this guy has to be considered as API because devs must feed a JiraServiceContext instance to Service methods, and this is the only way to create one that will be compatible with mulitple versions of JIRA. If we don't like this, we need to provide a Factory or something.

Summary

Public Constructors
@Deprecated JiraServiceContextImpl(User user)
This constructor is deprecated. since 6.1 use JiraServiceContextImpl(com.atlassian.jira.user.ApplicationUser) instead
@Deprecated JiraServiceContextImpl(User user, ErrorCollection errorCollection)
@Deprecated JiraServiceContextImpl(User user, ErrorCollection errorCollection, I18nHelper i18nHelper)
JiraServiceContextImpl(ApplicationUser user)
Instantiates this class with given user and new empty error collection.
JiraServiceContextImpl(ApplicationUser user, ErrorCollection errorCollection)
Instantiates this class with user and error collection.
JiraServiceContextImpl(ApplicationUser user, ErrorCollection errorCollection, I18nHelper i18nHelper)
Instantiates this class with user and error collection and I18nHelper.
Public Methods
boolean equals(Object o)
ErrorCollection getErrorCollection()
Returns error collection, never null
I18nHelper getI18nBean()
Get an I18nHelper for localising text.
ApplicationUser getLoggedInApplicationUser()
Returns the User who has invoked the JIRA service method.
User getLoggedInUser()
Returns the User who has invoked the JIRA service method.
int hashCode()
String toString()
Prints username and error collection
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.bc.JiraServiceContext

Public Constructors

@Deprecated public JiraServiceContextImpl (User user)

This constructor is deprecated.
since 6.1 use JiraServiceContextImpl(com.atlassian.jira.user.ApplicationUser) instead

Instantiates this class with given user and new empty error collection. The I18nHelper will be created from the User supplied.

Parameters
user user

@Deprecated public JiraServiceContextImpl (User user, ErrorCollection errorCollection)

This constructor is deprecated.
since 6.1 use JiraServiceContextImpl(com.atlassian.jira.user.ApplicationUser, com.atlassian.jira.util.ErrorCollection) instead

Instantiates this class with user and error collection. The I18nHelper will be created from the User supplied.

Parameters
user user
errorCollection error collection; must not be null
Throws
IllegalArgumentException if error collection is null

@Deprecated public JiraServiceContextImpl (User user, ErrorCollection errorCollection, I18nHelper i18nHelper)

This constructor is deprecated.
since 6.1 use JiraServiceContextImpl(com.atlassian.jira.user.ApplicationUser, com.atlassian.jira.util.ErrorCollection, com.atlassian.jira.util.I18nHelper) instead

Instantiates this class with user and error collection and I18nHelper.

Parameters
user user
errorCollection error collection; must not be null
i18nHelper optional I18nHelper to use
Throws
IllegalArgumentException if error collection is null

public JiraServiceContextImpl (ApplicationUser user)

Instantiates this class with given user and new empty error collection. The I18nHelper will be created from the User supplied.

Parameters
user user

public JiraServiceContextImpl (ApplicationUser user, ErrorCollection errorCollection)

Instantiates this class with user and error collection. The I18nHelper will be created from the User supplied.

Parameters
user user
errorCollection error collection; must not be null
Throws
IllegalArgumentException if error collection is null

public JiraServiceContextImpl (ApplicationUser user, ErrorCollection errorCollection, I18nHelper i18nHelper)

Instantiates this class with user and error collection and I18nHelper.

Parameters
user user
errorCollection error collection; must not be null
i18nHelper optional I18nHelper to use
Throws
IllegalArgumentException if error collection is null

Public Methods

public boolean equals (Object o)

public ErrorCollection getErrorCollection ()

Returns error collection, never null

Returns
  • error collection

public I18nHelper getI18nBean ()

Get an I18nHelper for localising text.

Returns
  • an I18nHelper for localising text.

public ApplicationUser getLoggedInApplicationUser ()

Returns the User who has invoked the JIRA service method.

Returns
  • user who is performing the operation (can be null).

public User getLoggedInUser ()

Returns the User who has invoked the JIRA service method.

Returns
  • user who is performing the operation (can be null).

public int hashCode ()

public String toString ()

Prints username and error collection

Returns
  • string representing username and error collection of this context