|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.spy.SpyObject
net.spy.net.SNPP
public class SNPP
SNPP client.
| Field Summary | |
|---|---|
static int |
ADMIN_FAILURE
Response code indicating a command failed (invalid pager ID, illegal parameter, etc...). |
static int |
COMMAND_NOT_IMPLEMENTED
Response code indicating that a command was issued that was not implemented. |
static int |
DATA_OK
Response code indicating DATA command was accepted and input should begin. |
static int |
DUPLICATE_COMMAND_ENTRY
Response code indicating a command was implemented in duplicate. |
static int |
FATAL_ERROR
Response code indicating a fatal error which will be followed by a terminated connection. |
static int |
MAX_ENTRIES_EXCEEDED
Response code indicating too many of something was entered (i.e. |
static int |
MSG_AWAITING_ACK
Response code indicating a message was delivered and is awaiting a reply ACK. |
static int |
MSG_AWAITING_REPLY
Response code indicating a message was delivered and is awaiting a reply. |
static int |
MSG_DELIVERED
Response code indicating a message has been delivered. |
static int |
MSG_QUEUED
Response code indicating a message was queued for delivery. |
static int |
MTYPE_DATA_SUCCESS
Message type indicating DATA was accepted and server is ready for input. |
static int |
MTYPE_PERM_FAILURE
Message type indicating a permanent failure. |
static int |
MTYPE_SUCCESS
Message type indicating success. |
static int |
MTYPE_SUCCESS_2WAY
Message type indicating a successful two-way transaction. |
static int |
MTYPE_SUCCESS_QUEUED
Successful queued transaction. |
static int |
MTYPE_TEMP_FAILURE
Message type indicating a temporary failure. |
static int |
MTYPE_UNSUCCESSFUL_2WAY
Message type indicating an unsuccesful two-way specific transaction. |
static int |
MULTILINE_HELP
Response code indicating a line of multiline help. |
static int |
OK
Response code inicating a successful transaction. |
static int |
QUIT_ACK
Response code to acknowldege a quit command. |
static int |
RESPONSE
Response code indicating a response to a message is available. |
static int |
SINGLELINE_HELP
Response code indicating single line help. |
static int |
SNPP_PORT
SNPP default port. |
static int |
SYSTEM_FAILURE
Response code indicating a command failed (system problem). |
| Constructor Summary | |
|---|---|
SNPP(java.lang.String host,
int port)
Get a new SNPP object connected to host:port |
|
SNPP(java.lang.String host,
int port,
int timeout)
Get a new SNPP object connected to host:port |
|
| Method Summary | |
|---|---|
void |
addResponse(java.lang.String response)
adds a response to the SNPP message. |
void |
close()
Close the connection to the SNPP server. |
void |
cmd(java.lang.String command)
Send an SNPP command. |
void |
data(java.lang.String msg)
sets the message to send, keeps newlines and all that |
protected void |
finalize()
|
java.lang.String |
getCurrentline()
Current full line received from the SNPP server. |
java.lang.String |
getCurrentmessage()
Current message received from the SNPP server. |
int |
getCurrentStatus()
Current status received from SNPP server. |
int |
getCurrentStatusType()
Current status type received from SNPP server. |
java.lang.String |
getResponse()
Check for a response from a 2way message. |
java.lang.String |
getResponse(java.lang.String tag)
Check for a response from a 2way message. |
java.lang.String |
getTag()
gets the message tag on a 2way page |
void |
message(java.lang.String msg)
sets the message to send |
void |
pagerID(java.lang.String id)
sets the pager ID |
void |
send()
send is handled separately in case it's a two-way transaction. |
void |
sendpage(java.lang.String id,
java.lang.String msg)
Send a simple page. |
void |
twoWay()
Put this into 2way mode. |
| Methods inherited from class net.spy.SpyObject |
|---|
getLogger |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int SNPP_PORT
public static final int MULTILINE_HELP
public static final int SINGLELINE_HELP
public static final int QUIT_ACK
public static final int OK
public static final int FATAL_ERROR
public static final int COMMAND_NOT_IMPLEMENTED
public static final int DUPLICATE_COMMAND_ENTRY
public static final int ADMIN_FAILURE
public static final int SYSTEM_FAILURE
public static final int MAX_ENTRIES_EXCEEDED
public static final int DATA_OK
public static final int MSG_AWAITING_ACK
public static final int MSG_AWAITING_REPLY
public static final int MSG_DELIVERED
public static final int RESPONSE
public static final int MSG_QUEUED
public static final int MTYPE_SUCCESS
public static final int MTYPE_DATA_SUCCESS
public static final int MTYPE_PERM_FAILURE
public static final int MTYPE_TEMP_FAILURE
public static final int MTYPE_UNSUCCESSFUL_2WAY
public static final int MTYPE_SUCCESS_2WAY
public static final int MTYPE_SUCCESS_QUEUED
| Constructor Detail |
|---|
public SNPP(java.lang.String host,
int port,
int timeout)
throws java.io.IOException,
java.net.UnknownHostException
host - SNPP host to connect toport - SNPP port numbertimeout - SO_TIMEOUT in milliseconds
java.io.IOException - Thrown if the various input and output
streams cannot be established.
java.net.UnknownHostException - Thrown if the SNPP server hostname
cannot be resolved.
public SNPP(java.lang.String host,
int port)
throws java.io.IOException,
java.net.UnknownHostException
host - SNPP host to connect toport - SNPP port number
java.io.IOException - Thrown if the various input and output
streams cannot be established.
java.net.UnknownHostException - Thrown if the SNPP server hostname
cannot be resolved.| Method Detail |
|---|
public java.lang.String getCurrentline()
public java.lang.String getCurrentmessage()
public int getCurrentStatus()
public int getCurrentStatusType()
public void twoWay()
throws java.lang.Exception
java.lang.Exception - when the 2way command fails
public void pagerID(java.lang.String id)
throws java.lang.Exception
id - snpp pager id
java.lang.Exception - when the page command fails
public void message(java.lang.String msg)
throws java.lang.Exception
msg - snpp message
java.lang.Exception - when the command fails
public void data(java.lang.String msg)
throws java.lang.Exception
msg - snpp message
java.lang.Exception - when the command fails, possibly because DATA
is not supportedpublic java.lang.String getTag()
public void sendpage(java.lang.String id,
java.lang.String msg)
throws java.lang.Exception
id - SNPP recipient ID.msg - msg to send.
java.lang.Exception - Thrown if any of the commands required to send
the page threw an exception.
public void send()
throws java.lang.Exception
java.lang.Exception - Thrown if the send command fails.
public java.lang.String getResponse(java.lang.String tag)
throws java.lang.Exception
tag - the message tag to look up.
java.lang.Exception - when the msta command fails, or we're not doing
2way.
public java.lang.String getResponse()
throws java.lang.Exception
java.lang.Exception - when the msta command fails, or we're not doing
2way.
public void addResponse(java.lang.String response)
throws java.lang.Exception
response - the canned response to add
java.lang.Exception - when we're not in a 2way transaction, or the
command fails.
public void cmd(java.lang.String command)
throws java.lang.Exception
command - command to send. It's sent literally to the SNPP
server.
java.lang.Exception - Thrown if the command does not return an ``OK''
status from the SNPP server.public void close()
protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||