|
|
|||||||||||
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.ucp.UCPConnection
public class UCPConnection
This class is used to connect with a UCP compliant Short Message Service Centre or SMSC.
A typical UCP compliant SMSC would be one manufactured by CMG.
The UCPConnection class implements Sender and Receiver interface
meaning that it can be dynamically loaded using the message Factory class.
IMPORTANT: Unless you are performing some UCP specific operations
it is best to use the ie.ncl.msg.Factory class
to create instances of the UCPConnection.
This allows you to dynamically create transport independent
software applications.
The properties used to setup the UCPConnection class are:-
NAME | VALUE | DEFAULT |
class | The name of the implementing class - ie.ncl.sms.ucp.UCPConnection | mandatory |
host | Host name of the SMSC (string) | mandatory |
port | IP port number of the UCP Server (number) | mandatory |
sourcePort | IP port number to use for the client side of the socket (number) | optional - defaults to -1, meaning system-assigned |
unackedQueueSize | The maximum number of outstanding requests sent to the SMSC without have receive a response for any (number) | optional - defaults to 1 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 |
defaultToGsmAlphabet | The default alphabet encoding is GSM (true/false) | optional - defaults to true |
sessionLogin,sessionPassword | Authentication for session management packet. Session management packet is not sent if this is not configured | optional - . |
sessionTon,sessionNpi | The is TON, NPI sent in a session management packet. | optional - defaults to 6,5 |
queryLinkEverySeconds | Query the link every so often to ensure it is up and running (number of seconds) | optional - defaults to 30 seconds |
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 |
useThisInternationalPrefix | If this is set to a value then any '+' detected in the destination address will be replaced by this international prefix value and vice versa. | optional - no replacement performed |
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. |
throttleUseconds | A configurable pause between transmitting messages (micro seconds). | optional - defaults to 0 micro seconds. |
binary7BitEncoding | When sending messages which have a user-data-header (UDH), and are in the default alphabet (7-bit), do the 7-bit encoding for the SMSC. | defaults to false |
notificationAddress | Set the NAdC or notification address of the UCP message. | defaults to not set |
notificationPid | Set the default notification PID of a submitted UCP message. | defaults to not set |
notificationType | Set the default notification type of a submitted UCP message. | defaults to not set |
Factory
Field Summary | |
---|---|
static java.lang.String |
MESSAGE_CLASS_ATTRIBUTE_NAME
Used to specify the 'message class' (MCLs) attribute for a message. |
static java.lang.String |
NOTIFICATION_ADDRESS_NAME
Used to specify the 'notification address' (NAdC) attribute for a message. |
static java.lang.String |
NOTIFICATION_PID_ATTRIBUTE_NAME
Used to specify the 'notification PID' (NPID) attribute for a message. |
static java.lang.String |
NOTIFICATION_TYPE_ATTRIBUTE_NAME
Used to specify the 'notification type' (NT) attribute for a message. |
Fields inherited from interface ie.ncl.msg.Connection |
---|
CONNECTED, NOT_CONNECTED, NOT_USED, RECONNECTING |
Constructor Summary | |
---|---|
UCPConnection()
|
Method Summary | |
---|---|
void |
acknowledge(Message m,
boolean success)
Acknowledge a received messages. |
void |
addRequest(ie.ncl.sms.ucp.Request request)
|
void |
addRequest(ie.ncl.sms.ucp.Request request,
boolean expedite)
|
void |
close()
Connection Interface method. |
void |
connect()
Connect with the service. |
void |
expediteRequest(ie.ncl.sms.ucp.Request request)
|
java.lang.String |
getHost()
|
boolean |
getLinkAliveIfAnyDataReceived()
|
java.lang.String |
getNotificationAddress()
|
java.lang.String |
getNotificationPid()
|
java.lang.String |
getNotificationType()
|
int |
getPort()
|
int |
getQueryLinkTimer()
|
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. |
java.lang.String |
getSessionLogin()
|
int |
getSessionNpi()
|
java.lang.String |
getSessionPassword()
|
int |
getSessionTon()
|
int |
getSmscResponseTimeout()
|
int |
getSourcePort()
The port number used for the client side of the TCP socket. |
int |
getThrottling()
|
int |
getUnackedQueueSize()
|
java.lang.String |
getUseThisInternationalPrefix()
|
void |
init(java.util.Properties properties)
Initialise the object with settings specified in the properties. |
boolean |
isBinary7BitEncoding()
Set for SMSCs which expect binary messages with default (7-bit) alphabet to be 7-bit encoded on the client. |
static void |
main(java.lang.String[] args)
Print version information. |
void |
receive(ReceiverListener listener)
Receive messages asynchronously. |
void |
send(Message message,
SenderListener listener)
Send a message asynchronously. |
void |
setBinary7BitEncoding(boolean binary7BitEncoding)
Set for SMSCs which expect binary messages with default (7-bit) alphabet to be 7-bit encoded on the client. |
void |
setHost(java.lang.String host)
|
void |
setHostPort(java.lang.String host,
int port)
|
void |
setLinkAliveIfAnyDataReceived(boolean linkAliveIfAnyDataReceived)
|
void |
setNotificationAddress(java.lang.String notificationAddress)
|
void |
setNotificationPid(java.lang.String notificationPid)
|
void |
setNotificationType(java.lang.String notificationType)
|
void |
setPort(int port)
|
void |
setQueryLinkTimer(int queryLinkTimer)
|
void |
setReceiverListener(ReceiverListener listener)
Registers listener with the underlying transport. |
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 |
setSessionLogin(java.lang.String sessionLogin)
|
void |
setSessionNpi(int sessionNpi)
|
void |
setSessionPassword(java.lang.String sessionPassword)
|
void |
setSessionTon(int sessionTon)
|
void |
setSmscResponseTimeout(int usec)
|
void |
setSourcePort(int sourcePort)
|
void |
setThrottling(int throttleUseconds)
|
void |
setUnackedQueueSize(int unackedQueueSize)
|
void |
setUseThisInternationalPrefix(java.lang.String useThisInternationalPrefix)
|
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 |
Field Detail |
---|
public static final java.lang.String MESSAGE_CLASS_ATTRIBUTE_NAME
Attributes.put(java.lang.String, int)
public static final java.lang.String NOTIFICATION_TYPE_ATTRIBUTE_NAME
Attributes.put(java.lang.String, int)
public static final java.lang.String NOTIFICATION_PID_ATTRIBUTE_NAME
Attributes.put(java.lang.String, java.lang.String)
public static final java.lang.String NOTIFICATION_ADDRESS_NAME
Attributes.put(java.lang.String, java.lang.String)
Constructor Detail |
---|
public UCPConnection()
Method Detail |
---|
public java.lang.String getNotificationAddress()
public void setNotificationAddress(java.lang.String notificationAddress)
public java.lang.String getNotificationPid()
public void setNotificationPid(java.lang.String notificationPid)
public java.lang.String getNotificationType()
public void setNotificationType(java.lang.String notificationType)
public static void main(java.lang.String[] args)
public void close()
ie.ncl.msg.impl.SimpleConnection
close
in interface Connection
close
in class ie.ncl.msg.impl.SimpleConnection
public void shutdown()
Connection
shutdown
in interface Connection
public void acknowledge(Message m, boolean success) throws MessageException, ConnectionException
Receiver
acknowledge
in interface Receiver
MessageException
ConnectionException
public void receive(ReceiverListener listener) throws ConnectionException
Receiver
receive
in interface Receiver
ConnectionException
Message
public void setReceiverListener(ReceiverListener listener) throws ConnectionException
Receiver
setReceiverListener
in interface Receiver
ConnectionException
Message
public void connect() throws ConnectionException
Connection
connect
in interface Connection
ConnectionException
public void addRequest(ie.ncl.sms.ucp.Request request, boolean expedite)
public void addRequest(ie.ncl.sms.ucp.Request request)
public void expediteRequest(ie.ncl.sms.ucp.Request request)
public void send(Message message, SenderListener listener) throws MessageException, ConnectionException
Sender
send
in interface Sender
MessageException
ConnectionException
SenderListener
,
Message
public void init(java.util.Properties properties) throws ConnectionException
Connection
init
in interface Connection
ConnectionException
public boolean isBinary7BitEncoding()
public void setBinary7BitEncoding(boolean binary7BitEncoding)
public void setReconnectRetryAttempts(int numberOfTimes)
setReconnectOnDisconnect(boolean)
,
getReconnectOnDisconnect()
public int getReconnectRetryAttempts()
setReconnectOnDisconnect(boolean)
,
getReconnectOnDisconnect()
public boolean getReconnectOnDisconnect()
setReconnectRetryAttempts(int)
,
getReconnectRetryAttempts()
public void setReconnectOnDisconnect(boolean yesOrNo)
setReconnectRetryAttempts(int)
,
getReconnectRetryAttempts()
public void setSmscResponseTimeout(int usec)
public int getSmscResponseTimeout()
public boolean getLinkAliveIfAnyDataReceived()
public void setLinkAliveIfAnyDataReceived(boolean linkAliveIfAnyDataReceived)
public int getQueryLinkTimer()
public void setQueryLinkTimer(int queryLinkTimer)
public java.lang.String getSessionLogin()
public void setSessionLogin(java.lang.String sessionLogin)
public java.lang.String getHost()
public void setHost(java.lang.String host)
public int getPort()
public void setPort(int port)
public int getUnackedQueueSize()
public void setUnackedQueueSize(int unackedQueueSize)
public void setHostPort(java.lang.String host, int port)
public int getSourcePort()
public void setSourcePort(int sourcePort)
public java.lang.String getSessionPassword()
public void setSessionPassword(java.lang.String sessionPassword)
public int getSessionTon()
public void setSessionTon(int sessionTon)
public int getSessionNpi()
public void setSessionNpi(int sessionNpi)
public java.lang.String getUseThisInternationalPrefix()
public void setUseThisInternationalPrefix(java.lang.String useThisInternationalPrefix)
public int getThrottling()
public void setThrottling(int throttleUseconds)
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |