public class AgentConfig extends Observable
Modifier and Type | Field and Description |
---|---|
static String |
ATTR_DATETIMEEND |
static String |
ATTR_DATETIMESTART |
static String |
ATTR_DESC |
static String |
ATTR_ENABLED |
static String |
ATTR_EXPR |
static String |
ATTR_JID |
static String |
ATTR_KEYWORD_BODY |
static String |
ATTR_KEYWORD_SUBJECT |
static String |
ATTR_NAME |
static String |
ATTR_SRC |
static String |
ATTR_TYPE |
static String |
TAG_ALERT |
static String[] |
TAG_ALERT_CHILD |
static String |
TAG_MONITOR |
static String[] |
TAG_MONITOR_CHILD |
static String |
TAG_MONITORDEFAULT |
static String[] |
TAG_MONITORDEFAULT_CHILD |
static String[] |
TAG_REGEXP_CHILD |
static String |
TAG_WATCHEVENT |
static String |
TAG_XTCMONITOR
XML tags and attributes
|
Constructor and Description |
---|
AgentConfig(String sXMLFile)
constructor
|
Modifier and Type | Method and Description |
---|---|
Monitor |
createMonitor(Node aNode,
String[] sArr)
create a Monitor object
e.g.
|
boolean |
eventNotify(String sBody,
String sXHTML)
notify observers, e.g.
|
ArrayList<String> |
getJIDList()
get list of JIDs
|
ArrayList |
getKeywordBody(String sJID)
get list of keywords in message body based on JID
|
ArrayList |
getKeywordBodyDefault()
string value of default list of Message Body keyword
for display in edit boxes
|
ArrayList |
getKeywordSubject(String sJID)
get list of keywords in message subject based on JID
|
ArrayList |
getKeywordSubjectDefault()
string value of default list of Message Subject keyword
for display in edit boxes
|
boolean |
inKeywordBody(String sLine)
check whether Message Body keyword matches keyword list
No JID is provided
|
boolean |
inKeywordBody(String sJID,
String sLine)
check whether Message Body keyword matches keyword list
for a particular JID, if provided
|
boolean |
inKeywordSubject(String sLine)
check whether Message Subject keyword matches keyword list
No JID is provided
|
boolean |
inKeywordSubject(String sJID,
String sLine)
check whether Message Subject keyword matches keyword list
for a particular JID, if provided
|
boolean |
inKeywordSubjectBody(String sWord)
check whether Message Body keyword is in Default Monitor's list
|
boolean |
inKeywordSubjectDefault(String sWord)
check whether Message Subject keyword is in Default Monitor's list
|
WatchEvent |
inRegExp(String sLine)
check whether the line matches a regular expression
in all Monitors (include default)
|
void |
loadXML(String filename)
load mission script from a XML file
|
void |
sampleRegExp()
sample regular expression
|
boolean |
testNotify(String sBody,
String sXHTML)
testNotify() notify observers, e.g.
|
void |
testNotifyZZZ(String sLine) |
String |
toString()
get String contents of object
|
static void |
writeErr(String aStr)
write a error messgae to console
|
static void |
writeLn()
write a line to console
|
static void |
writeLn(boolean bStr)
write boolean value to console
|
static void |
writeLn(int iStr)
write numeric value to console
|
static void |
writeLn(String aStr)
write a line to console
|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
public static final String TAG_XTCMONITOR
public static final String TAG_MONITORDEFAULT
public static final String TAG_MONITOR
public static final String TAG_WATCHEVENT
public static final String ATTR_NAME
public static final String ATTR_EXPR
public static final String[] TAG_MONITORDEFAULT_CHILD
public static final String[] TAG_MONITOR_CHILD
public static final String TAG_ALERT
public static final String[] TAG_REGEXP_CHILD
public static final String ATTR_TYPE
public static final String ATTR_SRC
public static final String ATTR_ENABLED
public static final String[] TAG_ALERT_CHILD
public static final String ATTR_JID
public static final String ATTR_DESC
public static final String ATTR_DATETIMESTART
public static final String ATTR_DATETIMEEND
public static final String ATTR_KEYWORD_SUBJECT
public static final String ATTR_KEYWORD_BODY
public AgentConfig(String sXMLFile)
sXMLFile
- default XML filepublic Monitor createMonitor(Node aNode, String[] sArr)
aNode
- Monitor nodesArr
- list of attributes to retrievepublic boolean eventNotify(String sBody, String sXHTML)
sBody
- incoming message bodysXHTML
- XHTML datapublic ArrayList getKeywordBody(String sJID)
sJID
- Jabber user ID, set to "default" for default valuespublic ArrayList getKeywordBodyDefault()
public ArrayList getKeywordSubject(String sJID)
sJID
- Jabber user ID, set to "default" for default valuespublic ArrayList getKeywordSubjectDefault()
public boolean inKeywordBody(String sJID, String sLine)
sJID
- Jabber user IDsLine
- sentence to be checkedpublic boolean inKeywordBody(String sLine)
sLine
- sentence to be checkedpublic boolean inKeywordSubjectBody(String sWord)
sWord
- message subjectpublic boolean inKeywordSubject(String sJID, String sLine)
sJID
- Jabber user IDsLine
- message subjectpublic boolean inKeywordSubject(String sLine)
sLine
- message subjectpublic boolean inKeywordSubjectDefault(String sWord)
sWord
- message subjectpublic WatchEvent inRegExp(String sLine)
sLine
- source string to be matchedpublic void loadXML(String filename)
filename
- file to be loaded frompublic void sampleRegExp()
public boolean testNotify(String sBody, String sXHTML)
sBody
- incoming message bodysXHTML
- XHTML datapublic void testNotifyZZZ(String sLine)
public String toString()
public static void writeErr(String aStr)
aStr
- line to be written to consolepublic static void writeLn(String aStr)
aStr
- line to be written to consolepublic static void writeLn(boolean bStr)
bStr
- boolean value to be written to consolepublic static void writeLn(int iStr)
iStr
- numeric value to be written to consolepublic static void writeLn()