org.openhealthexchange.openpixpdq.ihe.configuration
Class ConfigurationLoader

java.lang.Object
  extended by org.openhealthexchange.openpixpdq.ihe.configuration.ConfigurationLoader

public class ConfigurationLoader
extends java.lang.Object

This class loads an IHE Actor configuration file and initializes all of the appropriate actors within the DocumentBroker, PatientBroker and AuditBroker.

Version:
1.0 - Dec 26, 2005
Author:
Jim Firby
See Also:
com.misyshealthcare.connect.base.PatientBroker, AuditBroker

Nested Class Summary
 class ConfigurationLoader.ActorDescription
          An implementation of the IheActorDescription class to be used by GUI elements and other things.
 class ConfigurationLoader.IheBrokerController
          An implementation of a broker controller that will unregister and IHE actor.
 class ConfigurationLoader.PixManagerActorDescription
          An implementation of the IheActorDescription class to be used by PIX Manager Actor
 
Field Summary
(package private)  org.apache.log4j.Appender currentAppender
           
 
Constructor Summary
ConfigurationLoader()
           
 
Method Summary
 java.util.Collection<IheActorDescription> getActorDescriptions()
          Gets the actor descriptions loaded in the configuration.
 ConfigurationLoader.ActorDescription getDescriptionById(java.lang.String id)
          Looks up an actor description given an ID.
static ConfigurationLoader getInstance()
          Gets the singleton instance for this class.
 boolean loadConfiguration(java.io.File file, boolean autoInstallActors, java.lang.String oidRoot, com.misyshealthcare.connect.util.OID.OidSource oidSource, java.lang.String styleSheetLocation, java.util.Properties patientQueryDesignProps, com.misyshealthcare.connect.base.codemapping.ICodeMappingManager codeMappingManager, com.misyshealthcare.connect.util.LibraryConfig.ILogContext logContext)
          Loads the supplied configuration file.
 boolean loadConfiguration(java.io.File file, boolean autoInstallActors, java.lang.String oidRoot, com.misyshealthcare.connect.util.OID.OidSource oidSource, java.lang.String styleSheetLocation, java.util.Properties patientQueryDesignProps, com.misyshealthcare.connect.base.codemapping.ICodeMappingManager codeMappingManager, com.misyshealthcare.connect.util.LibraryConfig.ILogContext logContext, com.misyshealthcare.connect.util.LibraryConfig.IPatientIdConverter pidConverter)
          Loads the supplied configuration file.
 boolean loadConfiguration(java.io.File file, java.lang.String oidRoot, com.misyshealthcare.connect.util.OID.OidSource oidSource, java.lang.String styleSheetLocation, java.util.Properties patientQueryDesignProps, com.misyshealthcare.connect.base.codemapping.ICodeMappingManager codeMappingManager, com.misyshealthcare.connect.util.LibraryConfig.ILogContext logContext)
          Loads the supplied configuration file and create all of the IHE actors that it defines.
 boolean loadConfiguration(java.lang.String filename, boolean autoInstallActors)
          Loads the supplied configuration file.
 boolean loadConfiguration(java.lang.String filename, boolean autoInstallActors, java.lang.String oidRoot, com.misyshealthcare.connect.util.OID.OidSource oidSource, java.lang.String styleSheetLocation, java.util.Properties patientQueryDesignProps, com.misyshealthcare.connect.base.codemapping.ICodeMappingManager codeMappingManager, com.misyshealthcare.connect.util.LibraryConfig.ILogContext logContext)
          Loads the supplied configuration file.
 boolean loadConfiguration(java.lang.String filename, java.lang.String oidRoot, com.misyshealthcare.connect.util.OID.OidSource oidSource, java.lang.String styleSheetLocation, java.util.Properties patientQueryDesignProps, com.misyshealthcare.connect.base.codemapping.ICodeMappingManager codeMappingManager, com.misyshealthcare.connect.util.LibraryConfig.ILogContext logContext)
          Loads the supplied configuration file and creates all of the IHE actors that it defines.
static void main(java.lang.String[] args)
          testing only
 void resetAllBrokers()
          Clears all brokers and stops all active actors.
 boolean resetConfiguration(java.util.Collection<java.lang.Object> actorDescriptions)
          Resets the current IHE brokers to use the actors described in the list passed in.
 boolean resetConfiguration(java.util.Collection<java.lang.Object> actorDescriptions, java.lang.String logFilename)
          Resets the current IHE brokers to use the actors described in the list passed in.
 boolean resetConfiguration(java.util.Collection<java.lang.Object> actorDescriptions, java.lang.String logFilename, IMesaLogger mesaLog)
          Resets the current IHE brokers to use the actors described in the list passed in.
 void setLoggingFile(java.lang.String fullPathToLogFile, org.apache.log4j.Level level, java.lang.String pattern)
          Sets the default file to write to for the root.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentAppender

org.apache.log4j.Appender currentAppender
Constructor Detail

ConfigurationLoader

public ConfigurationLoader()
Method Detail

getInstance

public static ConfigurationLoader getInstance()
Gets the singleton instance for this class.

Returns:
the singleton ConfigurationLoader

loadConfiguration

public boolean loadConfiguration(java.lang.String filename,
                                 java.lang.String oidRoot,
                                 com.misyshealthcare.connect.util.OID.OidSource oidSource,
                                 java.lang.String styleSheetLocation,
                                 java.util.Properties patientQueryDesignProps,
                                 com.misyshealthcare.connect.base.codemapping.ICodeMappingManager codeMappingManager,
                                 com.misyshealthcare.connect.util.LibraryConfig.ILogContext logContext)
                          throws IheConfigurationException
Loads the supplied configuration file and creates all of the IHE actors that it defines.

Parameters:
filename - the name of the configuration file
oidRoot - the OID root
oidSource - the OID.OidSource interface which provides a unique oid id.
styleSheetLocation - the style sheet location for CDA transformation
patientQueryDesignProps - the query design properties
codeMappingManager - the CodeMappingManager to be used for data transformation
logContext - the LogContext to be used for audit logging
Returns:
True if the configuration file was processed successfully
Throws:
IheConfigurationException - When there is something wrong with the specified configuration

loadConfiguration

public boolean loadConfiguration(java.io.File file,
                                 java.lang.String oidRoot,
                                 com.misyshealthcare.connect.util.OID.OidSource oidSource,
                                 java.lang.String styleSheetLocation,
                                 java.util.Properties patientQueryDesignProps,
                                 com.misyshealthcare.connect.base.codemapping.ICodeMappingManager codeMappingManager,
                                 com.misyshealthcare.connect.util.LibraryConfig.ILogContext logContext)
                          throws IheConfigurationException
Loads the supplied configuration file and create all of the IHE actors that it defines.

Parameters:
file - The configuration file
oidRoot - the OID root
oidSource - the OID.OidSource interface which provides a unique oid id.
styleSheetLocation - the style sheet location for CDA transformation
patientQueryDesignProps - the query design properties
codeMappingManager - the CodeMappingManager to be used for data transformation
logContext - the LogContext to be used for audit logging
Returns:
True if the configuration file was processed successfully
Throws:
IheConfigurationException - When there is something wrong with the specified configuration

loadConfiguration

public boolean loadConfiguration(java.lang.String filename,
                                 boolean autoInstallActors,
                                 java.lang.String oidRoot,
                                 com.misyshealthcare.connect.util.OID.OidSource oidSource,
                                 java.lang.String styleSheetLocation,
                                 java.util.Properties patientQueryDesignProps,
                                 com.misyshealthcare.connect.base.codemapping.ICodeMappingManager codeMappingManager,
                                 com.misyshealthcare.connect.util.LibraryConfig.ILogContext logContext)
                          throws IheConfigurationException
Loads the supplied configuration file. If the argument is 'true', then create an initialize all of the IHE actors in the file. If the argument is 'false', save the actors away for GUI access.

Parameters:
filename - the name of the configuration file
autoInstallActors - If 'true' create the actors in this configuration, else store them up
oidRoot - the OID root
oidSource - the OID.OidSource interface which provides a unique oid id.
styleSheetLocation - the style sheet location for CDA transformation
patientQueryDesignProps - the query design properties
codeMappingManager - the CodeMappingManager to be used for data transformation
logContext - the LogContext to be used for audit logging
Returns:
'true' if the configuration was loaded successfully
Throws:
IheConfigurationException - When there is a problem with the configuration file

loadConfiguration

public boolean loadConfiguration(java.lang.String filename,
                                 boolean autoInstallActors)
                          throws IheConfigurationException
Loads the supplied configuration file. If the argument is 'true', then create an initialize all of the IHE actors in the file. If the argument is 'false', save the actors away for GUI access.

Parameters:
filename - the name of the configuration file
autoInstallActors - If 'true' create the actors in this configuration, else store them up
Returns:
'true' if the configuration was loaded successfully
Throws:
IheConfigurationException - When there is a problem with the configuration file

loadConfiguration

public boolean loadConfiguration(java.io.File file,
                                 boolean autoInstallActors,
                                 java.lang.String oidRoot,
                                 com.misyshealthcare.connect.util.OID.OidSource oidSource,
                                 java.lang.String styleSheetLocation,
                                 java.util.Properties patientQueryDesignProps,
                                 com.misyshealthcare.connect.base.codemapping.ICodeMappingManager codeMappingManager,
                                 com.misyshealthcare.connect.util.LibraryConfig.ILogContext logContext)
                          throws IheConfigurationException
Loads the supplied configuration file. If the argument is 'true', then create an initialize all of the IHE actors in the file. If the argument is 'false', save the actors away for GUI access.

Parameters:
file - the configuration file
autoInstallActors - If 'true' create the actors in this configuration, else store them up
oidRoot - the OID root
oidSource - the OID.OidSource interface which provides a unique oid id.
styleSheetLocation - the style sheet location for CDA transformation
patientQueryDesignProps - the query design properties
codeMappingManager - the CodeMappingManager to be used for data transformation
logContext - the LogContext to be used for audit logging
Returns:
'true' if the configuration was loaded successfully
Throws:
IheConfigurationException - When there is a problem with the configuration file

loadConfiguration

public boolean loadConfiguration(java.io.File file,
                                 boolean autoInstallActors,
                                 java.lang.String oidRoot,
                                 com.misyshealthcare.connect.util.OID.OidSource oidSource,
                                 java.lang.String styleSheetLocation,
                                 java.util.Properties patientQueryDesignProps,
                                 com.misyshealthcare.connect.base.codemapping.ICodeMappingManager codeMappingManager,
                                 com.misyshealthcare.connect.util.LibraryConfig.ILogContext logContext,
                                 com.misyshealthcare.connect.util.LibraryConfig.IPatientIdConverter pidConverter)
                          throws IheConfigurationException
Loads the supplied configuration file. If the argument is 'true', then create an initialize all of the IHE actors in the file. If the argument is 'false', save the actors away for GUI access.

Parameters:
file - the configuration file
autoInstallActors - If 'true' create the actors in this configuration, else store them up
oidRoot - the OID root
oidSource - the OID.OidSource interface which provides a unique oid id.
styleSheetLocation - the style sheet location for CDA transformation
patientQueryDesignProps - the query design properties
codeMappingManager - the CodeMappingManager to be used for data transformation
logContext - the LogContext to be used for audit logging
pidConvert - the patientIdConverter to be used to convert the sourcePatientId to the PixLocalPatientId
Returns:
'true' if the configuration was loaded successfully
Throws:
IheConfigurationException - When there is a problem with the configuration file

setLoggingFile

public void setLoggingFile(java.lang.String fullPathToLogFile,
                           org.apache.log4j.Level level,
                           java.lang.String pattern)
Sets the default file to write to for the root. Also sets the level. Note: if level is null the rool level will be set to INFO. Note that if there already is a file appender set this way it will be removed before the new one is added. All other appenders are left untouched.

Parameters:
fullPathToLogFile - the Path to append the log to.
level - the Level to log, null for INFO.
pattern - Some other pattern to use for logging. null ok.

getActorDescriptions

public java.util.Collection<IheActorDescription> getActorDescriptions()
Gets the actor descriptions loaded in the configuration.

Returns:
the actor descriptions

resetConfiguration

public boolean resetConfiguration(java.util.Collection<java.lang.Object> actorDescriptions)
                           throws IheConfigurationException
Resets the current IHE brokers to use the actors described in the list passed in. These may be actor descriptions objects or the IDs of actor description objects. This call will not do any logging.

Parameters:
actorDescriptions - the actor descriptions or IDs to use to define the actors
Returns:
'true' if the actors were created and initialized successfully
Throws:
IheConfigurationException - When there is a problem with the configuration file

resetConfiguration

public boolean resetConfiguration(java.util.Collection<java.lang.Object> actorDescriptions,
                                  java.lang.String logFilename)
                           throws IheConfigurationException
Resets the current IHE brokers to use the actors described in the list passed in. These may be actor descriptions objects or the IDs of actor description objects.

Parameters:
actorDescriptions - the actor descriptions or IDs to use to define the actors
logFilename - the log file to install for this set of actors
Returns:
'true' if the actors were created and initialized successfully
Throws:
IheConfigurationException - When there is a problem with the configuration file

resetConfiguration

public boolean resetConfiguration(java.util.Collection<java.lang.Object> actorDescriptions,
                                  java.lang.String logFilename,
                                  IMesaLogger mesaLog)
                           throws IheConfigurationException
Resets the current IHE brokers to use the actors described in the list passed in. These may be actor descriptions objects or the IDs of actor description objects.

Parameters:
actorDescriptions - the actor descriptions or IDs to use to define the actors
logFilename - the log file to install for this set of actors
mesaLog - the mesa log used for mesa tests
Returns:
'true' if the actors were created and initialized successfully
Throws:
IheConfigurationException - When there is a problem with the configuration file

resetAllBrokers

public void resetAllBrokers()
Clears all brokers and stops all active actors.


getDescriptionById

public ConfigurationLoader.ActorDescription getDescriptionById(java.lang.String id)
Looks up an actor description given an ID.

Parameters:
id - the actor description ID
Returns:
the actor description, if there is one

main

public static void main(java.lang.String[] args)
testing only