|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--zyneo.sms.gateway.adaptor.xml.tcp.client.SendConnection
A connection used for sending SMS-messages by using XML/tcp-protocol. The send-connection can run in either of two modes, transient connection and continous conection. Transient connection means that for each call to send a new connection is established, and it is closed afterwards. Continues connection means that a connection is kept and used for all messages. Continues mode is entered when the client explicity calls the connect() method.
Field Summary | |
static int |
DEFAULT_CONNECTION_TIMEOUT
|
static int |
DEFAULT_FRAMEDELAY
|
protected ClientConnection |
m_cc
|
protected int |
m_connection_timeout
|
protected int |
m_framedelay
|
protected java.lang.String |
m_host
|
protected Category |
m_log
|
protected int |
m_port
|
Constructor Summary | |
SendConnection(java.lang.String host,
int port)
Constructor |
|
SendConnection(java.lang.String host,
int port,
int connection_timeout,
int frame_delay)
Constructor |
Method Summary | |
protected boolean |
connect_internal()
Connects to gateway |
void |
connect()
Establishes a connection to gateway. |
protected void |
disconnect_internal()
Disconnect from gateway |
void |
disconnect()
Disconnect from Gateway. |
java.lang.String |
send(Sms s)
Sends a SMS-message to Gateway |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int DEFAULT_CONNECTION_TIMEOUT
public static final int DEFAULT_FRAMEDELAY
protected java.lang.String m_host
protected int m_port
protected int m_connection_timeout
protected int m_framedelay
protected ClientConnection m_cc
protected Category m_log
Constructor Detail |
public SendConnection(java.lang.String host, int port)
host
- The hostname for server running Gatewayport
- The port the XML/tcp Send Adaptor is listening onpublic SendConnection(java.lang.String host, int port, int connection_timeout, int frame_delay)
host
- The hostname for server running Gatewayport
- The port the XML/tcp Send Adaptor is listening onconnection_timeout
- Connection timeout (in milliseconds)Method Detail |
public void connect() throws java.io.IOException, java.net.UnknownHostException
IOException,UnknownHostException
java.io.IOException
java.net.UnknownHostException
public void disconnect() throws java.io.IOException
java.io.IOException
public java.lang.String send(Sms s) throws RequestException, java.io.IOException, java.net.UnknownHostException
s
- The message to send
RequestException,IOException,UnknownHostException
RequestException
java.io.IOException
java.net.UnknownHostException
protected boolean connect_internal() throws java.io.IOException, java.net.UnknownHostException
java.io.IOException
java.net.UnknownHostException
protected void disconnect_internal() throws java.io.IOException
java.io.IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |