public final class JiraUtils extends Object
JiraEntityUtils
,
JiraKeyUtils
,
JiraTypeUtils
,
UserUtil
Constructor and Description |
---|
JiraUtils() |
Modifier and Type | Method and Description |
---|---|
static int |
get24HourTime(String meridianIndicator,
int hours)
Calculate meridian adjustment add 12 hours if meridian is set to PM - note 12pm is 12:00 in 24 hour time.
|
static String |
getHostname()
Returns the server ip where the vm is running.
|
static boolean |
isPublicMode()
Returns true if JIRA is really running in public mode.
|
static boolean |
isSetup()
Deprecated.
The casing of this method is misleading; use
isSetUp() instead. Since v7.4. |
static boolean |
isSetUp()
Indicates whether JIRA has been set up.
|
static <T> T |
loadComponent(Class<T> componentClass)
Deprecated.
|
static <T> T |
loadComponent(Class<T> componentClass,
Collection<Object> dependencies)
Deprecated.
|
static <T> T |
loadComponent(String className,
Class<?> callingClass)
This method will load and construct a class, but also pass it through PicoContainer, to inject any dependencies.
|
static <T> T |
loadComponent(String className,
ClassLoader classLoader)
Deprecated.
This method does not work well with Plugins2 classes and dependency injection. Please use
ComponentClassManager . |
public static final String AM
public static final String PM
public static boolean isPublicMode()
That is, JIRA Mode is enabled AND there is at least one writable User Directory.
JRA-15966 Public mode should only be allowed if External User Management is disabled, otherwise we cannot create a new user in JIRA. Older versions of JIRA would allow the admin to set up an invalid combination of both External User Management and Public Mode enabled, and so we need to account for this possibility.
public static <T> T loadComponent(String className, Class<?> callingClass) throws ClassNotFoundException
className
- the name of the class to load.callingClass
- the class requesting the class be loaded.ClassNotFoundException
- if the class is not found on the classpath of the classloader of the calling class.ClassLoaderUtils.loadClass(java.lang.String, java.lang.Class)
,
ComponentManager
public static <T> T loadComponent(String className, ClassLoader classLoader) throws ClassNotFoundException
ComponentClassManager
.Please note that this method will only find Plugins2 classes in plugins that are enabled, and cannot inject plugins2 components.
className
- the name of the class to loadclassLoader
- the classloader to use to load the classClassNotFoundException
- if the given className was not able to be loaded.@Deprecated public static <T> T loadComponent(Class<T> componentClass)
ComponentManager.loadComponent(Class, Collection)
T
- the type of componentcomponentClass
- the class of component to create@Deprecated public static <T> T loadComponent(Class<T> componentClass, Collection<Object> dependencies)
ComponentManager.loadComponent(Class, Collection)
T
- the type of componentcomponentClass
- the class of component to createdependencies
- the classes and/or objects that are dependencies of the given classpublic static int get24HourTime(String meridianIndicator, int hours)
meridianIndicator
- am or pmhours
- 1-12public static boolean isSetUp()
@Deprecated public static boolean isSetup()
isSetUp()
instead. Since v7.4.public static String getHostname()
Copyright © 2002-2019 Atlassian. All Rights Reserved.