class EnvironmentDaemon extends java.lang.Object implements EnvironmentAccessor
| Modifier and Type | Field and Description |
|---|---|
private ClientStorage |
clientStorage
ClientStorage instance.
|
private EnvironmentReader |
currentEnv
The currently loaded environment to use instead of default.
|
private EnvironmentReader |
defaultEnv
The default environment to use when load() and use() was not specified.
|
private java.util.Map<java.lang.String,EnvironmentReader> |
envFallbackMap
Map to store Fallback environments for possible reuse.
|
private java.util.Map<java.lang.String,EnvironmentReader> |
envIniMap
Map to store INI environments for possible reuse.
|
private java.util.Map<java.lang.String,EnvironmentReader> |
envRegMap
Map to store registry environments for possible reuse.
|
private boolean |
isReadOnly
INI files read only property
|
private java.lang.Object |
modToken
Token used to authenticate with the dispatcher when registering APIs.
|
| Constructor and Description |
|---|
EnvironmentDaemon(java.lang.String envVersion,
boolean local,
boolean isWin,
ClientStorage clientStorage)
Create an instance and export its API to the network.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Boolean |
getBooleanKeyValue(java.lang.String section,
java.lang.String key,
java.lang.Boolean defValue)
Getting the boolean key value from the current environment.
|
java.lang.String |
getCurrentPrinterName()
Get the name of the current printer on the client side.
|
java.lang.String |
getEnvironmentName()
Get the current environment's name.
|
java.lang.String |
getEnvironmentType()
Get the current environment's type.
|
java.lang.String |
getKeyValue(java.lang.String section,
java.lang.String key)
Getting the key value from the current environment or default environment if the current one
is not loaded.
|
java.lang.String |
getOperatingSystem()
If there is still no match, then any
os.name with the
lowercase text "unix" will return "UNIX" and any os.name
with the lowercase text "windows" will return "WIN32". |
private boolean |
getReadOnly()
Get environments read only flag.
|
boolean |
isCustomEnvironment()
Check if a custom environment is in use.
|
boolean |
load(java.lang.String env,
java.lang.String directory,
boolean flagNew,
java.lang.String baseKey)
Creates application defaults implementing Progress LOAD statement.
|
void |
setDefaultEnvironment(java.lang.String iniFile)
Sets the default environment to a stanza ini file, overwriting any default registry for
WIN32.
|
void |
setKeyValue(java.lang.String section,
java.lang.String key,
java.lang.String value)
Set new value for keys in the current environment or the default environment if
the current one is not loaded.
|
java.lang.String |
unload(java.lang.String env)
Unloads specifies environment from the current one.
|
java.lang.String |
use(java.lang.String env)
Specifies environment defaults to use in subsequent windows.
|
private EnvironmentReader defaultEnv
private EnvironmentReader currentEnv
private java.util.Map<java.lang.String,EnvironmentReader> envRegMap
private java.util.Map<java.lang.String,EnvironmentReader> envIniMap
private java.util.Map<java.lang.String,EnvironmentReader> envFallbackMap
private boolean isReadOnly
private java.lang.Object modToken
private final ClientStorage clientStorage
EnvironmentDaemon(java.lang.String envVersion,
boolean local,
boolean isWin,
ClientStorage clientStorage)
envVersion - The current version string of the Progress compatible environment.local - true to startup within the server process which must bypass the
shared infrastructure initialization. Use false for the normal
client JVM startup.isWin - true if this is an WIN32 environment backed up by a default.clientStorage - ClientStorage instance.public boolean load(java.lang.String env,
java.lang.String directory,
boolean flagNew,
java.lang.String baseKey)
load in interface EnvironmentAccessorenv - The environment to create or load. Can be the registry key, initialization file.directory - The directory path for existing initialization file or place to create
initialization file.flagNew - If true - the new file or registry key will be created overwriting the
possibly existed one.baseKey - When the parameter is specified the searching is performed under the particular key
value. It is possible to specify "INI" as parameter. In this case search or creation
will be done inside initialization file specified in env parameter.true if loaded false otherwisepublic java.lang.String use(java.lang.String env)
use in interface EnvironmentAccessorenv - The environment to load. If the parameter is empty string ("") the default
environment becomes the current one.null if the
environment can't be found.public boolean isCustomEnvironment()
isCustomEnvironment in interface EnvironmentAccessorpublic java.lang.String getEnvironmentName()
getEnvironmentName in interface EnvironmentAccessorpublic java.lang.String getEnvironmentType()
getEnvironmentType in interface EnvironmentAccessorpublic void setKeyValue(java.lang.String section,
java.lang.String key,
java.lang.String value)
setKeyValue in interface EnvironmentAccessorsection - The name of the section containing the key to modify.key - The name of the key to modifyvalue - The new value of the key under modification.public java.lang.String getKeyValue(java.lang.String section,
java.lang.String key)
getKeyValue in interface EnvironmentAccessorsection - The name of the section containing the key to get.key - The name of the key to get.public java.lang.Boolean getBooleanKeyValue(java.lang.String section,
java.lang.String key,
java.lang.Boolean defValue)
getBooleanKeyValue in interface EnvironmentAccessorsection - The name of the section containing the key to get.key - The name of the key key to get or default key if not specified.defValue - The default value, to be returned when the value does not exist
in the environment.defValue if the value
does not exist in the environment.public java.lang.String unload(java.lang.String env)
unload in interface EnvironmentAccessorenv - The environment to unload. Can be the registry or initialization file. The
environment to unload should be previously loaded by load() method.null if the
environment can't be found.public void setDefaultEnvironment(java.lang.String iniFile)
setDefaultEnvironment in interface EnvironmentAccessoriniFile - The name of the ini file backing the stanzas.public java.lang.String getOperatingSystem()
os.name with the
lowercase text "unix" will return "UNIX" and any os.name
with the lowercase text "windows" will return "WIN32".
If there is still no match, the os.name returned by the
Java will be returned.
getOperatingSystem in interface EnvironmentAccessorpublic java.lang.String getCurrentPrinterName()
getCurrentPrinterName in interface EnvironmentAccessorprivate boolean getReadOnly()
true the
environments INI files are loaded as resources from remote server jar files otherwise
will follow default behavior and INI files are loaded from client file system.