|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ifeth.sehr.lib.SEHRCfg
This method is the only one and basic configuration layer between the SEHR modules and the operating system.
The configuration file knows (due to the setup procedure) where to find the databases, environments like Apache, SAMBA etc.
To retrieve the running configuration one of the methods listed below should be used in accordance to the context:
SEHRCfg cfg = new SEHRCfg(true);
SEHRCfg cfg = new SEHRCfg(hostip,port);
to
get the running configuration.(...) SEHRCFg cfg= new SEHRCfg(); if (!cfg.loadSEHRCfg(true)){ //return/exit with error return false; } //continue (...)
Important: This object requires always a local read access to
the running or defined configuration file for security reasons.
On remote clients get relevant data of the running SEHR system like SMTP
relay or POP3 server by the implemented SOAP interface.
Constructor Summary | |
SEHRCfg()
Parameterless instance for using object in JSP as bean. |
|
SEHRCfg(boolean search)
Init SEHR environment object either by scaning for the configuration or by accessing the default host/port |
|
SEHRCfg(java.lang.String file)
Init SEHR environment object using specified configuration file |
|
SEHRCfg(java.lang.String ip,
int port)
Init SEHR environment object using specified host/port to get the configuration file to load. |
Method Summary | |
java.sql.Connection |
getCon()
|
java.lang.String |
getCssfile()
Get the style file for WEB pages. |
java.lang.String |
getdbHost()
|
java.lang.String |
getdbHostname()
|
java.lang.String |
getdbSec()
|
java.lang.String |
getdbSecUser()
|
java.lang.String |
getdbSecUserPw()
|
java.lang.String |
getDebug()
|
int |
getDebugInt()
|
java.util.logging.Level |
getDebugLevel()
Returns a 'Level' object related to the stored/set debug level |
static java.util.logging.Level |
getDebugLevel(int d)
Returns a 'Level' object related to a given 'int' between 0 to 9 See SEHR conventions for debugging details |
java.lang.String |
getDomain()
|
SEHRDataSource |
getFbds()
|
java.lang.String |
getFQNN()
|
java.lang.String |
getIMAPServer()
|
java.lang.String |
getLANIP()
Get LAN IP where current server by SERVER IP running in Due to IP conventions the LAN Ip can be build from SERVER IP otherwise the server would not work :) > |
java.lang.String |
getLogfile()
|
org.apache.log4j.Logger |
getLogger()
|
java.lang.String |
getModuleOwner()
|
java.lang.String |
getModuleRoot()
|
java.lang.String |
getPOP3Server()
|
java.lang.String |
getRunningCfgFile()
|
java.lang.String |
getSEHRCfgValue(java.lang.String key)
Common getter to retrieve a setting value from running configuration Note: There are a lot predefined methods... |
java.lang.String |
getSERVERIP()
|
java.lang.String |
getSERVERPort()
|
java.lang.String |
getSMTPServer()
|
java.lang.String |
getSubdomain()
|
java.lang.String |
getSYSHOME()
|
java.lang.String |
getTitle()
|
java.lang.String |
getURLSEHRAdminAsIP()
Returns the URL to access the SEHR-OSI module by Tomcat for administration purposes. |
java.lang.String |
getZoneID()
|
void |
initDBConnection()
Init a db connection to zone admin db using settings of this object |
static boolean |
isNULLOrEmpty(java.lang.String s)
Check if a given String is null or empty. |
boolean |
isSEHRCfgLoaded()
Simple check wether the SEHR object was loaded (is available). |
boolean |
isSEHRCfgProp()
Check wether SEHR environment is initialized (configuration is avlb.) |
boolean |
loadSEHRCfg()
Load SEHR configuration by searching for the running configuration Use this method to get/init the SEHR configuration for all modules. |
boolean |
loadSEHRCfg(java.lang.String f)
Load SEHR configuration from a given configuration file. |
boolean |
loadSEHRCfg(java.lang.String host,
int port)
Get the configuration from the running server. |
void |
logDebug(java.lang.String message)
|
void |
logError(java.lang.String message)
|
void |
logInfo(java.lang.String message)
|
void |
logWarn(java.lang.String message)
|
static void |
main(java.lang.String[] args)
|
boolean |
readSEHRCfgFile(java.lang.String file)
Read configuration file and store key value pairs as properties. |
void |
readSEHRCfgFileToProp(java.lang.String file)
Deprecated. (for downgrading compatibility) from modules use 'loadSEHRCfg()' |
void |
saveCfgFile(java.lang.String file)
Save configuration in memory as configuration property file This method is used by the SEHRServer task to store the 'runnning' configuration and may be used by the user to redefine settings... |
void |
setCon(java.sql.Connection con)
|
void |
setdbHost(java.lang.String dbHost)
|
void |
setdbSecUser(java.lang.String dbSecUser)
|
void |
setdbSecUserPw(java.lang.String dbSecUserPw)
|
void |
setDebugLevel(int level)
|
void |
setFbds(SEHRDataSource fbds)
|
java.lang.String |
toString()
Retrieve a very simple object information.... |
static java.lang.String |
trimnull(java.lang.String s)
Helper method to set 'null' strings to "" strings for a better review from database. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public SEHRCfg()
If using object as bean don't forget to load the configuration by
sehrcfg.loadSEHRCfg([options]);
public SEHRCfg(boolean search)
public SEHRCfg(java.lang.String file)
public SEHRCfg(java.lang.String ip, int port)
Note: Finally you must have a physical read access to the file
to load the configuration. On WEB services 127.0.0.1/24100 is the
default and you can use the simplified instantiation by using
SEHRCfg(true)
. This method is used in testing
environments...
Method Detail |
public java.lang.String toString()
public java.lang.String getSEHRCfgValue(java.lang.String key)
Note: There are a lot predefined methods...
public java.lang.String getModuleRoot()
public java.lang.String getModuleOwner()
public java.lang.String getLogfile()
public java.lang.String getTitle()
public java.lang.String getZoneID()
public java.lang.String getDomain()
public java.lang.String getSubdomain()
public java.lang.String getSERVERPort()
public java.lang.String getSERVERIP()
public java.lang.String getLANIP()
Due to IP conventions the LAN Ip can be build from SERVER IP otherwise the server would not work :) >
public java.lang.String getFQNN()
public java.lang.String getURLSEHRAdminAsIP()
public java.lang.String getSMTPServer()
public java.lang.String getPOP3Server()
public java.lang.String getIMAPServer()
public java.lang.String getDebug()
public int getDebugInt()
public void setDebugLevel(int level)
public java.util.logging.Level getDebugLevel()
public static java.util.logging.Level getDebugLevel(int d)
See SEHR conventions for debugging details
public java.lang.String getdbSec()
public java.lang.String getdbHost()
public java.lang.String getdbHostname()
public void setdbHost(java.lang.String dbHost)
public java.lang.String getdbSecUser()
public void setdbSecUser(java.lang.String dbSecUser)
public java.lang.String getdbSecUserPw()
public void setdbSecUserPw(java.lang.String dbSecUserPw)
public java.sql.Connection getCon()
public void setCon(java.sql.Connection con)
con
- Set (store) the current connection to IntraSEC by this
object.public SEHRDataSource getFbds()
public void setFbds(SEHRDataSource fbds)
fbds
- The fbds to set.public java.lang.String getSYSHOME()
public java.lang.String getRunningCfgFile()
public void initDBConnection()
public boolean isSEHRCfgLoaded()
Use this method to check if the configuration is avbl. and the db 'intrasec' is accessable
public boolean isSEHRCfgProp()
public boolean loadSEHRCfg()
Use this method to get/init the SEHR configuration for all modules.
The configuration file is placed at 'path_to_sehrroot/etc/.sehr' by
convention. If the server has been started (with default or another
configuration file using option -c) the running configuration is
stored as 'path_to_sehrroot/tmp/.running'.
This method tries to get the running configuration using some
methods to find it.
To use another configuration file use
'loadSEHRCfg(fullpath_and_name)'
If the SEHR service host(ip and port) is known use
'loadSEHRCfg(ip, port)'
If the SEHR module/client is running on the same host (localhost) just
use
'loadSEHRCfg('127.0.0.1', port)'
Note:
Keep in mind that there must be finally a physical request to the
local configuration file - You can't hop to an external SEHR node
configuration file due to important security aspects!
public boolean loadSEHRCfg(java.lang.String host, int port)
This is a helper function to get the path and name of the
configuration file on a running server. If the server is not running
the method returns "false".
This method also usable as an indicator for a well running SEHR core.
host
- port
- public boolean loadSEHRCfg(java.lang.String f)
public java.lang.String getCssfile()
Notes:
The default CSS file to use is defined in WEB.XML
Path must be included within HTML code and depends on the location the
styles are located
public static boolean isNULLOrEmpty(java.lang.String s)
public static java.lang.String trimnull(java.lang.String s)
The method is static so it can be used by other classes :)
public void readSEHRCfgFileToProp(java.lang.String file) throws java.io.IOException
from modules use 'loadSEHRCfg()'
java.io.IOException
public boolean readSEHRCfgFile(java.lang.String file)
Use
public void saveCfgFile(java.lang.String file) throws java.io.IOException
This method is used by the SEHRServer task to store the 'runnning' configuration and may be used by the user to redefine settings...
java.io.IOException
public org.apache.log4j.Logger getLogger()
public void logInfo(java.lang.String message)
public void logDebug(java.lang.String message)
public void logWarn(java.lang.String message)
public void logError(java.lang.String message)
public static void main(java.lang.String[] args)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |