|
![]() |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ipworks.Snpp
The SNPP control is used to send pages through the internet using the SNNP protocol.
It is a client implementation of Simple Network Paging Protocol Version 3 as specified in RFC 1861. Service extensions level 2 are supported intrinsically and the user can access all of level 3 extensions.
SNPP allows, unlike SMTP, for immediate notification of message delivery, gives absolute flexibility over the content sent to the recipient, allows to specifying multiple choice responses, etc.
To send a message the ServerName
, recipient's PagerId
and Message
properties should be filled out (at a minimum) and calling the Send
method
or setting the Action
delivers the message.
The server's response is given in PITrail
events and by the LastReply
property. Customized commands
may be sent using the Command
property.
Optional properties include: CallerId
, ServerPort
and LocalHost
Field Summary | |
static int |
fwNone
|
static int |
fwSOCKS4
|
static int |
fwSOCKS5
|
static int |
fwTunnel
|
static int |
snppConnect
|
static int |
snppDisconnect
|
static int |
snppIdle
|
static int |
snppReset
|
static int |
snppSend
|
Constructor Summary | |
Snpp()
|
Method Summary | |
void |
addSnppEventListener(SnppEventListener l)
|
void |
connect()
Connect to an SNPP serer. |
void |
disconnect()
Disconnect from an SNPP gateway. |
void |
fireError(int errorCode,
java.lang.String description)
Information about errors during data delivery. |
void |
firePITrail(int direction,
java.lang.String message)
Traces the commands sent to the server, and the respective replies. |
int |
getAction()
An action code for the component. |
java.lang.String |
getCallerId()
The id of the caller. |
byte[] |
getFirewallData()
Used to send other data to firewall. |
java.lang.String |
getFirewallHost()
Name or IP address of firewall (optional). |
java.lang.String |
getFirewallPassword()
A password if authentication is to be used connecting through the firewall. |
int |
getFirewallPort()
Port of the firewall to connect to. |
int |
getFirewallType()
Determines the type of firewall to connect through. |
java.lang.String |
getFirewallUser()
A user name if authentication is to be used connecting through a firewall. |
java.lang.String |
getLastReply()
The last reply from the server. |
java.lang.String |
getLocalHost()
The name of the local host or user-assigned IP interface through which connections are initiated or accepted. |
java.lang.String |
getMessage()
The message being sent (alphanumeric). |
java.lang.String |
getPagerId()
The id number of the pager sending a Message to. |
java.lang.String |
getServerName()
The name or address of the SNPP server. |
int |
getServerPort()
The server port for SNPP (default 444). |
int |
getTimeout()
A timeout for the component. |
boolean |
isConnected()
Shows whether the component is connected. |
void |
removeSnppEventListener(SnppEventListener l)
|
void |
reset()
Resets the server state created during the connection. |
void |
send()
Send the current message. |
void |
setAction(int action)
An action code for the component. |
void |
setCallerId(java.lang.String callerId)
The id of the caller. |
void |
setCommand(java.lang.String command)
Can be used to send additional commands directly to the SNPP server. |
void |
setFirewallData(byte[] firewallData)
Used to send other data to firewall. |
void |
setFirewallHost(java.lang.String firewallHost)
Name or IP address of firewall (optional). |
void |
setFirewallPassword(java.lang.String firewallPassword)
A password if authentication is to be used connecting through the firewall. |
void |
setFirewallPort(int firewallPort)
Port of the firewall to connect to. |
void |
setFirewallType(int firewallType)
Determines the type of firewall to connect through. |
void |
setFirewallUser(java.lang.String firewallUser)
A user name if authentication is to be used connecting through a firewall. |
void |
setLocalHost(java.lang.String localHost)
The name of the local host or user-assigned IP interface through which connections are initiated or accepted. |
void |
setMessage(java.lang.String message)
The message being sent (alphanumeric). |
void |
setPagerId(java.lang.String pagerId)
The id number of the pager sending a Message to. |
void |
setServerName(java.lang.String serverName)
The name or address of the SNPP server. |
void |
setServerPort(int serverPort)
The server port for SNPP (default 444). |
void |
setTimeout(int timeout)
A timeout for the component. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int snppIdle
public static final int snppConnect
public static final int snppDisconnect
public static final int snppSend
public static final int snppReset
public static final int fwNone
public static final int fwTunnel
public static final int fwSOCKS4
public static final int fwSOCKS5
Constructor Detail |
public Snpp()
Method Detail |
public int getAction()
Action
property to a valid action code makes
the control perform the associated action. If the action completes
successfully, execution continues normally, and Action
is
reset to 0 (Idle). If an error happens, then
an IPWorksException exception is raised.
The following are the possible values for the Action
property
and the corresponding descriptions:
public void setAction(int action) throws IPWorksException
Action
property to a valid action code makes
the control perform the associated action. If the action completes
successfully, execution continues normally, and Action
is
reset to 0 (Idle). If an error happens, then
an IPWorksException exception is raised.
The following are the possible values for the Action
property
and the corresponding descriptions:
public java.lang.String getCallerId()
public void setCallerId(java.lang.String callerId) throws IPWorksException
public void setCommand(java.lang.String command) throws IPWorksException
LastReply
property and/or trap the PITrail
events
comming from the server to get the response.
public boolean isConnected()
public byte[] getFirewallData()
public void setFirewallData(byte[] firewallData) throws IPWorksException
public java.lang.String getFirewallHost()
FirewallHost
is given, requested connections will be
authenticated through the specified firewall when connecting.
If the FirewallHost
property is set to a Domain Name, a DNS request
is initiated and upon successful termination of the request, the FirewallHost
property is set to the corresponding address. If the
search is not successful, an error is returned.
public void setFirewallHost(java.lang.String firewallHost) throws IPWorksException
FirewallHost
is given, requested connections will be
authenticated through the specified firewall when connecting.
If the FirewallHost
property is set to a Domain Name, a DNS request
is initiated and upon successful termination of the request, the FirewallHost
property is set to the corresponding address. If the
search is not successful, an error is returned.
public java.lang.String getFirewallPassword()
FirewallHost
is specified, the FirewallUser
and FirewallPassword
properties are used to connect and authenticate
to the given firewall. If the authentication fails, a trappable error is fired.
public void setFirewallPassword(java.lang.String firewallPassword) throws IPWorksException
FirewallHost
is specified, the FirewallUser
and FirewallPassword
properties are used to connect and authenticate
to the given firewall. If the authentication fails, a trappable error is fired.
public int getFirewallPort()
FirewallHost
. See the
description of the FirewallHost
property for
details.
Note that the FirewallPort
is set automatically
when FirewallType
is set to a valid value. See the
description of the FirewallType
property for
details.
public void setFirewallPort(int firewallPort) throws IPWorksException
FirewallHost
. See the
description of the FirewallHost
property for
details.
Note that the FirewallPort
is set automatically
when FirewallType
is set to a valid value. See the
description of the FirewallType
property for
details.
public int getFirewallType()
FirewallPort
is set to 80.
FirewallPort
is set to 1080.
FirewallPort
is set to 1080.
public void setFirewallType(int firewallType) throws IPWorksException
FirewallPort
is set to 80.
FirewallPort
is set to 1080.
FirewallPort
is set to 1080.
public java.lang.String getFirewallUser()
FirewallHost
is specified, the FirewallUser
and FirewallPassword
properties are used to connect and authenticate
to the given firewall. If the authentication fails, a trappable error is fired.
public void setFirewallUser(java.lang.String firewallUser) throws IPWorksException
FirewallHost
is specified, the FirewallUser
and FirewallPassword
properties are used to connect and authenticate
to the given firewall. If the authentication fails, a trappable error is fired.
public java.lang.String getLastReply()
PITrail
event.
public java.lang.String getLocalHost()
LocalHost
property contains the name of the local host
as obtained by the gethostname() Winsock call, or if the
user has assigned an IP address, the value of that address.
In multihomed hosts (machines with more than one IP interface) setting LocalHost to the value of an interface will make the control initiate connections (or accept in the case of server controls) only through that interface.
If the control is connected, the LocalHost
property shows
the IP address of the interface through which the connection
is made in internet dotted format (aaa.bbb.ccc.ddd). In most
cases, this is the address of the local host, except for multihomed
hosts (machines with more than one IP interface).
NOTE: LocalHost
is not persistent. You must always set it in
code, and never in the property window.
public void setLocalHost(java.lang.String localHost) throws IPWorksException
LocalHost
property contains the name of the local host
as obtained by the gethostname() Winsock call, or if the
user has assigned an IP address, the value of that address.
In multihomed hosts (machines with more than one IP interface) setting LocalHost to the value of an interface will make the control initiate connections (or accept in the case of server controls) only through that interface.
If the control is connected, the LocalHost
property shows
the IP address of the interface through which the connection
is made in internet dotted format (aaa.bbb.ccc.ddd). In most
cases, this is the address of the local host, except for multihomed
hosts (machines with more than one IP interface).
NOTE: LocalHost
is not persistent. You must always set it in
code, and never in the property window.
public java.lang.String getMessage()
public void setMessage(java.lang.String message) throws IPWorksException
public java.lang.String getPagerId()
PagerId
depending upon server requirements.
public void setPagerId(java.lang.String pagerId) throws IPWorksException
PagerId
depending upon server requirements.
public java.lang.String getServerName()
ServerName
property specifies the IP address (IP number in
dotted internet format) or Domain Name of the SNPP server.
It is set before a connection is attempted and cannot be changed
once a connection is in progress.
If the ServerName
property is set to a Domain Name, a DNS request
is initiated and upon successful termination of the request, the ServerName
property is set to the corresponding address. If the
search is not successful, an error is returned.
public void setServerName(java.lang.String serverName) throws IPWorksException
ServerName
property specifies the IP address (IP number in
dotted internet format) or Domain Name of the SNPP server.
It is set before a connection is attempted and cannot be changed
once a connection is in progress.
If the ServerName
property is set to a Domain Name, a DNS request
is initiated and upon successful termination of the request, the ServerName
property is set to the corresponding address. If the
search is not successful, an error is returned.
public int getServerPort()
ServerPort
while
connected will fail with an error.
public void setServerPort(int serverPort) throws IPWorksException
ServerPort
while
connected will fail with an error.
public int getTimeout()
Timeout
property is set to 0 (default value) all actions
will run uninterrupted until succesful completion, or an error condition
is encountered.
If Timeout
is set to a positive value, and any action does not
complete within Timeout
seconds, the action is aborted, and a 'Timeout' error is fired..
The control will use DoEvents
to enter an efficient wait loop
during any potential waiting period, making sure that all system events
are processed immediately as they arrive. This ensures that the host
application does not "freeze" and always remains responsive.
public void setTimeout(int timeout) throws IPWorksException
Timeout
property is set to 0 (default value) all actions
will run uninterrupted until succesful completion, or an error condition
is encountered.
If Timeout
is set to a positive value, and any action does not
complete within Timeout
seconds, the action is aborted, and a 'Timeout' error is fired..
The control will use DoEvents
to enter an efficient wait loop
during any potential waiting period, making sure that all system events
are processed immediately as they arrive. This ensures that the host
application does not "freeze" and always remains responsive.
public void fireError(int errorCode, java.lang.String description)
SnppErrorEvent
public void firePITrail(int direction, java.lang.String message)
SnppPITrailEvent
public void connect() throws IPWorksException
Calling this method is equivalent to setting the Action
property
to snppConnect .
public void disconnect() throws IPWorksException
Calling this method is equivalent to setting the Action
property
to snppDisconnect .
public void reset() throws IPWorksException
Calling this method is equivalent to setting the Action
property
to snppReset .
public void send() throws IPWorksException
Calling this method is equivalent to setting the Action
property
to snppSend .
public void addSnppEventListener(SnppEventListener l) throws java.util.TooManyListenersException
public void removeSnppEventListener(SnppEventListener l)
|
![]() |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |