|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnl.uva.vlet.Global
public class Global
Global system variables, runtime environment etc. Use getProperty() to check environment variables, System properties, and/or user configuration file(s) (all in one method).
Field Summary | |
---|---|
static java.lang.String |
ARCH_LINUX
|
static java.lang.String |
ARCH_WINDOWS
|
static java.lang.String |
FIREWALL_PORT_RANGE
|
static java.lang.String |
GLOBUS_TCP_PORT_RANGE
Globus enviroment string |
static java.lang.String |
GRID_CERTIFICATE_LOCATION
|
static java.lang.String |
GRID_PROXY_LOCATION
|
static java.lang.String |
JAVA_OS_ARCH
|
static java.lang.String |
JAVA_OS_NAME
|
static java.lang.String |
JAVA_OS_VERSION
|
static java.lang.String |
PASSIVE_MODE
|
static java.lang.String |
SKIP_FLOPPY_SCAN
|
static java.lang.String |
VADAPTORS_PROP
|
static java.lang.String |
VERSION
|
static java.lang.String |
X509_USER_PROXY
X509_USER_PROXY environment variable |
Constructor Summary | |
---|---|
Global()
|
Method Summary | |
---|---|
static void |
debugPrint(java.lang.Object o,
java.lang.String msg)
|
static void |
debugPrintException(java.lang.String className,
VlException e)
convenience method to check and print the VlException |
static void |
debugPrintln(java.lang.Object o,
java.lang.String msg)
|
static void |
debugPrintStacktrace(java.lang.Exception e)
|
static void |
errorPrint(java.lang.Object o,
java.lang.String string)
|
static void |
errorPrintln(java.lang.Object o,
java.lang.String string)
|
static void |
errorPrintStacktrace(java.lang.Throwable e)
|
static java.lang.String |
getArch()
|
static boolean |
getBoolProperty(java.lang.String name,
boolean defVal)
Returns boolean property or the default value |
static VRL |
getCodeBaseLocation()
Returns base location of installed code of Global class |
static VAttributeSet |
getConfigurationAttributes()
Return configurable properties as AttributeSet |
static java.io.PrintStream |
getDebugStream()
|
static java.io.PrintStream |
getErrorStream()
|
static int[] |
getFirewallPortRange()
|
static java.lang.String |
getFirewallPortRangeString()
|
static java.lang.String |
getGridCertificateLocation()
Return OPTIONAL grid certificate location can be null. |
static java.lang.String |
getGridProxyLocation()
Return OPTIONAL grid proxy location. |
static VRL |
getHelpUrl(java.lang.String string)
|
static java.lang.String |
getHostname()
|
static VRL |
getInstallationBinDir()
Returns vlet.install.bindir property or (default) VLET_INSTALL/bin |
static VRL |
getInstallationConfigDir()
Returns vlet.install.sysconfdir property or (default) VLET_INSTALL/etc |
static VRL |
getInstallationDocDir()
Returns vlet.install.libdir property or (default) VLET_INSTALL/lib |
static VRL |
getInstallationLibDir()
Returns vlet.install.libdir property or (default) VLET_INSTALL/lib |
static VRL |
getInstallBaseDir()
Returns base dir of installed software a.k.a VLET_INSTALL. |
static java.lang.String |
getOSName()
|
static java.lang.String |
getOSVersion()
|
static boolean |
getPassiveMode()
When true only passive connections are allowed. |
static java.lang.String |
getProperty(java.lang.String name)
Unified Global getProperty/getEnv method. |
static boolean |
getShowDebug()
|
static java.lang.String |
getSystemProperty(java.lang.String key)
Only query system properties, do NOT consult user properties or environment variables |
static VRL |
getUserConfigDir()
Get VFS compatible User Configuration VRL. |
static java.lang.String |
getUserHome()
Returns "user.home" system property ($HOME under unix). |
static VRL |
getUserHomeLocation()
Get VFS compatible User Home VRL. |
static java.lang.String |
getUsername()
Returns "user.name" system property. |
static java.lang.String |
getVersion()
|
static java.lang.String |
getX50UserProxyLocation()
|
static void |
init()
Even though this method does nothing, the class Global will be initialized ! This because this class is referenced (a method is called)! The real initialization is done in the class object. |
static boolean |
isLinux()
|
static boolean |
isWindows()
|
static void |
loadJarsFrom(VRL location)
Loads all jars found in the specified location. |
static java.util.Properties |
loadProperties(java.net.URL url)
|
static java.util.Properties |
loadProperties(VRL loc)
Load properties file from specified location. IMPORTANT: When this method is used and the URL stream factory handler HAS NOT BEEN SET, only default url schemes can be used ! (file:/,http://). |
static java.util.Properties |
loadPropertiesFromClasspath(java.lang.String urlstr)
Load a property file specified on the classpath |
static void |
messagePrint(java.lang.Object o,
java.lang.String string)
|
static void |
messagePrintln(java.lang.Object source,
int level,
java.lang.String message)
|
static void |
messagePrintln(java.lang.Object o,
java.lang.String string)
|
static java.lang.String[] |
parseArguments(java.lang.String[] args)
Parses property arguments in the style: -Dname=val. |
static void |
saveProperties(VRL loc,
java.util.Properties props)
Save properties file to specified location. |
static void |
setDebug(boolean b)
|
static boolean |
setFireWallPortRange(java.lang.String rangestr)
|
static void |
setPassiveMode(boolean val)
|
static void |
setSystemProperty(java.lang.String name,
java.lang.String value)
|
static void |
setUserProperty(java.lang.String name,
java.lang.String value)
Only user property can be set. |
static void |
setVerbose(int v)
|
static boolean |
toggleShowDebug()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String X509_USER_PROXY
public static final java.lang.String GLOBUS_TCP_PORT_RANGE
public static final java.lang.String FIREWALL_PORT_RANGE
public static final java.lang.String VERSION
public static final java.lang.String JAVA_OS_ARCH
public static final java.lang.String JAVA_OS_NAME
public static final java.lang.String JAVA_OS_VERSION
public static final java.lang.String ARCH_LINUX
public static final java.lang.String ARCH_WINDOWS
public static final java.lang.String SKIP_FLOPPY_SCAN
public static final java.lang.String PASSIVE_MODE
public static final java.lang.String GRID_PROXY_LOCATION
public static final java.lang.String GRID_CERTIFICATE_LOCATION
public static final java.lang.String VADAPTORS_PROP
Constructor Detail |
---|
public Global()
Method Detail |
---|
public static void setUserProperty(java.lang.String name, java.lang.String value)
public static final java.lang.String getUserHome()
See INSTALLDIR/etc/vletrc.prop, value "user.home".
public static final VRL getUserHomeLocation()
public static final VRL getUserConfigDir()
public static final java.lang.String getUsername()
public static final VRL getInstallBaseDir()
If VLET_INSTALL is set, it will return this value as VRL.
else the startup will be used and strip from "/lib/
public static VRL getInstallationConfigDir()
public static VRL getInstallationLibDir()
public static VRL getInstallationDocDir()
public static VRL getInstallationBinDir()
public static java.lang.String getSystemProperty(java.lang.String key)
public static void setDebug(boolean b)
public static boolean getShowDebug()
public static boolean toggleShowDebug()
public static void errorPrint(java.lang.Object o, java.lang.String string)
public static void errorPrintln(java.lang.Object o, java.lang.String string)
public static void messagePrint(java.lang.Object o, java.lang.String string)
public static void messagePrintln(java.lang.Object o, java.lang.String string)
public static void debugPrint(java.lang.Object o, java.lang.String msg)
public static void debugPrintln(java.lang.Object o, java.lang.String msg)
public static java.io.PrintStream getErrorStream()
public static java.io.PrintStream getDebugStream()
public static void debugPrintStacktrace(java.lang.Exception e)
public static void errorPrintStacktrace(java.lang.Throwable e)
public static java.lang.String getHostname()
public static java.lang.String[] parseArguments(java.lang.String[] args)
public static java.lang.String getProperty(java.lang.String name)
Check system property settings in the following order (high prio first):
I) Check system properties GlobalConfig.getSystemProperty (command line) for user specified (and optional overriden) properties. II) Check user stored properties (.vletrc/vletrc.prop) III) Check Installation stored properties ($INSTALL/etc/vletrc.prop) IV) Check Environment Variable GlobalConfig.getSystemEnv();
name
-
public static java.lang.String getX50UserProxyLocation()
public static void debugPrintException(java.lang.String className, VlException e)
public static java.lang.String getFirewallPortRangeString()
public static int[] getFirewallPortRange()
public static boolean setFireWallPortRange(java.lang.String rangestr)
public static java.util.Properties loadProperties(VRL loc) throws VlException
VlException
public static java.util.Properties loadProperties(java.net.URL url) throws VlException
VlException
public static java.util.Properties loadPropertiesFromClasspath(java.lang.String urlstr) throws VlException
urlstr
-
VlException
public static void saveProperties(VRL loc, java.util.Properties props) throws VlException
VlException
public static VRL getCodeBaseLocation()
public static VAttributeSet getConfigurationAttributes()
public static void init()
This allows for multiple calls to init() !
Call this method first to ensure proper initialization of the configured settings, etc.
public static java.lang.String getVersion()
public static void loadJarsFrom(VRL location)
public static boolean isLinux()
public static boolean isWindows()
public static java.lang.String getArch()
public static java.lang.String getOSName()
public static java.lang.String getOSVersion()
public static VRL getHelpUrl(java.lang.String string)
public static void setSystemProperty(java.lang.String name, java.lang.String value)
public static boolean getBoolProperty(java.lang.String name, boolean defVal)
public static java.lang.String getGridProxyLocation()
public static java.lang.String getGridCertificateLocation()
public static boolean getPassiveMode()
public static void setPassiveMode(boolean val)
public static void messagePrintln(java.lang.Object source, int level, java.lang.String message)
public static void setVerbose(int v)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |