|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
org.globus.common
Class CoGProperties
java.lang.Object | +--java.util.Dictionary | +--java.util.Hashtable | +--java.util.Properties | +--org.globus.common.CoGProperties
- All Implemented Interfaces:
- Cloneable, Map, Serializable
- public class CoGProperties
- extends Properties
Responsible for managing the properties file "~/.globus/cog.properties", which holds information about various properties needed by the security classes. These properties include:
- the location of the user certificate file
- the location of the user key file
- the location of the CA certificates
- the location of the proxy file
- the tcp port range
- the local ip address for DHCP systems
- See Also:
- Serialized Form
| Inner classes inherited from class java.util.Map |
Map.Entry |
| Field Summary | |
static String |
BASEDN
|
static String |
CONFIG_FILE
the configuration file properties are read from -- located in ~/.globus" |
static String |
configFile
the config file location |
static String |
MDSHOST
|
static String |
MDSPORT
|
| Fields inherited from class java.util.Properties |
defaults |
| Constructor Summary | |
CoGProperties()
|
|
CoGProperties(String file)
|
|
| Method Summary | |
static void |
fixSpace(Properties p)
|
protected boolean |
getAsBoolean(String key,
boolean defaultValue)
|
protected int |
getAsInt(String label,
int defValue)
|
String |
getCaCertFile()
Deprecated. Use getCaCertLocations() instead. |
String |
getCaCertLocations()
Retrieves the location of the CA cert files. |
String |
getCaCerts()
Deprecated. Use getCaCertLocations() instead. |
static CoGProperties |
getDefault()
|
String |
getDefaultPKCS11Handle()
|
String |
getIPAddress()
Returns the user specified ip address. |
String |
getOrgMDSBaseDN()
|
String |
getOrgMDSHost()
|
String |
getOrgMDSPort()
|
String |
getPKCS11LibraryName()
|
String |
getProxyFile()
Retrieves the location of the proxy file. |
int |
getProxyLifeTime()
|
int |
getProxyStrength()
|
String |
getRootMDSBaseDN()
|
String |
getRootMDSHost()
|
String |
getRootMDSPort()
|
String |
getSecureRandomAlgorithm()
|
String |
getSecureRandomProvider()
|
String |
getTcpPortRange()
Returns the tcp port range. |
String |
getUserCertFile()
Retrieves the location of the user cert file. |
String |
getUserKeyFile()
Retrieves the location of the user key file. |
protected static boolean |
isNullOrEmpty(String tmp)
|
void |
load(InputStream in)
|
void |
load(String file)
|
void |
save()
|
void |
save(String file)
|
void |
setCaCertLocations(String list)
|
static void |
setDefault(CoGProperties properties)
Sets default configuration. |
void |
setIPAddress(String ipAddress)
Sets ip address |
void |
setProxyFile(String proxyFile)
|
void |
setProxyLifeTime(int lifeTimeInHours)
|
void |
setProxyStrength(int strength)
|
void |
setUserCertFile(String userCertFile)
|
void |
setUserKeyFile(String userKeyFile)
Sets user key file location |
boolean |
useDevRandom()
Returns whether to use the /dev/urandom device for seed generation. |
| Methods inherited from class java.util.Properties |
getProperty, getProperty, list, list, propertyNames, save, setProperty, store |
| Methods inherited from class java.util.Hashtable |
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
MDSHOST
public static final String MDSHOST
MDSPORT
public static final String MDSPORT
BASEDN
public static final String BASEDN
CONFIG_FILE
public static final String CONFIG_FILE
- the configuration file properties are read from -- located in ~/.globus"
configFile
public static String configFile
- the config file location
| Constructor Detail |
CoGProperties
public CoGProperties()
CoGProperties
public CoGProperties(String file) throws IOException
| Method Detail |
getDefault
public static CoGProperties getDefault()
setDefault
public static void setDefault(CoGProperties properties)
- Sets default configuration. It can be used to set a different configuration dynamically.
save
public void save()
throws IOException
save
public void save(String file) throws IOException
load
public void load(String file) throws IOException
load
public void load(InputStream in) throws IOException
- Overrides:
loadin classProperties
fixSpace
public static void fixSpace(Properties p)
getUserCertFile
public String getUserCertFile()
- Retrieves the location of the user cert file.
It first checks the X509_USER_CERT system property. If the property
is not set, it checks next the 'usercert' property in the current
configuration. If that property is not set, it returns a default
location of the user cert file. The default value
is the 'usercert.pem' file in the user's globus directory. For example:
${user.home}/.globus/usercert.pem.
- Returns:
Stringthe location of the user cert file
setUserCertFile
public void setUserCertFile(String userCertFile)
getPKCS11LibraryName
public String getPKCS11LibraryName()
getDefaultPKCS11Handle
public String getDefaultPKCS11Handle()
getUserKeyFile
public String getUserKeyFile()
- Retrieves the location of the user key file.
It first checks the X509_USER_KEY system property. If the property
is not set, it checks next the 'userkey' property in the current
configuration. If that property is not set, it returns a default
location of the user key file. The default value
is the 'userkey.pem' file in the user's globus directory. For example:
${user.home}/.globus/userkey.pem.
- Returns:
Stringthe location of the user key file
setUserKeyFile
public void setUserKeyFile(String userKeyFile)
- Sets user key file location
- Parameters:
userKeyFile- user key file location
getIPAddress
public String getIPAddress()
- Returns the user specified ip address. This is used
for DHCP machines where java is unable to determine the
right IP address.
It first checks the GLOBUS_HOSTNAME system property. If the property
is not set, it checks the "org.globus.ip" system property next.
If that property is not set, it checks next the "ip" property
in the current configuration. If the "ip" property is not
set in the current configuration, null is returned
(and default ip address will be used)
- Returns:
Stringthe ip address of the machine.
setIPAddress
public void setIPAddress(String ipAddress)
- Sets ip address
- Parameters:
ipAddress- ip address
getCaCertFile
public String getCaCertFile()
- Deprecated. Use getCaCertLocations() instead.
- Returns:
Stringthe locations of the CA certificates- See Also:
getCaCertLocations
getCaCerts
public String getCaCerts()
- Deprecated. Use getCaCertLocations() instead.
- Returns:
Stringthe locations of the CA certificates- See Also:
getCaCertLocations
getCaCertLocations
public String getCaCertLocations()
- Retrieves the location of the CA cert files.
It first checks the X509_CERT_DIR system property. If the property
is not set, it checks next the 'cacert' property in the current
configuration. If that property is not set, it tries to find
the certificates using the following rules:
First the ${user.home}/certificates directory is checked. If the directory does not exist, and on a Unix machine, the /etc/grid-security/certificates directory is checked next. Otherwise, null is returned. This indicates the certificates directory could not be found.
Moreover, this function can return multiple file and directory locations. The locations must be comma separated.- Returns:
Stringthe locations of the CA certificates
setCaCertLocations
public void setCaCertLocations(String list)
getProxyFile
public String getProxyFile()
- Retrieves the location of the proxy file.
It first checks the X509_USER_PROXY system property. If the property
is not set, it checks next the 'proxy' property in the current
configuration. If that property is not set, then it defaults to a
value based on the following rules:
If a UID system property is set, and running on a Unix machine it returns /tmp/x509up_u${UID}. If any other machine then Unix, it returns ${tempdir}/x509up_u${UID}, where tempdir is a platform-specific temporary directory as indicated by the java.io.tmpdir system property. If a UID system property is not set, the username will be used instead of the UID. That is, it returns ${tempdir}/x509up_u_${username}
This is done this way because Java is not able to obtain the current uid.- Returns:
Stringthe location of the proxy file
setProxyFile
public void setProxyFile(String proxyFile)
getTcpPortRange
public String getTcpPortRange()
- Returns the tcp port range.
It first checks the 'org.globus.tcp.port.range' system property. If the
system property is not set then it returns the value specified in the
configuration file. Returns null if the port range is not defined.
The port range is in the following form:, - Returns:
Stringthe port range.
useDevRandom
public boolean useDevRandom()
- Returns whether to use the /dev/urandom device
for seed generation.
- Returns:
- true if the device should be used (if available of course) Returns true by default unless specified otherwise by the user.
getSecureRandomProvider
public String getSecureRandomProvider()
getSecureRandomAlgorithm
public String getSecureRandomAlgorithm()
getProxyStrength
public int getProxyStrength()
setProxyStrength
public void setProxyStrength(int strength)
getProxyLifeTime
public int getProxyLifeTime()
setProxyLifeTime
public void setProxyLifeTime(int lifeTimeInHours)
getRootMDSHost
public String getRootMDSHost()
getRootMDSPort
public String getRootMDSPort()
getRootMDSBaseDN
public String getRootMDSBaseDN()
getOrgMDSHost
public String getOrgMDSHost()
getOrgMDSPort
public String getOrgMDSPort()
getOrgMDSBaseDN
public String getOrgMDSBaseDN()
getAsBoolean
protected boolean getAsBoolean(String key, boolean defaultValue)
getAsInt
protected int getAsInt(String label, int defValue)
isNullOrEmpty
protected static final boolean isNullOrEmpty(String tmp)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||