Java Doc for JiveGlobals.java in  » Net » openfire » org » jivesoftware » util » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Net » openfire » org.jivesoftware.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.jivesoftware.util.JiveGlobals

JiveGlobals
public class JiveGlobals (Code)
Controls Jive properties. Jive properties are only meant to be set and retrieved by core Jive classes. Some properties may be stored in XML format while others in the database.

When starting up the application this class needs to be configured so that the initial configuration of the application may be loaded from the configuration file. The configuration file holds properties stored in XML format, database configuration and user authentication configuration. Use JiveGlobals.setHomeDirectory(String) and JiveGlobals.setConfigName(String) for setting the home directory and path to the configuration file.

XML property names must be in the form prop.name - parts of the name must be seperated by ".". The value can be any valid String, including strings with line breaks.



Field Summary
public static  booleanfailedLoading
    


Method Summary
public static  voiddeleteProperty(String name)
     Deletes a Jive property.
public static  voiddeleteXMLProperty(String name)
     Deletes a locale property.
public static  StringformatDate(Date date)
     Formats a Date object to return a date using the global locale.
Parameters:
  date - the Date to format.
public static  StringformatDateTime(Date date)
     Formats a Date object to return a date and time using the global locale.
Parameters:
  date - the Date to format.
public static  StringformatTime(Date date)
     Formats a Date object to return a time using the global locale.
Parameters:
  date - the Date to format.
public static  booleangetBooleanProperty(String name)
     Returns a boolean value Jive property.
Parameters:
  name - the name of the property to return.
public static  booleangetBooleanProperty(String name, boolean defaultValue)
     Returns a boolean value Jive property.
static  StringgetConfigName()
     Returns the name of the local config file name.
public static  StringgetHomeDirectory()
     Returns the location of the home directory.
public static  intgetIntProperty(String name, int defaultValue)
     Returns an integer value Jive property.
public static  LocalegetLocale()
     Returns the global Locale used by Jive.
public static  longgetLongProperty(String name, long defaultValue)
     Returns a long value Jive property.
public static  List<String>getProperties(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.
public static  StringgetProperty(String name)
     Returns a Jive property.
Parameters:
  name - the name of the property to return.
public static  StringgetProperty(String name, String defaultValue)
     Returns a Jive property.
public static  List<String>getPropertyNames(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.
public static  List<String>getPropertyNames()
     Returns all Jive property names.
public static  TimeZonegetTimeZone()
     Returns the global TimeZone used by Jive.
public static  ListgetXMLProperties(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.
public static  StringgetXMLProperty(String name)
     Returns a local property.
public static  StringgetXMLProperty(String name, String defaultValue)
     Returns a local property.
public static  intgetXMLProperty(String name, int defaultValue)
     Returns an integer value local property.
public static  booleangetXMLProperty(String name, boolean defaultValue)
     Returns a boolean value local property.
public static  voidsetConfigName(String configName)
     Allows the name of the local config file name to be changed.
public static  voidsetHomeDirectory(String pathname)
     Sets the location of the home directory.
public static  voidsetLocale(Locale newLocale)
     Sets the global locale used by Jive.
public static  voidsetProperties(Map<String, String> propertyMap)
     Sets multiple Jive properties at once.
public static  voidsetProperty(String name, String value)
     Sets a Jive property.
public static  voidsetTimeZone(TimeZone newTimeZone)
     Sets the global time zone used by Jive.
public static  voidsetXMLProperties(Map<String, String> propertyMap)
     Sets multiple local properties at once.
public static  voidsetXMLProperty(String name, String value)
     Sets a local property.

Field Detail
failedLoading
public static boolean failedLoading(Code)





Method Detail
deleteProperty
public static void deleteProperty(String name)(Code)
Deletes a Jive property. If the property doesn't exist, the method does nothing. All children of the property will be deleted as well.
Parameters:
  name - the name of the property to delete.



deleteXMLProperty
public static void deleteXMLProperty(String name)(Code)
Deletes a locale property. If the property doesn't exist, the method does nothing.
Parameters:
  name - the name of the property to delete.



formatDate
public static String formatDate(Date date)(Code)
Formats a Date object to return a date using the global locale.
Parameters:
  date - the Date to format. a String representing the date.



formatDateTime
public static String formatDateTime(Date date)(Code)
Formats a Date object to return a date and time using the global locale.
Parameters:
  date - the Date to format. a String representing the date and time.



formatTime
public static String formatTime(Date date)(Code)
Formats a Date object to return a time using the global locale.
Parameters:
  date - the Date to format. a String representing the time.



getBooleanProperty
public static boolean getBooleanProperty(String name)(Code)
Returns a boolean value Jive property.
Parameters:
  name - the name of the property to return. true if the property value exists and is set to "true" (ignoring case).Otherwise false is returned.



getBooleanProperty
public static boolean getBooleanProperty(String name, boolean defaultValue)(Code)
Returns a boolean value Jive property. If the property doesn't exist, the defaultValue will be returned. If the specified property can't be found, or if the value is not a number, the defaultValue will be returned.
Parameters:
  name - the name of the property to return.
Parameters:
  defaultValue - value returned if the property doesn't exist. true if the property value exists and is set to "true" (ignoring case).Otherwise false is returned.



getConfigName
static String getConfigName()(Code)
Returns the name of the local config file name. the name of the config file.



getHomeDirectory
public static String getHomeDirectory()(Code)
Returns the location of the home directory. the location of the home dir.



getIntProperty
public static int getIntProperty(String name, int defaultValue)(Code)
Returns an integer value Jive property. If the specified property doesn't exist, the defaultValue will be returned.
Parameters:
  name - the name of the property to return.
Parameters:
  defaultValue - value returned if the property doesn't exist or was nota number. the property value specified by name or defaultValue.



getLocale
public static Locale getLocale()(Code)
Returns the global Locale used by Jive. A locale specifies language and country codes, and is used for internationalization. The default locale is system dependant - Locale.getDefault(). the global locale used by Jive.



getLongProperty
public static long getLongProperty(String name, long defaultValue)(Code)
Returns a long value Jive property. If the specified property doesn't exist, the defaultValue will be returned.
Parameters:
  name - the name of the property to return.
Parameters:
  defaultValue - value returned if the property doesn't exist or was nota number. the property value specified by name or defaultValue.



getProperties
public static List<String> getProperties(String parent)(Code)
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. For example, given the properties X.Y.A, X.Y.B, X.Y.C and X.Y.C.D, then the immediate child properties of X.Y are X.Y.A, X.Y.B, and X.Y.C (the value of X.Y.C.D would not be returned using this method).


Parameters:
  parent - the name of the parent property to return the children for. all child property values for the given parent.




getProperty
public static String getProperty(String name)(Code)
Returns a Jive property.
Parameters:
  name - the name of the property to return. the property value specified by name.



getProperty
public static String getProperty(String name, String defaultValue)(Code)
Returns a Jive property. If the specified property doesn't exist, the defaultValue will be returned.
Parameters:
  name - the name of the property to return.
Parameters:
  defaultValue - value returned if the property doesn't exist. the property value specified by name.



getPropertyNames
public static List<String> getPropertyNames(String parent)(Code)
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. For example, given the properties X.Y.A, X.Y.B, X.Y.C and X.Y.C.D, then the immediate child properties of X.Y are A, B, and C (C.D would not be returned using this method).

a List of all immediate children property names (Strings).




getPropertyNames
public static List<String> getPropertyNames()(Code)
Returns all Jive property names. a List of all property names (Strings).



getTimeZone
public static TimeZone getTimeZone()(Code)
Returns the global TimeZone used by Jive. The default is the VM's default time zone. the global time zone used by Jive.



getXMLProperties
public static List getXMLProperties(String parent)(Code)
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. For example, given the properties X.Y.A, X.Y.B, X.Y.C and X.Y.C.D, then the immediate child properties of X.Y are A, B, and C (the value of C.D would not be returned using this method).

Local properties are stored in the file defined in JIVE_CONFIG_FILENAME that exists in the home directory. Properties are always specified as "foo.bar.prop", which would map to the following entry in the XML file:

 <foo>
 <bar>
 <prop>some value</prop>
 </bar>
 </foo>
 

Parameters:
  parent - the name of the parent property to return the children for. all child property values for the given parent.



getXMLProperty
public static String getXMLProperty(String name)(Code)
Returns a local property. Local properties are stored in the file defined in JIVE_CONFIG_FILENAME that exists in the home directory. Properties are always specified as "foo.bar.prop", which would map to the following entry in the XML file:
 <foo>
 <bar>
 <prop>some value</prop>
 </bar>
 </foo>
 

Parameters:
  name - the name of the property to return. the property value specified by name.



getXMLProperty
public static String getXMLProperty(String name, String defaultValue)(Code)
Returns a local property. Local properties are stored in the file defined in JIVE_CONFIG_FILENAME that exists in the home directory. Properties are always specified as "foo.bar.prop", which would map to the following entry in the XML file:
 <foo>
 <bar>
 <prop>some value</prop>
 </bar>
 </foo>
 
If the specified property can't be found, the defaultValue will be returned.
Parameters:
  name - the name of the property to return.
Parameters:
  defaultValue - the default value for the property. the property value specified by name.



getXMLProperty
public static int getXMLProperty(String name, int defaultValue)(Code)
Returns an integer value local property. Local properties are stored in the file defined in JIVE_CONFIG_FILENAME that exists in the home directory. Properties are always specified as "foo.bar.prop", which would map to the following entry in the XML file:
 <foo>
 <bar>
 <prop>some value</prop>
 </bar>
 </foo>
 
If the specified property can't be found, or if the value is not a number, the defaultValue will be returned.
Parameters:
  name - the name of the property to return.
Parameters:
  defaultValue - value returned if the property could not be loaded or was nota number. the property value specified by name or defaultValue.



getXMLProperty
public static boolean getXMLProperty(String name, boolean defaultValue)(Code)
Returns a boolean value local property. Local properties are stored in the file defined in JIVE_CONFIG_FILENAME that exists in the home directory. Properties are always specified as "foo.bar.prop", which would map to the following entry in the XML file:
 <foo>
 <bar>
 <prop>some value</prop>
 </bar>
 </foo>
 
If the specified property can't be found, the defaultValue will be returned. If the property is found, it will be parsed using Boolean.valueOf(String) .
Parameters:
  name - the name of the property to return.
Parameters:
  defaultValue - value returned if the property could not be loaded or was nota number. the property value specified by name or defaultValue.



setConfigName
public static void setConfigName(String configName)(Code)
Allows the name of the local config file name to be changed. The default is "openfire.xml".
Parameters:
  configName - the name of the config file.



setHomeDirectory
public static void setHomeDirectory(String pathname)(Code)
Sets the location of the home directory. The directory must exist and the user running the application must have read and write permissions over the specified directory.
Parameters:
  pathname - the location of the home dir.



setLocale
public static void setLocale(Locale newLocale)(Code)
Sets the global locale used by Jive. A locale specifies language and country codes, and is used for formatting dates and numbers. The default locale is Locale.US.
Parameters:
  newLocale - the global Locale for Jive.



setProperties
public static void setProperties(Map<String, String> propertyMap)(Code)
Sets multiple Jive properties at once. If a property doesn't already exists, a new one will be created.
Parameters:
  propertyMap - a map of properties, keyed on property name.



setProperty
public static void setProperty(String name, String value)(Code)
Sets a Jive property. If the property doesn't already exists, a new one will be created.
Parameters:
  name - the name of the property being set.
Parameters:
  value - the value of the property being set.



setTimeZone
public static void setTimeZone(TimeZone newTimeZone)(Code)
Sets the global time zone used by Jive. The default time zone is the VM's time zone.



setXMLProperties
public static void setXMLProperties(Map<String, String> propertyMap)(Code)
Sets multiple local properties at once. If a property doesn't already exists, a new one will be created. Local properties are stored in the file defined in JIVE_CONFIG_FILENAME that exists in the home directory. Properties are always specified as "foo.bar.prop", which would map to the following entry in the XML file:
 <foo>
 <bar>
 <prop>some value</prop>
 </bar>
 </foo>
 

Parameters:
  propertyMap - a map of properties, keyed on property name.



setXMLProperty
public static void setXMLProperty(String name, String value)(Code)
Sets a local property. If the property doesn't already exists, a new one will be created. Local properties are stored in the file defined in JIVE_CONFIG_FILENAME that exists in the home directory. Properties are always specified as "foo.bar.prop", which would map to the following entry in the XML file:
 <foo>
 <bar>
 <prop>some value</prop>
 </bar>
 </foo>
 

Parameters:
  name - the name of the property being set.
Parameters:
  value - the value of the property being set.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.