public class MonitorAgent extends java.lang.Object implements Service, java.lang.Runnable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
FILE_SEPARATOR |
protected static java.lang.String[] |
reportStatusText |
DEBUG_CTRL, DEBUG_DIFF, DEBUG_INIT, DEBUG_LOAD, DEBUG_LOOP, DEBUG_NONE, DEBUG_REPT, DEBUG_TRAN, DEBUG_UPDT, SERVICE_CLOSED, SERVICE_DISABLED, SERVICE_PAUSE, SERVICE_READY, SERVICE_RETRYING, SERVICE_RUNNING, SERVICE_STANDBY, SERVICE_STOPPED, statusText
Constructor and Description |
---|
MonitorAgent(java.util.Map props) |
MonitorAgent(java.util.Map props,
int debugForReload,
java.lang.String configFile) |
Modifier and Type | Method and Description |
---|---|
void |
close()
closes all opened resources
|
int |
doRequest(Event req,
int timeout)
It processes the request according to the preconfigured rulesets.
|
int |
getDebugMode()
returns the debug mode of the service
|
java.lang.String |
getName()
returns the name of the service
|
java.lang.String |
getOperation()
returns the string of the operation
|
static java.util.Map |
getPrivateReport()
returns the report map stored in the privateReport
|
static java.util.Map<java.lang.String,java.lang.Object> |
getReport(java.lang.String rptName)
returns a copy of the shared report
|
static java.lang.String[] |
getReportNames()
returns all the names of the shared reports
|
int |
getStatus()
returns the status of the service
|
static void |
initReport(java.lang.String rptName,
long currentTime,
int status,
int skippingStatus)
initializes the static shared report without keyList
|
static void |
initReport(java.lang.String rptName,
java.lang.String[] keyList,
java.util.Map latest,
int reportMode)
initializes the static shared report with keyList
|
boolean |
keepRunning(XQueue xq) |
static int |
loadIncludedProperties(java.util.List group,
java.lang.String cfgDir,
int show,
java.util.Map props,
java.util.Map policy)
It checks the loaded primay include on its ClassName for each string
item of the given group.
|
static int |
loadListProperties(java.util.List list,
java.lang.String configDir,
int show,
java.util.Map props)
It loads the property map from configDir for each string item of the
given list and adds the property map to the given props.
|
static void |
main(java.lang.String[] args)
The configuration parameters are stored in the property file,
Agent.json, that lists all monitorGroups, etc.
|
static java.lang.String |
query(MessagePersister pstr,
javax.jms.Message msg)
sends a query message via the given persister and waits for response.
|
void |
run() |
void |
setDebugMode(int debug)
sets the debug mode of the service
|
void |
start()
starts the main workflow and controls all groups of jobs and msg flows.
|
public static final java.lang.String FILE_SEPARATOR
protected static final java.lang.String[] reportStatusText
public MonitorAgent(java.util.Map props)
public MonitorAgent(java.util.Map props, int debugForReload, java.lang.String configFile)
public void run()
run
in interface java.lang.Runnable
public static void initReport(java.lang.String rptName, long currentTime, int status, int skippingStatus)
public static void initReport(java.lang.String rptName, java.lang.String[] keyList, java.util.Map latest, int reportMode)
public static java.util.Map<java.lang.String,java.lang.Object> getReport(java.lang.String rptName)
public static java.lang.String[] getReportNames()
public static java.util.Map getPrivateReport()
public void start()
public void close()
Service
public int doRequest(Event req, int timeout)
public boolean keepRunning(XQueue xq)
public java.lang.String getName()
Service
public java.lang.String getOperation()
Service
getOperation
in interface Service
public int getStatus()
Service
public int getDebugMode()
Service
getDebugMode
in interface Service
public void setDebugMode(int debug)
Service
setDebugMode
in interface Service
public static int loadListProperties(java.util.List list, java.lang.String configDir, int show, java.util.Map props)
public static int loadIncludedProperties(java.util.List group, java.lang.String cfgDir, int show, java.util.Map props, java.util.Map policy)
public static java.lang.String query(MessagePersister pstr, javax.jms.Message msg)
public static void main(java.lang.String[] args)
args
- the command line arguments