public class IMConfig extends Object implements Comparable
Constructor and Description |
---|
IMConfig()
constructor
|
IMConfig(Object owner,
String sHost,
int iPort,
String sUser,
String sPassword,
String sResource,
String sNickname)
constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
acceptMsg(String sFrom)
determine whether to accept message from a particular user,
mainly used to down Jabber server broadcast messages
e.g.
|
int |
compareTo(Object aObj)
compare 2 objects
|
void |
connectionClose()
close jabber connection
|
boolean |
connectionOpen()
open jabber connection, close existing session, if any
|
String |
getHost()
get host name
|
AgentConfig |
getMonitor()
get event monitoring criteria object
|
String |
getNickname()
get nickname
|
int |
getNumMsgIgnore()
no. of messages to ignore
|
String |
getPassword()
get user password
|
int |
getPort()
get session port no.
|
String |
getPresence()
get user presence
|
String |
getPresenceStatus()
get user presence status
|
String |
getResource()
get resource name
|
String |
getUserName()
get user name
|
boolean |
groupchatJoin(String chatRoomName)
join a chatroom
e.g. groupchatJoin("savage@conference.savage.nps.edu");
|
boolean |
groupchatLeave(String sRoom)
leave a chatroom
|
ArrayList |
groupchatParticipants(String sRoom)
get list of participants in chatroom
|
boolean |
groupchatSendMessage(String sRoom,
String sBody)
send message to a chatroom (no subject title)
|
boolean |
groupchatSendMessage(String sRoom,
String sBody,
String sXHTML)
send message to a chatroom
|
void |
loadFromXML(String sFilename,
String sTag)
load setting from XML file
|
boolean |
p2pchatOpen(String sJID)
open a peer-to-peer chat session with another user
|
boolean |
p2PchatSendFile(String sJID,
String sSubject,
String sBody,
ArrayList lstAP)
send message to a chatroom (no subject title)
|
boolean |
p2PchatSendFile(String sJID,
String sSubject,
String sBody,
String filename)
send message to a chatroom (no subject title) and no
|
boolean |
p2PchatSendFile(String sJID,
String sSubject,
String sBody,
String filename,
String[] arrURL)
send message to a chatroom (no subject title) and no
|
boolean |
p2PchatSendMessage(String sJID,
String sBody)
send message to a chatroom (no subject title)
|
boolean |
p2PchatSendMessage(String sJID,
String sSubject,
String sBody,
String sXHTML,
boolean flagXHTML)
send message to a chatroom
|
boolean |
processMessageBody(String sJID,
String sBody,
String sXHTML)
process incoming message body
check whether message body contains keywords.
|
boolean |
processMessageSubject(String sJID,
String sSubject,
String sXHTML)
process incoming message subject
check whether message body contains keywords.
|
void |
setHost(String value)
set host
|
void |
setMonitor(AgentConfig obj)
set event monitoring criteria
|
void |
setNickname(String value)
set nickname
|
void |
setNumMsgIgnore(int num)
set no. of messages to ignore
|
void |
setPassword(String value)
set password
|
void |
setPort(int value)
set session port no.
|
boolean |
setPresence(String value)
set presence
|
void |
setPresenceStatus(String value)
set presence status e.g.
|
void |
setResource(String value)
set resource
|
void |
setUserName(String value)
set user name
|
String |
toString()
display contents of object
|
void |
writeErr(String aStr)
write a error messgae to console
|
void |
writeLn(String aStr)
write a line to console
|
public AgentConfig getMonitor()
public void setMonitor(AgentConfig obj)
obj
- AgentConfig objectpublic boolean acceptMsg(String sFrom)
sFrom
- a JIDpublic void connectionClose()
public boolean connectionOpen()
public boolean groupchatJoin(String chatRoomName)
chatRoomName
- chat room namepublic boolean groupchatLeave(String sRoom)
sRoom
- chatroompublic ArrayList groupchatParticipants(String sRoom)
sRoom
- chatroompublic boolean groupchatSendMessage(String sRoom, String sBody, String sXHTML)
sRoom
- chatroom namesBody
- message to be set outsXHTML
- XHTML string data to be sent outpublic boolean groupchatSendMessage(String sRoom, String sBody)
sRoom
- chatroom namesBody
- body of message to be set outpublic boolean p2pchatOpen(String sJID)
sJID
- a valid JID e.g. auvw@savage.nps.edupublic boolean p2PchatSendFile(String sJID, String sSubject, String sBody, String filename)
sJID
- chatroom namesSubject
- message subjectsBody
- body of message to be set outfilename
- file attachment to be sentpublic boolean p2PchatSendFile(String sJID, String sSubject, String sBody, String filename, String[] arrURL)
sJID
- chatroom namesSubject
- message subjectsBody
- body of message to be set outfilename
- file attachment to be sentarrURL
- list of URLs associated with filepublic boolean p2PchatSendFile(String sJID, String sSubject, String sBody, ArrayList lstAP)
sJID
- chatroom namesSubject
- message subjectsBody
- body of message to be set outlstAP
- list of AgentPayload object to sendpublic boolean p2PchatSendMessage(String sJID, String sBody)
sJID
- chatroom namesBody
- body of message to be set outpublic boolean p2PchatSendMessage(String sJID, String sSubject, String sBody, String sXHTML, boolean flagXHTML)
sJID
- chatroom namesSubject
- subject of messagesBody
- body of message to be set outsXHTML
- XHTML string data to be sent outflagXHTML
- is it XHTML message?public boolean processMessageBody(String sJID, String sBody, String sXHTML)
sJID
- Jabber user ID (not used)sBody
- message bodysXHTML
- determine whether it has XHTML datapublic boolean processMessageSubject(String sJID, String sSubject, String sXHTML)
sJID
- Jabber user ID (not used)sSubject
- message subjectsXHTML
- determine whether it has XHTML datapublic void loadFromXML(String sFilename, String sTag)
sFilename
- XML filesTag
- which tag to read frompublic void setPort(int value)
value
- numeric value to be setpublic int getPort()
public void setHost(String value)
value
- string to be setpublic String getHost()
public void setNumMsgIgnore(int num)
num
- numeric valuepublic int getNumMsgIgnore()
public void setNickname(String value)
value
- string to be setpublic String getNickname()
public void setPassword(String value)
value
- string to be setpublic String getPassword()
public boolean setPresence(String value)
value
- string to be set, valid values AVAILABLE, ERROR, SUBSCRIBE,
SUBSCRIBED, UNAVAILABLE, UNSUBSCRIBE, UNSUBSCRIBEDpublic String getPresence()
public void setPresenceStatus(String value)
value
- string to be setpublic String getPresenceStatus()
public void setResource(String value)
value
- string to be setpublic String getResource()
public void setUserName(String value)
value
- string to be setpublic String getUserName()
public int compareTo(Object aObj)
compareTo
in interface Comparable
aObj
- object to be compared withpublic String toString()
public void writeErr(String aStr)
aStr
- line to be written to consolepublic void writeLn(String aStr)
aStr
- line to be written to console