|
Jive Forums API (5.5.20.2-oracle) Developer Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jivesoftware.base.JiveGlobals
public class JiveGlobals
This class controls access to a number of global propeties in the applcation.
Additionally, this class controls access to Jive properties. If the application is on, property manipulation must be done through this class and not the database or xml files directly. Properties come in 3 types:getLocalProperty(String)
getLocalProperty(String, int)
getLocalProperties(String)
setLocalProperty(String, String)
setLocalProperties(java.util.Map)
deleteLocalProperty(String)
getJiveProperty(String)
getJiveProperty(String, String)
getJivePropertyNames()
getJivePropertyNames(String)
getJiveProperties(String)
getJiveIntProperty(String, int)
getJiveBooleanProperty(String)
getJiveBooleanProperty(String, boolean)
setJiveProperty(String, String)
setJiveProperties(java.util.Map)
deleteJiveProperty(String)
getLocalizedJiveProperty(String, java.util.Locale)
getLocalizedPropertyLocales(String)
setLocalizedJiveProperty(String, String, java.util.Locale)
deleteLocalizedJiveProperty(String, java.util.Locale)
Nested Class Summary | |
---|---|
static interface |
JiveGlobals.JiveHomeProvider
A pluggable way to specify a value for jiveHome. |
Field Summary | |
---|---|
static boolean |
failedLoading
Indicates loading a reference to the jiveHome directory failed. |
static java.lang.String |
jiveHome
Location of the jiveHome directory. |
static JiveProperties |
setupProperties
Local Jive properties (from jive_startup.xml). |
Method Summary | |
---|---|
static void |
deleteJiveProperty(java.lang.String name)
Deletes a Jive property. |
static void |
deleteLocalizedJiveProperty(java.lang.String name,
java.util.Locale locale)
Deletes a localized Jive property. |
static void |
deleteLocalProperty(java.lang.String name)
Deletes a local property. |
static java.lang.String |
formatDate(java.util.Date date)
Formats a Date object and returns a formatted String. |
static java.lang.String |
formatDateTime(java.util.Date date)
Formats a Date object to return a date and time using the global locale. |
static boolean |
getBuildBooleanProperty(java.lang.String name,
boolean defaultValue)
Returns the specified build property as a boolean or returns defaultValue if the property doesn't exist or isn't parseable. |
static java.lang.String |
getBuildProperty(java.lang.String name)
Returns a build-level property. |
static java.lang.String |
getCharacterEncoding()
Returns the character set that Jive uses for encoding. |
static boolean |
getJiveBooleanProperty(java.lang.String name)
Returns the specified Jive property as a boolean or returns false if the property doesn't exist or isn't parseable. |
static boolean |
getJiveBooleanProperty(java.lang.String name,
boolean defaultValue)
Returns the specified Jive property as a boolean or returns defaultValue if the property doesn't exist or isn't parseable. |
static java.lang.String |
getJiveHome()
Returns the location of the jiveHome directory. |
static int |
getJiveIntProperty(java.lang.String name,
int defaultValue)
Returns the specified Jive property as an integer or returns the defaultValue if the property does't exist or the value isn't a number. |
static java.util.List |
getJiveProperties(java.lang.String parent)
Return all immediate children property values of a parent Jive property as a list of strings, or an empty list if there are no children. |
static java.lang.String |
getJiveProperty(java.lang.String name)
Returns the value of the specified property or null if the value doesn't exist. |
static java.lang.String |
getJiveProperty(java.lang.String name,
java.lang.String defaultValue)
Returns a Jive property. |
static java.util.List |
getJivePropertyNames()
Returns all Jive property names. |
static java.util.List |
getJivePropertyNames(java.lang.String parent)
Return all immediate children property names of a parent Jive property as a list of strings, or an empty list if there are no children. |
static java.util.Locale |
getLocale()
Returns the global Locale used by Jive. |
static java.lang.String |
getLocalizedJiveProperty(java.lang.String name,
java.util.Locale locale)
Returns a localized Jive property given its name and locale. |
static java.util.List |
getLocalizedJivePropertyNames()
Returns a list of the localized Jive properties |
static java.util.List |
getLocalizedPropertyLocales(java.lang.String name)
Returns a list of locales where this property is set. |
static java.util.List |
getLocalProperties(java.lang.String parent)
Return all immediate children property values of a parent local property as a list of strings, or an empty list if there are no children. |
static java.lang.String |
getLocalProperty(java.lang.String name)
Returns a local property. |
static int |
getLocalProperty(java.lang.String name,
int defaultValue)
Returns a local property as an integer. |
static java.util.Date |
getStartupDate()
Returns the date the Jive system was started. |
static java.util.TimeZone |
getTimeZone()
Returns the global TimeZone used by Jive. |
static boolean |
isSetup()
Returns true if the application has been set up, false otherwise. |
static boolean |
isWhiteLabel()
Returns true if the application is running in white label mode, false otherwise. |
static void |
setCharacterEncoding(java.lang.String characterEncoding)
Sets the character set that Jive uses for encoding. |
static void |
setConfigName(java.lang.String configName)
Allows the name of the local config file name to be changed. |
static void |
setJiveHome(java.lang.String jHome)
Sets the location of the jiveHome directory. |
static void |
setJiveProperties(java.util.Map propertyMap)
Sets multiple Jive properties at once. |
static void |
setJiveProperty(java.lang.String name,
java.lang.String value)
Sets a Jive property. |
static void |
setLocale(java.util.Locale newLocale)
Sets the global locale used by Jive. |
static void |
setLocalizedJiveProperty(java.lang.String name,
java.lang.String value,
java.util.Locale locale)
Sets a localized Jive property. |
static void |
setLocalProperties(java.util.Map propertyMap)
Sets multiple local properties at once. |
static void |
setLocalProperty(java.lang.String name,
java.lang.String value)
Sets a local property. |
static void |
setTimeZone(java.util.TimeZone newTimeZone)
Sets the global time zone used by Jive. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String jiveHome
public static boolean failedLoading
public static JiveProperties setupProperties
Method Detail |
---|
public static java.util.Date getStartupDate()
public static java.util.Locale getLocale()
Locale
used by Jive. A locale specifies language and country
codes, and is used for internationalization. The default locale is system dependant
and is determined by calling Locale.getDefault()
.
public static void setLocale(java.util.Locale newLocale)
Locale.getDefault()
.
newLocale
- the global locale for Jive.public static java.lang.String getCharacterEncoding()
SetCharacterEncodingFilter
is installed
in this application's web.xml file, which will set the incoming character encoding
to the one reported by this method.
public static void setCharacterEncoding(java.lang.String characterEncoding) throws java.io.UnsupportedEncodingException
getCharacterEncoding()
.
characterEncoding
- the global Jive character encoding.
java.io.UnsupportedEncodingException
- if the specified character encoding is invalid.public static java.util.TimeZone getTimeZone()
TimeZone
used by Jive. The default is the JDK's default time zone.
public static void setTimeZone(java.util.TimeZone newTimeZone)
newTimeZone
- the new global time zone used by this application.public static java.lang.String formatDate(java.util.Date date)
Date
object and returns a formatted String. This uses the date formatter
which in turn uses the default locale.
date
- the Date
to format.
public static java.lang.String formatDateTime(java.util.Date date)
Date
object to return a date and time using the global locale.
date
- the Date
to format.
public static java.lang.String getJiveHome()
public static void setJiveHome(java.lang.String jHome)
jiveHome
directory. This method is only intended to be
used during setup and should not set called in normal operations.
public static void setConfigName(java.lang.String configName)
configName
- the name of the config file.public static boolean isSetup()
public static java.lang.String getLocalProperty(java.lang.String name)
<foo> <bar> <prop>some value</prop> </bar> </foo>
name
- the name of the property to return.
public static int getLocalProperty(java.lang.String name, int defaultValue)
name
- the name of the property to return.defaultValue
- the value returned if the property could not be loaded or was not a
number.
public static java.util.List getLocalProperties(java.lang.String parent)
parent
- the name of the parent property to return the children for.
public static void setLocalProperty(java.lang.String name, java.lang.String value)
name
- the name of the property being set.value
- the value of the property being set.public static void setLocalProperties(java.util.Map propertyMap)
propertyMap
- a map of properties, keyed on property name.public static void deleteLocalProperty(java.lang.String name)
name
- the name of the property to delete.public static java.lang.String getJiveProperty(java.lang.String name)
name
- the name of the property to return.
public static java.lang.String getJiveProperty(java.lang.String name, java.lang.String defaultValue)
name
- the name of the property.defaultValue
- value returned if the property doesn't exist.
public static java.util.List getJivePropertyNames()
public static java.util.List getJivePropertyNames(java.lang.String parent)
public static java.util.List getJiveProperties(java.lang.String parent)
parent
- the name of the parent property to return the children for.
public static int getJiveIntProperty(java.lang.String name, int defaultValue)
name
- the name of the property.defaultValue
- value returned if the property doesn't exist or was not a number.
public static boolean getJiveBooleanProperty(java.lang.String name)
name
- the name of the property to return.
public static boolean getJiveBooleanProperty(java.lang.String name, boolean defaultValue)
name
- the name of the property.defaultValue
- value returned if the property doesn't exist.
public static void setJiveProperty(java.lang.String name, java.lang.String value)
name
- the name of the property being set.value
- the value of the property being set.public static void setJiveProperties(java.util.Map propertyMap)
propertyMap
- a map of properties, keyed on property name.public static void deleteJiveProperty(java.lang.String name)
name
- the name of the property to delete.public static java.util.List getLocalizedJivePropertyNames()
public static java.lang.String getLocalizedJiveProperty(java.lang.String name, java.util.Locale locale)
name
- the name of the propertylocale
- the locale this property applies to
public static java.util.List getLocalizedPropertyLocales(java.lang.String name)
locales
where this property is set. If the property doesn't
exist or is not set then an empty list is returned.
name
- the name of the property to check.
Locale
objects where this property is set or an empty list
if the property doesn't exist.public static void setLocalizedJiveProperty(java.lang.String name, java.lang.String value, java.util.Locale locale)
name
- the name of the property being set.value
- the value of the property being set.locale
- the locale of the propertypublic static void deleteLocalizedJiveProperty(java.lang.String name, java.util.Locale locale)
name
- the name of the property to delete.locale
- the locale of the propertypublic static boolean isWhiteLabel()
public static java.lang.String getBuildProperty(java.lang.String name)
name
- the name of the proeprty
public static boolean getBuildBooleanProperty(java.lang.String name, boolean defaultValue)
name
- the name of the property.defaultValue
- value returned if the property doesn't exist.
|
Jive Forums Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |