|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ie.ncl.msg.impl.SimpleConnection ie.ncl.sms.cimd.CimdConnection
public class CimdConnection
The CimdConnection class is an implementation of
the CIMD 2.0 Protocol used to connect to a
CIMD compliant Short Message Service Centre,
for the purposes of sending and receiving
text and binary short messages.
IMPORTANT: Unless you are performing some CIMD specific operation
it is best to use the ie.ncl.msg.Factory class
to create instances of the CimdConnection.
This allows you to dynamically create transport independent
software applications.
Note the CIMD protocol now supports the CC parameter.
The Factory properties used in the CIMD Connection configuration are:-
NAME | VALUE | DEFAULT |
class | The name of the implementing class - ie.ncl.sms.cimd.CimdConnection | mandatory |
id | Login user id (string) | mandatory |
pass | Login password (string) | mandatory |
host | Host name of the SMSC (string) | mandatory |
port | IP port number of the CIMD Server (number) | mandatory |
sendRequestDelivery | Send a request to deliver messages on connection (true or false) | optional - defaults to false |
ignoreReceipts | Ignore delivery receipts (true or false) | optional - defaults to false |
linkAliveIfAnyDataReceived | The link is alive if any data is received within the response timeout of sending a query link operation to the SMSC. If this is false, the query link response must be received within the timeout (true or false) | optional - defaults to true |
smscResponseTimeoutSeconds | The response timeout for which a response must be received from the SMSC upon sending a request (number of seconds). | optional - defaults to 60 seconds. |
unackedQueueSize | The maximum number of outstanding requests sent to the SMSC without have receive a response for any (number) | optional - defaults to one request |
reconnectOnDisconnect | Reconnect to the SMSC if the connection is dropped (true or false). | optional - defaults to true |
.reconnectRetryAttempts | The number of re-connection retry attempts to be performed if a connection is lost (number). | optional - defaults to 60 retries |
reconnectTimerSeconds | The number of seconds between re-connection attempts (number of seconds) | optional -defaults to 60 seconds |
queryLinkEverySeconds | Query the link every so often to ensure it is up and running (number of seconds) | optional - defaults to 30 seconds |
statusReportValueForRegisteredMessages | This is the value placed in the status report request CIMD field when a message is sent. | optional - defaults to 62 i.e. report for success or failure |
windowSize | This numerical value is the value placed in the Window Size login parameter. This has no behavioural effect in the software implementation of the CIMD protocol. | optional - defaults to window size parameter being sent |
pingOnlyWhenUnackedQueueSizeZero | If true, a query link will not be sent while there are unacknowledged messages. Some CIMD SMSCs "complain" if a ping is sent while there is a pending submit acknowledgment. | optional - defaults false |
sourceAddressParameter | Specifies the CIMD source address parameter which can be 23 for Numeric, 27 for Alphanumeric, or 0 in which case the CIMD layer will work it out automatically (if it detects any character not a digit or + then it will use ASCII/27) | optional - defaults to 0/automatic |
Factory
Field Summary |
---|
Fields inherited from interface ie.ncl.msg.Connection |
---|
CONNECTED, NOT_CONNECTED, NOT_USED, RECONNECTING |
Fields inherited from interface ie.ncl.sms.MessageAttributeNames |
---|
CC, DCS, EOT_GSM_ESCAPE_CHARACTER, PID, PRIORITY, RECEIPT, RECEIPT_BYTES, RECEIPT_STATUS, RECEIPT_TEXT, REGISTERED, REPLACE, REPLY_PATH, SCA, SCHEDULE, SUBMIT_ERROR, TIMESTAMP, UDH, UDHI, VALIDITY |
Constructor Summary | |
---|---|
CimdConnection()
|
Method Summary | |
---|---|
void |
acknowledge(Message m,
boolean positive)
Not implemented - acknowledgements are automatic. |
void |
close()
Close the CIMD connection. |
void |
connect()
Make a CIMD connection. |
int |
getFlowControlTimer()
The flow control timer is used to specify the duration between receiving a 'slow down' indication from the SMSC and starting to send messages again. |
boolean |
getIgnoreReceipts()
This is used to specify that delivery reports of messages are to be ignored. |
boolean |
getLinkAliveIfAnyDataReceived()
Get the Link Alive functionality. |
java.lang.String |
getPassword()
Get the Password required to connect and login to the CIMD server. |
int |
getQueryLinkTimer()
The query link timer specifies how often a link alive check is performed with the SMSC. |
boolean |
getReconnectOnDisconnect()
Reconnect if there is a disconnection. |
int |
getReconnectRetryAttempts()
This is used to specify the maximum number of reconnection retry attempts when a link has gone down or stops responding. |
long |
getReconnectTimer()
This is used to specify time duration between reconnection retry attempts when a link has gone down or stops responding. |
boolean |
getSendRequestDeliveryOnConnect()
Send a request delivery on connection which tells the SMSC to deliver messages. |
int |
getSmscResponseTimeout()
This is used to specify the maximum time that can elapse without receiving a response for a particular request. |
int |
getSourceAddressParameter()
Gets the CIMD source parameter type - see properties above |
int |
getStatusReportValueForRegisteredMessages()
|
int |
getUnackedQueueSize()
This is used to specify the maximum number of unacknowledged requests. |
java.lang.String |
getUserId()
Get the UserId required to connect and login to the CIMD server. |
int |
getWindowSize()
Gets the CIMD window size login parameter. |
void |
init(java.util.Properties ps)
Initialise the object with settings specified in the properties. |
boolean |
isAnotherPingAllowed()
|
boolean |
isPingOnlyWhenUnackedQueueSizeZero()
|
boolean |
isWindowSizeUsed()
Determines if the CIMD window size login parameter is used i.e. |
static void |
main(java.lang.String[] args)
Print version information. |
void |
receive(ReceiverListener listener)
Specify where received messages are sent. |
void |
send(Message message,
SenderListener listener)
Send a message asynchronously. |
void |
setFlowControlTimer(int i)
The flow control timer is used to specify the duration between receiving a 'slow down' indication from the SMSC and starting to send messages again. |
void |
setHostPort(java.lang.String host,
int port)
|
void |
setIgnoreReceipts(boolean b)
This is used to specify that delivery reports of messages are to be ignored. |
void |
setLinkAliveIfAnyDataReceived(boolean newVal)
Set the Link Alive functionality. |
void |
setPingOnlyWhenUnackedQueueSizeZero(boolean pingOnlyWhenUnackedQueueSizeZero)
|
void |
setQueryLinkTimer(int i)
The query link timer specifies how often a link alive check is performed with the SMSC. |
void |
setReceiverListener(ReceiverListener listener)
Specify where received messages are sent. |
void |
setReconnectOnDisconnect(boolean yesOrNo)
Reconnect if there is a disconnection. |
void |
setReconnectRetryAttempts(int numberOfTimes)
This is used to specify the maximum number of reconnection retry attempts when a link has gone down or stops responding. |
void |
setReconnectTimer(int usecs)
This is used to specify time duration between reconnection retry attempts when a link has gone down or stops responding. |
void |
setSendRequestDeliveryOnConnect(boolean yesOrNo)
Send a request delivery on connection which tells the SMSC to deliver messages. |
void |
setSmscResponseTimeout(int usec)
This is used to specify the maximum time that can elapse without receiving a response for a particular request. |
void |
setSourceAddressParameter(int sourceAddressParameter)
Sets the CIMD source parameter type - see properties above. |
void |
setUnackedQueueSize(int size)
This is used to specify the maximum number of unacknowledged requests. |
void |
setUser(java.lang.String userId,
java.lang.String password)
This sets the username and password required to login to the SMSC (or CIMD Server). |
void |
setWindowSize(int windowSize)
Sets the CIMD window size login parameter. |
void |
shutdown()
Shutdown the connection. |
Methods inherited from class ie.ncl.msg.impl.SimpleConnection |
---|
connected, getConnectionStatus, getErrorListener, getName, getTypeDefaults, init, mergeDefaultAttributes, putTypeDefaults, setErrorListener, setName |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface ie.ncl.msg.Connection |
---|
connected, getConnectionStatus, getTypeDefaults, init, putTypeDefaults, setErrorListener |
Constructor Detail |
---|
public CimdConnection()
Method Detail |
---|
public void setIgnoreReceipts(boolean b)
public boolean getIgnoreReceipts()
public boolean isPingOnlyWhenUnackedQueueSizeZero()
public void setPingOnlyWhenUnackedQueueSizeZero(boolean pingOnlyWhenUnackedQueueSizeZero)
public boolean isAnotherPingAllowed()
public int getWindowSize()
public void setWindowSize(int windowSize)
public boolean isWindowSizeUsed()
public void setSmscResponseTimeout(int usec)
setReconnectOnDisconnect(boolean)
public int getSmscResponseTimeout()
setReconnectOnDisconnect(boolean)
public boolean getReconnectOnDisconnect()
setReconnectRetryAttempts(int)
,
setReconnectTimer(int)
,
getReconnectRetryAttempts()
,
getReconnectTimer()
public void setReconnectOnDisconnect(boolean yesOrNo)
setReconnectRetryAttempts(int)
,
setReconnectTimer(int)
,
getReconnectRetryAttempts()
,
getReconnectTimer()
public int getStatusReportValueForRegisteredMessages()
public boolean getSendRequestDeliveryOnConnect()
setSendRequestDeliveryOnConnect(boolean)
public void setSendRequestDeliveryOnConnect(boolean yesOrNo)
getSendRequestDeliveryOnConnect()
public int getSourceAddressParameter()
public void setSourceAddressParameter(int sourceAddressParameter)
public void setReconnectRetryAttempts(int numberOfTimes)
setReconnectOnDisconnect(boolean)
,
setReconnectTimer(int)
,
getReconnectOnDisconnect()
,
getReconnectTimer()
public int getReconnectRetryAttempts()
setReconnectOnDisconnect(boolean)
,
setReconnectTimer(int)
,
getReconnectOnDisconnect()
,
getReconnectTimer()
public void setUnackedQueueSize(int size)
getUnackedQueueSize()
public int getUnackedQueueSize()
setUnackedQueueSize(int)
public void setReconnectTimer(int usecs)
setReconnectOnDisconnect(boolean)
,
setReconnectTimer(int)
,
getReconnectOnDisconnect()
,
getReconnectTimer()
public long getReconnectTimer()
setReconnectOnDisconnect(boolean)
,
setReconnectTimer(int)
,
getReconnectOnDisconnect()
,
getReconnectTimer()
public boolean getLinkAliveIfAnyDataReceived()
public void setLinkAliveIfAnyDataReceived(boolean newVal)
getLinkAliveIfAnyDataReceived()
public void receive(ReceiverListener listener) throws ConnectionException
receive
in interface Receiver
ConnectionException
Message
public void setReceiverListener(ReceiverListener listener) throws ConnectionException
setReceiverListener
in interface Receiver
ConnectionException
Message
public void acknowledge(Message m, boolean positive) throws ConnectionException, MessageException
acknowledge
in interface Receiver
ConnectionException
MessageException
public void setUser(java.lang.String userId, java.lang.String password)
getUserId()
,
getPassword()
,
connect()
public java.lang.String getUserId()
setUser(java.lang.String, java.lang.String)
public java.lang.String getPassword()
setUser(java.lang.String, java.lang.String)
public static void main(java.lang.String[] args)
public void setHostPort(java.lang.String host, int port)
public int getQueryLinkTimer()
getSmscResponseTimeout()
,
getReconnectOnDisconnect()
,
getLinkAliveIfAnyDataReceived()
public void setQueryLinkTimer(int i)
getSmscResponseTimeout()
,
getReconnectOnDisconnect()
,
getLinkAliveIfAnyDataReceived()
public int getFlowControlTimer()
setFlowControlTimer(int)
public void setFlowControlTimer(int i)
getFlowControlTimer()
public void shutdown()
Connection
shutdown
in interface Connection
public void connect() throws ConnectionException
connect
in interface Connection
ConnectionException
init(java.util.Properties)
public void init(java.util.Properties ps) throws ConnectionException
Connection
init
in interface Connection
ConnectionException
public void close()
close
in interface Connection
close
in class ie.ncl.msg.impl.SimpleConnection
public void send(Message message, SenderListener listener) throws MessageException, ConnectionException
Sender
send
in interface Sender
MessageException
ConnectionException
SenderListener
,
Message
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |