|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnet.spy.net.SNPP
SNPP client.
| Field Summary | |
String |
currentline
Current full line received from the SNPP server. |
String |
currentmessage
Current message received from the SNPP server. |
int |
currentstatus
Current status received from SNPP server. |
boolean |
debug
Debug mode on/off. |
| Constructor Summary | |
SNPP(String host,
int port)
Get a new SNPP object connected to host:port |
|
SNPP(String host,
int port,
int timeout)
Get a new SNPP object connected to host:port |
|
| Method Summary | |
void |
addResponse(String response)
adds a response to the SNPP message. |
void |
close()
Close the connection to the SNPP server. |
void |
cmd(String command)
Send an SNPP command. |
void |
data(String msg)
sets the message to send, keeps newlines and all that |
protected void |
finalize()
|
String |
getResponse()
Check for a response from a 2way message. |
String |
getResponse(String tag)
Check for a response from a 2way message. |
String |
getTag()
gets the message tag on a 2way page |
static void |
main(String[] args)
Test page routine, send pages from the commandline. |
void |
message(String msg)
sets the message to send |
void |
pagerID(String id)
sets the pager ID |
void |
send()
send is handled separately in case it's a two-way transaction. |
void |
sendpage(String id,
String msg)
Send a simple page. |
void |
twoWay()
Put this into 2way mode. |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public String currentline
public String currentmessage
public int currentstatus
public boolean debug
| Constructor Detail |
public SNPP(String host,
int port,
int timeout)
throws IOException,
UnknownHostException
host - SNPP host to connect toport - SNPP port numbertimeout - SO_TIMEOUT in milliseconds
IOException - Thrown if the various input and output
streams cannot be established.
UnknownHostException - Thrown if the SNPP server hostname
cannot be resolved.
public SNPP(String host,
int port)
throws IOException,
UnknownHostException
host - SNPP host to connect toport - SNPP port number
IOException - Thrown if the various input and output
streams cannot be established.
UnknownHostException - Thrown if the SNPP server hostname
cannot be resolved.| Method Detail |
public void twoWay()
throws Exception
Exception - when the 2way command fails
public void pagerID(String id)
throws Exception
id - snpp pager id
Exception - when the page command fails
public void message(String msg)
throws Exception
msg - snpp message
Exception - when the command fails
public void data(String msg)
throws Exception
msg - snpp message
Exception - when the command fails, possibly because DATA
is not supportedpublic String getTag()
public void sendpage(String id,
String msg)
throws Exception
id - SNPP recipient ID.msg - msg to send.
Exception - Thrown if any of the commands required to send
the page threw an exception.
public void send()
throws Exception
Exception - Thrown if the send command fails.
public String getResponse(String tag)
throws Exception
Exception - when the msta command fails, or we're not doing
2way.
public String getResponse()
throws Exception
Exception - when the msta command fails, or we're not doing
2way.
public void addResponse(String response)
throws Exception
response - the canned response to add
Exception - when we're not in a 2way transaction, or the
command fails.
public void cmd(String command)
throws Exception
command - command to send. It's sent literally to the SNPP
server.
Exception - Thrown if the command does not return an ``OK''
status from the SNPP server.public void close()
protected void finalize()
throws Throwable
Throwable
public static void main(String[] args)
throws Exception
Usage:
SNPP hostname port username password
Exception
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||