|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsystemic.sif.sifcommon.utils.SIFCommonProperties
public class SIFCommonProperties
This class provides a number of handy methods to access the values of the SIFCommon Framework properties file. Generally this file is called SIFAgent.properties but it doesn't have to.
Field Summary | |
---|---|
static int |
NO_EVENT
Constant to check if the event frequency is indicating that no events should be sent. |
static int |
NO_SYNC
Constant to check if the sync frequency is indicating that no sync should be performed. |
Constructor Summary | |
---|---|
SIFCommonProperties()
Same as the method above but it assumes that the property file is called SIFAgent.properties. |
|
SIFCommonProperties(java.lang.String propertyFileName)
Name of the SIFCommon Framework Property file. |
Method Summary | |
---|---|
java.lang.String |
getADKConfigDir(java.lang.String agentID)
Returns the SIFWorks ADK configuration file directory for the given agent. |
java.lang.String |
getADKConfigFileName(java.lang.String agentID)
Returns the SIFWorks ADK configuration file name for the given agent. |
java.lang.String |
getADKConfigPathAndFileName(java.lang.String agentID)
Returns the SIFWorks ADK configuration file name with the full path for the given agent. |
java.lang.String |
getApplicationID(java.lang.String agentID,
java.lang.String defaultValue)
This method returns the applicationID for the given agent. |
java.util.List<java.lang.String> |
getCustomObjects(java.lang.String agentID)
This method returns a list of custom object names for a given agent. |
java.lang.String |
getCustonObjBasePackageName(java.lang.String agentID)
Returns the package name of the custom objects. |
java.lang.String |
getDebugLevel(java.lang.String agentID)
Returns the debug level for the given agent. |
int |
getEventBatchSize()
|
int |
getEventFrequencyInSeconds(java.lang.String agentID,
int defaultValue)
This method returns the default event frequency for the given agent. |
int |
getEventFrequencyInSeconds(java.lang.String agentID,
java.lang.String publisherID,
int defaultValue)
This method returns the event frequency for the given agent and publisher. |
java.util.List<java.lang.String> |
getFromCommaSeparated(java.lang.String propertyName)
|
java.lang.String |
getLogDir(java.lang.String agentID)
Returns the directory for Log4J logging for the given agent. |
java.lang.String |
getLogFileName(java.lang.String agentID)
Returns the logging file name for the given agent. |
java.lang.String |
getLogPathAndFileName(java.lang.String agentID)
Returns the logging file name with the full path for the given agent. |
java.lang.String |
getMappingName(java.lang.String agentID)
Returns the name of the mapping section to be used for this agent. |
boolean |
getMultiThreaded(java.lang.String agentID,
boolean defaultValue)
This method returns the multi-threaded indicator for the given agent. |
int |
getNumConsumerThreads(java.lang.String agentID)
This method returns the number of threads that shall be initiated to consume messages retrieved by the given agent. |
int |
getNumConsumerThreads(java.lang.String agentID,
java.lang.String subscriberID)
This method returns the number of threads that shall be initiated to consume messages retrieved by the given subscriber. |
java.lang.String |
getPathAndFileName(java.lang.String path,
java.lang.String name)
Builds a full path and file name. |
java.util.Properties |
getProperties()
This method returns the values of the SIFCommon Framework Property file as a property structure. |
java.lang.Boolean |
getPropertyAsBool(java.lang.String propertyName)
Returns the given property as a boolean object. |
boolean |
getPropertyAsBool(java.lang.String propertyName,
boolean defaultValue)
Returns the given property as a boolean. |
java.lang.Integer |
getPropertyAsInt(java.lang.String propertyName)
Returns the given property as a Integer object. |
int |
getPropertyAsInt(java.lang.String propertyName,
int defaultValue)
Returns the given property as a int. |
java.lang.String |
getPropertyAsString(java.lang.String propertyName,
java.lang.String defaultValue)
Returns the given property as a String. |
java.lang.String |
getPublisherBasePackageName(java.lang.String agentID)
Returns the package name of the publishers. |
java.util.List<java.lang.String> |
getPublishers(java.lang.String agentID)
This method returns a list of publisher names for a given agent. |
int |
getStartupDelay(int defalutValue)
Returns the value for the start up delay in seconds between publishers and subscribers. |
java.lang.String |
getSubscriberBasePackageName(java.lang.String agentID)
Returns the package name of the subscribers. |
java.util.List<java.lang.String> |
getSubscribers(java.lang.String agentID)
This method returns a list of subscriber names for a given agent. |
int |
getSyncFrequencyInSeconds(java.lang.String agentID,
int defaultValue)
This method returns the default sync frequency for the given agent. |
int |
getSyncFrequencyInSeconds(java.lang.String agentID,
java.lang.String subscriberID,
int defaultValue)
This method returns the sync frequency for the given agent and subscriber. |
java.lang.String |
getTestDir(java.lang.String agentID)
Returns the test directory for the given agent. |
boolean |
getTestMode(java.lang.String agentID)
This method returns the test mode indicator for the given agent. |
java.lang.String |
getWorkDir(java.lang.String agentID)
Returns the SIFWorks ADK working directory for the given agent. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int NO_EVENT
public static final int NO_SYNC
Constructor Detail |
---|
public SIFCommonProperties(java.lang.String propertyFileName)
propertyFileName
- File Name without the extension '.properties'.public SIFCommonProperties()
Method Detail |
---|
public java.lang.String getApplicationID(java.lang.String agentID, java.lang.String defaultValue)
Each agent should be responsible for a particular application. More than one agent can be responsible for the same application where they each deal with different SIF Objects.
The property that this method attempts to access must have the following structure:
agent._agentID_.application=_applicationID_
agentID
- The agentID of the agent for which the application shall be returned.defaultValue
- The default value to be returned if no frequency can be found.
public int getEventFrequencyInSeconds(java.lang.String agentID, java.lang.String publisherID, int defaultValue)
The frequency should be interpreted as seconds.
The property that this method attempts to access must have the following structure:
agent._agentID_._publisherID_.event.frequency=_int_value_
or
agent._agentID_.event.frequency=_int_value_
in case of the global setting
agentID
- The agentID of the agent for which the frequency shall be returned.publisherID
- The publisherID of the publisher for which the frequency shall be returned.defaultValue
- The default value to be returned if no frequency can be found.
public int getEventFrequencyInSeconds(java.lang.String agentID, int defaultValue)
The frequency should be interpreted as seconds.
The property that this method attempts to access must have the following structure:
agent._agentID_.event.frequency=_int_value_
agentID
- The agentID of the agent for which the frequency shall be returned.defaultValue
- The default value to be returned if no frequency can be found.
public int getSyncFrequencyInSeconds(java.lang.String agentID, java.lang.String subscriberID, int defaultValue)
The frequency should be interpreted as seconds.
The property that this method attempts to access must have the following structure:
agent._agentID_._subscriber_.sync.frequency=_int_value_
or
agent._agentID_.sync.frequency=_int_value_
in case of the global setting
agentID
- The agentID of the agent for which the frequency shall be returned.subscriberID
- The subscriberID of the subscriber for which the frequency shall be returned.defaultValue
- The default value to be returned if no frequency can be found.
public int getSyncFrequencyInSeconds(java.lang.String agentID, int defaultValue)
The frequency should be interpreted as seconds.
The property that this method attempts to access must have the following structure:
agent._agentID_.sync.frequency=_int_value_
agentID
- The agentID of the agent for which the frequency shall be returned.defaultValue
- The default value to be returned if no frequency can be found.
public boolean getMultiThreaded(java.lang.String agentID, boolean defaultValue)
Valid values in the property file for this property is 'true' or 'false'.
The property that this method attempts to access must have the following structure:
agent._agentID_.multiTreaded=true|false
agentID
- The agentID of the agent for which the multi-threaded indicator shall be returned.defaultValue
- The default value to be returned if indicator can be found.
public java.lang.String getADKConfigDir(java.lang.String agentID)
The property that this method attempts to access must have the following structure:
agent._agentID_.cfg.location=_path_to_config_file
agentID
- The agentID of the agent for which the SIFWorks ADK configuration file directory shall
be returned.
public java.lang.String getADKConfigFileName(java.lang.String agentID)
The property that this method attempts to access must have the following structure:
agent._agentID_.cfg.name=_name_of_config_file
agentID
- The agentID of the agent for which the SIFWorks ADK configuration file name shall
be returned.
public java.lang.String getADKConfigPathAndFileName(java.lang.String agentID)
agentID
- The agentID of the agent for which the SIFWorks ADK configuration file name shall
be returned.
public java.lang.String getLogDir(java.lang.String agentID)
The property that this method attempts to access must have the following structure:
agent._agentID_.log.dir=_path_to_directory
agentID
- The agentID of the agent for which the logging directory shall be returned.
public java.lang.String getLogFileName(java.lang.String agentID)
The property that this method attempts to access must have the following structure:
agent._agentID_.log.name=_name_of_log_file
agentID
- The agentID of the agent for which the log file name shall be returned.
public java.lang.String getLogPathAndFileName(java.lang.String agentID)
agentID
- The agentID of the agent for which the logging configuration file name shall
be returned.
public java.lang.String getWorkDir(java.lang.String agentID)
The property that this method attempts to access must have the following structure:
agent._agentID_.workdir=_path_to_directory
agentID
- The agentID of the agent for which the working directory shall be returned.
public java.lang.String getDebugLevel(java.lang.String agentID)
The property that this method attempts to access must have the following structure:
agent._agentID_.debugLevel=_debug_level_
agentID
- The agentID of the agent for which the debug level shall be returned.
public java.lang.String getSubscriberBasePackageName(java.lang.String agentID)
The property that this method attempts to access must have the following structure:
agent._agentID_.subscriber.basePackageName=_fully_quaified_package_name_
agentID
- The agentID of the agent for which the package name shall be returned.
public java.lang.String getPublisherBasePackageName(java.lang.String agentID)
The property that this method attempts to access must have the following structure:
agent._agentID_.publisher.basePackageName=_fully_quaified_package_name_
agentID
- The agentID of the agent for which the package name shall be returned.
public java.util.List<java.lang.String> getPublishers(java.lang.String agentID)
The property that this method attempts to access must have the following structure:
agent._agentID_.publishers=_comma_separated_list_
agentID
- The agentID of the agent for which the publisher list shall be returned.
public java.util.List<java.lang.String> getSubscribers(java.lang.String agentID)
The property that this method attempts to access must have the following structure:
agent._agentID_.subscribers=_comma_separated_list_
agentID
- The agentID of the agent for which the subscriber list shall be returned.
public boolean getTestMode(java.lang.String agentID)
Valid values in the property file for this property is 'true' or 'false'.
The property that this method attempts to access must have the following structure:
agent._agentID_.testMode=true|false
agentID
- The agentID of the agent for which the test mode indicator shall be returned.
public java.lang.String getTestDir(java.lang.String agentID)
The property that this method attempts to access must have the following structure:
agent._agentID_.test.data.directory=_path_to_directory_
agentID
- The agentID of the agent for which the working directory shall be returned.
public java.lang.String getMappingName(java.lang.String agentID)
The property that this method attempts to access must have the following structure:
agent._agentID_.mapping.name=_name_
agentID
- The agentID of the agent for which the mapping name shall be returned.
public int getStartupDelay(int defalutValue)
The property that this method attempts to access must have the following structure:
agent.thread.startup.delay=_delay_in_seconds_
public int getNumConsumerThreads(java.lang.String agentID, java.lang.String subscriberID)
The property that this method attempts to access must have the following structure:
agent._agentID_._subscriber_.consumer.numThreads=_int_value_
or
agent._agentID_.consumer.numThreads=_int_value_
in case of the global setting
agentID
- The agentID of the agent for which the number of threads shall be returned.subscriberID
- The subscriberID of the subscriber for which the number of threads shall be returned.
public int getNumConsumerThreads(java.lang.String agentID)
The property that this method attempts to access must have the following structure:
agent._agentID_.consumer.numThreads=_int_value_
agentID
- The agentID of the agent for which the frequency shall be returned.
public java.util.Properties getProperties()
public int getEventBatchSize()
public java.lang.String getCustonObjBasePackageName(java.lang.String agentID)
The property that this method attempts to access must have the following structure:
agent._agentID_.customObjects.basePackageName=_fully_quaified_package_name_
agentID
- The agentID of the agent for which the package name shall be returned.
public java.util.List<java.lang.String> getCustomObjects(java.lang.String agentID)
The property that this method attempts to access must have the following structure:
agent._agentID_.customObjects=_comma_separated_list_
agentID
- The agentID of the agent for which the publisher list shall be returned.
public java.lang.Integer getPropertyAsInt(java.lang.String propertyName)
public int getPropertyAsInt(java.lang.String propertyName, int defaultValue)
public java.lang.Boolean getPropertyAsBool(java.lang.String propertyName)
public boolean getPropertyAsBool(java.lang.String propertyName, boolean defaultValue)
public java.lang.String getPropertyAsString(java.lang.String propertyName, java.lang.String defaultValue)
public java.util.List<java.lang.String> getFromCommaSeparated(java.lang.String propertyName)
public java.lang.String getPathAndFileName(java.lang.String path, java.lang.String name)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |