public class SessionProperties
extends java.util.Properties
implements java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
static int |
DOM_PARSER
Parsing mode 'DOM parser'.
|
static java.lang.String |
PEGASUS_LOCAL_AUTHENTICATION
OpenPegasus local authentication
|
static int |
PULL_PARSER
Parsing mode 'pull parser'.
|
static int |
SAX_PARSER
Parsing moder 'SAX parser'.
|
static java.lang.String |
WWW_AUTHENTICATION
Standard HTTP basic or digest authentication
|
Constructor and Description |
---|
SessionProperties()
Constructs a new SessionProperties instance with library defaults
applied.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone() |
boolean |
getBooleanProperty(java.lang.String key,
boolean defaultValue)
Gets the boolean representation of property.
|
int |
getConnectionPoolSize()
Gets the connection pool size.
|
int |
getContentLength()
Returns an integer that contains the content length that is being used
for the retry mechanism.
|
java.io.OutputStream |
getDebugOutputStream()
Gets the output stream used to dump some debugging information.
|
java.lang.String |
getDefaultCredentials()
Get the current credentials used if the usage of default credentials is
enabled.
|
java.lang.String |
getDefaultPrincipal()
Get the current principal used if the usage of default credentials is
enabled.
|
static SessionProperties |
getEnvironmentDefaults()
Returns the environment defaults.
|
static SessionProperties |
getGlobalProperties()
Returns the SessionProperties singleton instance representing the global
properties.
|
java.lang.String |
getHttpAuthenticationModule()
Gets the HTTP authentication module
|
int |
getHttpTimeOut()
Gets the HTTP connection request time out (in milliseconds).
|
int |
getIntProperty(java.lang.String key,
int defaultValue)
Gets the integer represetation of property.
|
java.lang.String |
getJSSECertificate()
Gets the Certificate Managers name.
|
java.lang.String |
getJSSEProtocol() |
java.lang.String |
getJSSEProtocolHandler() |
java.lang.String |
getJSSEProvider()
Gets the complete class name for the JSSE provider.
|
java.lang.String |
getKeystore()
Gets the path of current keystore.
|
char[] |
getKeystorePassword()
Gets the keystore password.
|
java.lang.String |
getKeystoreType()
Gets the type of keystore.
|
java.util.logging.Level |
getLevelProperty(java.lang.String key,
java.util.logging.Level defaultValue)
Gets the boolean representation of property.
|
static SessionProperties |
getLibraryDefaults()
Returns the library default properties.
|
java.util.logging.Logger |
getLogger()
Gets the default logger for this application.
|
java.util.logging.Level |
getLoggerConsoleLevel()
Get the current log level of the console log handler.
|
java.util.logging.Level |
getLoggerFileLevel()
Get the current log level of the file log handler.
|
java.lang.String |
getLoggerNameSpace()
Get the current used namespace for the logger.
|
java.lang.String |
getLoggerOutputFile()
Get the file name, log messages are written to.
|
java.lang.String |
getPropertyFile()
Gets the properties file that was applied (by loadProperties() or
loadProperties(String) this SessionProperties instance.
|
int |
getRetriesNumber()
Get the number of retries that is set for the transmission of the cimXML
request.
|
javax.net.SocketFactory |
getSocketFactory()
Gets the custom socket factory for client connections.
|
java.lang.String |
getStringProperty(java.lang.String key,
java.lang.String defaultValue)
Gets the string represetation of property.
|
boolean |
getSynchronizedSslHandshake()
Returns a boolean that indicates whether or not SSL handshakes should
be synchronized.
|
java.lang.String |
getTruststore_password()
Deprecated.
For security reasons instead of this method, char[]
getTruststorePassword() should be used.
|
java.lang.String |
getTruststore()
Gets the path of current truststore.
|
char[] |
getTruststorePassword()
Gets the truststore password.
|
int |
getXmlParser()
Gets the Xml Parsing mode.
|
boolean |
isContentLengthRetryEnabled()
Returns a boolean that indicates whether or not the content lenght retry
mechanism is enabled.
|
boolean |
isCredentialsDefaultEnabled()
Determines if the usage of the default credentials is enabled or not.
|
boolean |
isDebugHttpConnectionPool()
Deprecated.
This method is not used anywhere...
|
boolean |
isDebugInputStream()
Determines if the response from the CIMOM's (before parsing the XML) will
be dumped into the default debugging output stream.
|
boolean |
isDebugXMLInput()
Determines if the XML from CIMOM's response will be dumped into the
default debugging output stream.
|
boolean |
isDebugXMLOutput()
Determines if the XML from request will be dumped into the default
debugging output stream.
|
boolean |
isGlobal()
Determines if these session properties are the global properties.
|
boolean |
isLoggingEnabled()
Determines if logging in general is enabled or not.
|
boolean |
loadProperties()
Loads the properties from the default property file.
|
boolean |
loadProperties(java.util.Properties properties)
Loads the properties from the specified properties.
|
boolean |
loadProperties(java.lang.String pPropertyFile)
Loads the properties from the specified file.
|
void |
setConnectionPoolSize(int poolSize)
Specifies the maximum number of connection pools to be maitained alive,
and later will be reused for additional request.
|
void |
setContentLength(int contentLength)
Determines the content length that is supposed to be used during the
retry mechanism.
|
void |
setContentLengthRetry(boolean enableContentCheck)
Enables or disables the content length retry mechanism.
|
void |
setCredentialsDefaultEnabled(boolean credentialsDefaultEnabled)
Specifies if the usage of the default credentials must be used or not.
|
void |
setDebugHttpConnectionPool(boolean enableDebugHTTPPool)
Deprecated.
This method is never used at all...
|
void |
setDebugInputStream(boolean enableDebugInputStream)
Specifies if the input stream must be dumped into the default debugging
output stream.
|
void |
setDebugOutputStream(java.io.OutputStream outputStream)
Specifies the default output stream to dump debugging information,
including the request/response xml documents.
|
void |
setDebugXMLInput(boolean enableDebugXMLInput)
Specifies if the XML response from the CIMOM will be dumped into the
default debugging output stream.
|
void |
setDebugXMLOutput(boolean enableDebugXMLOutput)
Specifies if the XML from the request will be dumped into the default
debugging output stream.
|
void |
setDefaultCredentials(java.lang.String credentialsPassword)
Specifies new default credentials to use if the usage of default
credentials is enabled.
|
void |
setDefaultPrincipal(java.lang.String credentialsUser)
Specifies new default principal to use if the usage of default
credentials is enabled.
|
void |
setHttpAuthenticationModule(java.lang.String pAuthenticationModule)
Sets the HTTP authentication module
|
void |
setHttpTimeOut(int timeOut)
Specifies the time out for HTTP connections.
|
void |
setJSSECertificate(java.lang.String jsseCertificateMgr)
Specifies the JSSE certificate manager used for https connection.
|
void |
setJSSEProtocol(java.lang.String pProtocol) |
void |
setJSSEProtocolHandler(java.lang.String handlerClassName) |
void |
setJSSEProvider(java.lang.String providerClassName)
Specifies the complete class name for the JSSE provider.
|
void |
setKeystore_password(char[] newPassword)
Specifies the password for the keystore.
|
void |
setKeystore(java.lang.String keystore)
Specifies the path of the keystore.
|
void |
setKeystoreType(java.lang.String type)
Specifies the type of the keystore.
|
void |
setLogger(java.util.logging.Logger newLogger)
Allows applications to specify external
Logger |
void |
setLoggerConsoleLevel(java.util.logging.Level loggerConsoleLevel)
Specifies a new log level for the console log handler.
|
void |
setLoggerFileLevel(java.util.logging.Level loggerFileLevel)
Specifies a new log level for the file log handler Supported on the
global properties instance only.
|
void |
setLoggerNameSpace(java.lang.String loggerNameSpace)
Specifies a new namespace for the logger.
|
void |
setLoggerOutputFile(java.lang.String loggerOutputFile)
Specifies a new log file name Supported on the global properties instance
only.
|
void |
setLoggingEnabled(boolean enableLogging)
Specifies if logging in general is enabled or not.
|
void |
setRetriesNumber(int retries)
Specifies the new number of retries that is set for the transmission of
the cimXML request.
|
void |
setSocketFactory(javax.net.SocketFactory factory)
Specifies the custom socket factory for client connections.
|
void |
setSynchronizedSslHandshake(boolean enableSynchronizedSslHandshake)
Enables or disables the synchronization of SSL handshakes
|
void |
setTruststore_password(char[] newPassword)
Specifies the password for the truststore.
|
void |
setTruststore_password(java.lang.String newPassword)
Deprecated.
For security reasons this method should not be used. Instead
setTruststore_password(char[] newPassword) should be used.
|
void |
setTruststore(java.lang.String truststore)
Specifies the path of the truststore.
|
void |
setXmlParser(int parsingMode)
Specifies the xml parsing mode.
|
getProperty, getProperty, list, list, load, load, loadFromXML, propertyNames, save, setProperty, store, store, storeToXML, storeToXML, stringPropertyNames
public static final int PULL_PARSER
public static final int SAX_PARSER
public static final int DOM_PARSER
public static final java.lang.String WWW_AUTHENTICATION
public static final java.lang.String PEGASUS_LOCAL_AUTHENTICATION
public SessionProperties()
getLibraryDefaults()
public static SessionProperties getGlobalProperties()
public static SessionProperties getLibraryDefaults()
public static SessionProperties getEnvironmentDefaults()
loadProperties()
public java.lang.String getStringProperty(java.lang.String key, java.lang.String defaultValue)
key
- a String representing the property name.defaultValue
- default value used in case of an error ocurrs while reading
the value.String
value for the related key, otherwise
the submitted defaultValue.public int getIntProperty(java.lang.String key, int defaultValue)
key
- a String representing the property name.defaultValue
- default value used in case of an error ocurrs while reading
the value.int
value for the related key, otherwise the
submitted devaultValuepublic boolean getBooleanProperty(java.lang.String key, boolean defaultValue)
key
- a String representing the property name.defaultValue
- default value used in case of an error ocurrs while reading
the value.boolean
value for the related key, otherwise
submitted defaultValuepublic java.util.logging.Level getLevelProperty(java.lang.String key, java.util.logging.Level defaultValue)
key
- a String representing the property name.defaultValue
- default value used in case of an error ocurrs while reading
the value.Level
value for the related key, othervide the
submitted defaultValuepublic java.io.OutputStream getDebugOutputStream()
OutputStream
public void setDebugOutputStream(java.io.OutputStream outputStream)
outputStream
- The OutputStream
to usepublic java.lang.String getKeystore()
public void setKeystore(java.lang.String keystore)
keystore
- The path to the keystorepublic java.lang.String getKeystoreType()
public void setKeystoreType(java.lang.String type)
type
- The type of the keystore (e.g. "JKS", "PKCS12")public java.lang.String getTruststore()
public void setTruststore(java.lang.String truststore)
truststore
- The path to the truststorepublic java.lang.String getTruststore_password()
public char[] getTruststorePassword()
public void setTruststore_password(java.lang.String newPassword)
newPassword
- The new password for the truststorepublic void setTruststore_password(char[] newPassword)
newPassword
- The new password for the truststorepublic char[] getKeystorePassword()
public void setKeystore_password(char[] newPassword)
newPassword
- The new password for the truststorepublic int getXmlParser()
public void setXmlParser(int parsingMode)
parsingMode
- An integer: 0 for pullbase, 1 for SAX, 2 for DOM.java.lang.IllegalArgumentException
- if the parsingMode is not in the range from 0 .. 2.public int getHttpTimeOut()
public void setHttpTimeOut(int timeOut)
timeOut
- The new time out for the HTTP connectionjava.lang.IllegalArgumentException
- if the timeOut is not in the range from 0 ..
Integer.MAX_VALUE
.public boolean isDebugXMLInput()
true
if debuging of XML responses is enabled,
otherwise false
public void setDebugXMLInput(boolean enableDebugXMLInput)
enableDebugXMLInput
- The value to disable/enable debugging the XML responsespublic boolean isDebugXMLOutput()
true
if debugging the XML requests is enabled,
otherwise false
public void setDebugXMLOutput(boolean enableDebugXMLOutput)
enableDebugXMLOutput
- The value to disable/enable debugging the XML requests.public boolean isDebugInputStream()
true
if debugging the XML responses is enabled,
otherwise false
public void setDebugInputStream(boolean enableDebugInputStream)
enableDebugInputStream
- The value to disable/enable dumping the the input stream to
the debugging output stream.public int getConnectionPoolSize()
public void setConnectionPoolSize(int poolSize)
poolSize
- The new size of possible connections.java.lang.IllegalArgumentException
- if the specified poolSize is not in the value range from -1 ..
Integer.MAX_VALUE.public boolean isDebugHttpConnectionPool()
true
if the debug ouput of the HTTP Connection
pool is enabled, otherwise false
public void setDebugHttpConnectionPool(boolean enableDebugHTTPPool)
enableDebugHTTPPool
- The value to disable/enable writing debug information of the
HTTP Connection Pool.public java.lang.String getJSSEProvider()
public void setJSSEProvider(java.lang.String providerClassName)
providerClassName
- The new class name for the JSSE provider.public java.lang.String getJSSEProtocol()
public void setJSSEProtocol(java.lang.String pProtocol)
pProtocol
- public java.lang.String getJSSEProtocolHandler()
public void setJSSEProtocolHandler(java.lang.String handlerClassName)
public javax.net.SocketFactory getSocketFactory()
public void setSocketFactory(javax.net.SocketFactory factory)
factory
- The custom socket factory. If null
the client
will use javax.net.SocketFactory.getDefault() or
javax.net.ssl.SslSocketFactory.getDefault() factory
respectively. Note that the client doesn't do a consistency
check between the protocol and the custom socket factory.public java.lang.String getJSSECertificate()
public void setJSSECertificate(java.lang.String jsseCertificateMgr)
jsseCertificateMgr
- The new JSSE certificate managerpublic java.util.logging.Logger getLogger()
Logger
public void setLogger(java.util.logging.Logger newLogger)
Logger to be used
by all the CIM clients.
Supported on the global properties instance only.
newLogger
- The new Logger
to be used for loggingjava.lang.IllegalStateException
- When called on a non-global instanceisGlobal()
public boolean isLoggingEnabled()
true
if logging is enabled, otherwise
false
public void setLoggingEnabled(boolean enableLogging)
enableLogging
- The value to disable/enable logging.java.lang.IllegalStateException
- When called on a non-global instanceisGlobal()
public java.util.logging.Level getLoggerConsoleLevel()
public void setLoggerConsoleLevel(java.util.logging.Level loggerConsoleLevel)
loggerConsoleLevel
- The new log level for the console log handlerjava.lang.IllegalStateException
- When called on a non-global instanceisGlobal()
public java.util.logging.Level getLoggerFileLevel()
public void setLoggerFileLevel(java.util.logging.Level loggerFileLevel)
loggerFileLevel
- The new log level for the file log handler.java.lang.IllegalStateException
- When called on a non-global instanceisGlobal()
public java.lang.String getLoggerNameSpace()
public void setLoggerNameSpace(java.lang.String loggerNameSpace)
loggerNameSpace
- The new namespace used for the logger.java.lang.IllegalStateException
- When called on a non-global instanceisGlobal()
public java.lang.String getLoggerOutputFile()
public void setLoggerOutputFile(java.lang.String loggerOutputFile)
loggerOutputFile
- java.lang.IllegalStateException
- When called on a non-global instanceisGlobal()
public boolean isCredentialsDefaultEnabled()
true
if the usage of the default credentials is
enabled, otherwise false
public void setCredentialsDefaultEnabled(boolean credentialsDefaultEnabled)
credentialsDefaultEnabled
- The value to disable/enable the usage of the default
credentials.public java.lang.String getDefaultCredentials()
public void setDefaultCredentials(java.lang.String credentialsPassword)
credentialsPassword
- The new credential (password) to use.public java.lang.String getDefaultPrincipal()
public void setDefaultPrincipal(java.lang.String credentialsUser)
credentialsUser
- The new principal (userID) to use.public int getRetriesNumber()
public void setRetriesNumber(int retries)
retries
- The new number of retries.public boolean isContentLengthRetryEnabled()
true
if content length check is enabled, otherwise
false
public void setContentLengthRetry(boolean enableContentCheck)
enableContentCheck
- The value to disable/enable the content length retry
mechanism.public int getContentLength()
public void setContentLength(int contentLength)
contentLength
- The content length.public java.lang.String getHttpAuthenticationModule()
public void setHttpAuthenticationModule(java.lang.String pAuthenticationModule)
pAuthenticationModule
- The authentication moduleWWW_AUTHENTICATION
,
PEGASUS_LOCAL_AUTHENTICATION
public boolean getSynchronizedSslHandshake()
true
if SSL handshakes should be synchronized, otherwise
false
public void setSynchronizedSslHandshake(boolean enableSynchronizedSslHandshake)
enableSynchronizedSslHandshake
- The value to disable/enable the SSL handshake synchronization
mechanism.public boolean loadProperties(java.util.Properties properties)
properties
- An instance of properties.true
if the property file could be loaded
successfully, otherwise false
is returned.public boolean loadProperties()
true
if the property file could be loaded
successfully, otherwise false
is returned.public boolean loadProperties(java.lang.String pPropertyFile)
pPropertyFile
- a String representing the file location.true
if the property file could be loaded
successfully, otherwise false
is returned.public java.lang.Object clone()
clone
in class java.util.Hashtable<java.lang.Object,java.lang.Object>
public boolean isGlobal()
true
if these session properties are the global
onespublic java.lang.String getPropertyFile()
null
.Copyright © 2005, 2011 IBM Corporation. All Rights Reserved.