public class SmppSessionFactoryBean extends java.lang.Object implements org.springframework.beans.factory.FactoryBean<ExtendedSmppSession>, org.springframework.context.SmartLifecycle, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
SMPPSession. Usually, you need little more than the host,
the port, perhaps a password, and a systemId.
The SMPPSession represents a connection to a SMSC, through which SMS messages are sent and received.
Here is a breakdown of the supported parameters on this factory bean:
BindType. The bind type specifies whether this
SMPPSession can send (BindType.BIND_TX),
receive (BindType.BIND_RX), or both send and receive
(BindType.BIND_TRX).TypeOfNumber enumeration. Default is
TypeOfNumber.UNKNOWNNumberingPlanIndicator enumeration.
Default is NumberingPlanIndicator.UNKNOWNSMPPSession.SMPPSession(),
SMPPSession.connectAndBind(String, int, org.jsmpp.session.BindParameter),
SMPPSession.connectAndBind(String, int, org.jsmpp.bean.BindType, String, String, String, org.jsmpp.bean.TypeOfNumber, org.jsmpp.bean.NumberingPlanIndicator, String, long)| Constructor and Description |
|---|
SmppSessionFactoryBean() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
void |
destroy() |
ExtendedSmppSession |
getObject()
delegates to
buildSmppSession() |
java.lang.Class<?> |
getObjectType() |
int |
getPhase() |
boolean |
isAutoStartup() |
boolean |
isRunning() |
boolean |
isSingleton() |
void |
setAddressRange(java.lang.String addressRange)
this specifies the range of numbers we want to listen to - as a consumer.
|
void |
setAddrNpi(org.jsmpp.bean.NumberingPlanIndicator addrNpi) |
void |
setAddrTon(org.jsmpp.bean.TypeOfNumber addrTon) |
void |
setAutoStartup(boolean autoStartup) |
void |
setBindType(org.jsmpp.bean.BindType bindType) |
void |
setHost(java.lang.String host) |
void |
setMessageReceiverListeners(java.util.Set<org.jsmpp.session.MessageReceiverListener> messageReceiverListeners) |
void |
setPassword(java.lang.String password) |
void |
setPort(int port) |
void |
setReconnect(boolean reconnect)
Set whether we want to reconnect the session.
|
void |
setReconnectingExecutor(java.util.concurrent.ExecutorService reconnectingExecutor)
Set executor service for performing SMPP reconnection.
|
void |
setReconnectInterval(long reconnectInterval)
Set session reconnection interval.
|
void |
setSessionStateListener(org.jsmpp.session.SessionStateListener sessionStateListener) |
void |
setSsl(boolean ssl) |
void |
setSystemId(java.lang.String systemId) |
void |
setSystemType(java.lang.String systemType) |
void |
setTimeout(long timeout)
Setting timeout for the session.
|
void |
setTransactionTimeout(long transactionTimeout)
Setting transaction timeout preforming request on the session.
|
void |
start() |
void |
stop() |
void |
stop(java.lang.Runnable callback) |
public void setSsl(boolean ssl)
public void setHost(java.lang.String host)
public void setPort(int port)
public void setBindType(org.jsmpp.bean.BindType bindType)
public void setSystemId(java.lang.String systemId)
public void setPassword(java.lang.String password)
public void setSystemType(java.lang.String systemType)
public void setAddrTon(org.jsmpp.bean.TypeOfNumber addrTon)
public void setAddrNpi(org.jsmpp.bean.NumberingPlanIndicator addrNpi)
public void setAddressRange(java.lang.String addressRange)
addressRange.addressRange - the range of phone numbers to receive from.public void setTimeout(long timeout)
setTransactionTimeout(long) which
is the timeout to perform request on the actual session after it has been established.timeout - timeout in millisecondspublic void setTransactionTimeout(long transactionTimeout)
AbstractSession.setTransactionTimer(long).
This transaction timeout is similar to the concept of send timeout / request timeout. (default 2 seconds).
If you receive a lot of ResponseTimeoutException for waiting response from your SMSC,
this indicates you need to increase this value.transactionTimeout - transaction timeout in millisecondspublic void setSessionStateListener(org.jsmpp.session.SessionStateListener sessionStateListener)
public void setMessageReceiverListeners(java.util.Set<org.jsmpp.session.MessageReceiverListener> messageReceiverListeners)
public void setAutoStartup(boolean autoStartup)
public boolean isAutoStartup()
isAutoStartup in interface org.springframework.context.SmartLifecyclepublic void stop(java.lang.Runnable callback)
stop in interface org.springframework.context.SmartLifecyclepublic void start()
start in interface org.springframework.context.Lifecyclepublic void stop()
stop in interface org.springframework.context.Lifecyclepublic boolean isRunning()
isRunning in interface org.springframework.context.Lifecyclepublic int getPhase()
getPhase in interface org.springframework.context.Phasedpublic ExtendedSmppSession getObject() throws java.lang.Exception
buildSmppSession()getObject in interface org.springframework.beans.factory.FactoryBean<ExtendedSmppSession>java.lang.Exceptionpublic java.lang.Class<?> getObjectType()
getObjectType in interface org.springframework.beans.factory.FactoryBean<ExtendedSmppSession>public boolean isSingleton()
isSingleton in interface org.springframework.beans.factory.FactoryBean<ExtendedSmppSession>public void setReconnect(boolean reconnect)
reconnect - true/falsepublic void setReconnectInterval(long reconnectInterval)
reconnectInterval - reconnection interval in millisecondspublic void setReconnectingExecutor(java.util.concurrent.ExecutorService reconnectingExecutor)
reconnectingExecutor - executor servicepublic void afterPropertiesSet()
throws java.lang.Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanjava.lang.Exceptionpublic void destroy()
throws java.lang.Exception
destroy in interface org.springframework.beans.factory.DisposableBeanjava.lang.Exception