com.atlassian.jira.bc
Class JiraServiceContextImpl

java.lang.Object
  extended by com.atlassian.jira.bc.JiraServiceContextImpl
All Implemented Interfaces:
JiraServiceContext

@PublicApi
public class JiraServiceContextImpl
extends Object
implements JiraServiceContext

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.


Constructor Summary
JiraServiceContextImpl(com.atlassian.crowd.embedded.api.User user)
          Instantiates this class with given user and new empty error collection.
JiraServiceContextImpl(com.atlassian.crowd.embedded.api.User user, ErrorCollection errorCollection)
          Instantiates this class with user and error collection.
JiraServiceContextImpl(com.atlassian.crowd.embedded.api.User user, ErrorCollection errorCollection, I18nHelper i18nHelper)
          Instantiates this class with user and error collection and I18nHelper.
 
Method Summary
 boolean equals(Object o)
           
 ErrorCollection getErrorCollection()
          Returns error collection, never null
 I18nHelper getI18nBean()
          Get an I18nHelper for localising text.
 com.atlassian.crowd.embedded.api.User getLoggedInUser()
          Returns the User who has invoked the JIRA service method.
 int hashCode()
           
 String toString()
          Prints username and error collection
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JiraServiceContextImpl

public JiraServiceContextImpl(com.atlassian.crowd.embedded.api.User user)
Instantiates this class with given user and new empty error collection. The I18nHelper will be created from the User supplied.

Parameters:
user - user

JiraServiceContextImpl

public JiraServiceContextImpl(com.atlassian.crowd.embedded.api.User 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

JiraServiceContextImpl

public JiraServiceContextImpl(com.atlassian.crowd.embedded.api.User 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
Method Detail

getErrorCollection

public ErrorCollection getErrorCollection()
Returns error collection, never null

Specified by:
getErrorCollection in interface JiraServiceContext
Returns:
error collection

getLoggedInUser

public com.atlassian.crowd.embedded.api.User getLoggedInUser()
Description copied from interface: JiraServiceContext
Returns the User who has invoked the JIRA service method.

Specified by:
getLoggedInUser in interface JiraServiceContext
Returns:
user who is performing the operation (can be null).

getI18nBean

public I18nHelper getI18nBean()
Description copied from interface: JiraServiceContext
Get an I18nHelper for localising text.

Specified by:
getI18nBean in interface JiraServiceContext
Returns:
an I18nHelper for localising text.

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Prints username and error collection

Overrides:
toString in class Object
Returns:
string representing username and error collection of this context


Copyright © 2002-2012 Atlassian. All Rights Reserved.