|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jsmpp.examples.gateway.AutoReconnectGateway
public class AutoReconnectGateway
This are implementation of Gateway. This gateway will reconnect for a
specified interval if the session are closed.
| Nested Class Summary | |
|---|---|
private class |
AutoReconnectGateway.SessionStateListenerImpl
This class will receive the notification from SMPPSession for the
state changes. |
| Field Summary | |
|---|---|
private BindParameter |
bindParam
|
private static org.slf4j.Logger |
logger
|
private long |
reconnectInterval
|
private java.lang.String |
remoteIpAddress
|
private int |
remotePort
|
private SMPPSession |
session
|
| Constructor Summary | |
|---|---|
AutoReconnectGateway(java.lang.String remoteIpAddress,
int remotePort,
BindParameter bindParam)
Construct auto reconnect gateway with specified ip address, port and SMPP Bind parameters. |
|
| Method Summary | |
|---|---|
private SMPPSession |
getSession()
Get the session. |
static void |
main(java.lang.String[] args)
|
private SMPPSession |
newSession()
Create new SMPPSession complete with the
AutoReconnectGateway.SessionStateListenerImpl. |
private void |
reconnectAfter(long timeInMillis)
Reconnect session after specified interval. |
java.lang.String |
submitShortMessage(java.lang.String serviceType,
TypeOfNumber sourceAddrTon,
NumberingPlanIndicator sourceAddrNpi,
java.lang.String sourceAddr,
TypeOfNumber destAddrTon,
NumberingPlanIndicator destAddrNpi,
java.lang.String destinationAddr,
ESMClass esmClass,
byte protocolId,
byte priorityFlag,
java.lang.String scheduleDeliveryTime,
java.lang.String validityPeriod,
RegisteredDelivery registeredDelivery,
byte replaceIfPresentFlag,
DataCoding dataCoding,
byte smDefaultMsgId,
byte[] shortMessage,
OptionalParameter... optionalParameters)
Submit the short message. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final org.slf4j.Logger logger
private SMPPSession session
private java.lang.String remoteIpAddress
private int remotePort
private BindParameter bindParam
private long reconnectInterval
| Constructor Detail |
|---|
public AutoReconnectGateway(java.lang.String remoteIpAddress,
int remotePort,
BindParameter bindParam)
throws java.io.IOException
remoteIpAddress - is the SMSC IP address.remotePort - is the SMSC port.bindParam - is the SMPP Bind parameters.
java.io.IOException| Method Detail |
|---|
public java.lang.String submitShortMessage(java.lang.String serviceType,
TypeOfNumber sourceAddrTon,
NumberingPlanIndicator sourceAddrNpi,
java.lang.String sourceAddr,
TypeOfNumber destAddrTon,
NumberingPlanIndicator destAddrNpi,
java.lang.String destinationAddr,
ESMClass esmClass,
byte protocolId,
byte priorityFlag,
java.lang.String scheduleDeliveryTime,
java.lang.String validityPeriod,
RegisteredDelivery registeredDelivery,
byte replaceIfPresentFlag,
DataCoding dataCoding,
byte smDefaultMsgId,
byte[] shortMessage,
OptionalParameter... optionalParameters)
throws PDUException,
ResponseTimeoutException,
InvalidResponseException,
NegativeResponseException,
java.io.IOException
GatewaySMPPSession.submitShortMessage(String, TypeOfNumber, NumberingPlanIndicator, String, TypeOfNumber, NumberingPlanIndicator, String, ESMClass, byte, byte, String, String, RegisteredDelivery, byte, DataCoding, byte, byte[], OptionalParameter...).
submitShortMessage in interface GatewayPDUException
ResponseTimeoutException
InvalidResponseException
NegativeResponseException
java.io.IOException
private SMPPSession newSession()
throws java.io.IOException
SMPPSession complete with the
AutoReconnectGateway.SessionStateListenerImpl.
SMPPSession.
java.io.IOException - if the creation of new session failed.
private SMPPSession getSession()
throws java.io.IOException
java.io.IOException - if there is no valid session or session creation is
invalid.private void reconnectAfter(long timeInMillis)
timeInMillis - is the interval.
public static void main(java.lang.String[] args)
throws java.io.IOException
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||