public class DefaultSmppClient extends Object implements SmppClient
| Constructor and Description |
|---|
DefaultSmppClient()
Creates a new default SmppClient.
|
DefaultSmppClient(ExecutorService executors)
Creates a new default SmppClient.
|
DefaultSmppClient(ExecutorService executors,
int expectedSessions)
Creates a new default SmppClient.
|
DefaultSmppClient(ExecutorService executors,
int expectedSessions,
ScheduledExecutorService monitorExecutor)
Creates a new default SmppClient.
|
| Modifier and Type | Method and Description |
|---|---|
SmppSession |
bind(SmppSessionConfiguration config) |
SmppSession |
bind(SmppSessionConfiguration config,
SmppSessionHandler sessionHandler)
Binds a client to a remote SMPP endpoint by opening the socket, sending
a bind request, and waiting for a bind response.
|
protected BaseBind |
createBindRequest(SmppSessionConfiguration config) |
protected org.jboss.netty.channel.Channel |
createConnectedChannel(String host,
int port,
long connectTimeoutMillis) |
protected DefaultSmppSession |
createSession(org.jboss.netty.channel.Channel channel,
SmppSessionConfiguration config,
SmppSessionHandler sessionHandler) |
void |
destroy()
Destroy a client by ensuring that all session sockets are closed and all
resources are cleaned up.
|
protected void |
doBind(DefaultSmppSession session,
SmppSessionConfiguration config,
SmppSessionHandler sessionHandler) |
protected DefaultSmppSession |
doOpen(SmppSessionConfiguration config,
SmppSessionHandler sessionHandler) |
int |
getConnectionSize() |
public DefaultSmppClient()
public DefaultSmppClient(ExecutorService executors)
executor - The executor that IO workers will be executed with. An
Executors.newCachedDaemonThreadPool() is recommended. The max threads
will never grow more than expectedSessions if NIO sockets are used.public DefaultSmppClient(ExecutorService executors, int expectedSessions)
executor - The executor that IO workers will be executed with. An
Executors.newCachedDaemonThreadPool() is recommended. The max threads
will never grow more than expectedSessions if NIO sockets are used.expectedSessions - The max number of concurrent sessions expected
to be active at any time. This number controls the max number of worker
threads that the underlying Netty library will use. If processing
occurs in a sessionHandler (a blocking op), be VERY careful
setting this to the correct number of concurrent sessions you expect.public DefaultSmppClient(ExecutorService executors, int expectedSessions, ScheduledExecutorService monitorExecutor)
executor - The executor that IO workers will be executed with. An
Executors.newCachedDaemonThreadPool() is recommended. The max threads
will never grow more than expectedSessions if NIO sockets are used.expectedSessions - The max number of concurrent sessions expected
to be active at any time. This number controls the max number of worker
threads that the underlying Netty library will use. If processing
occurs in a sessionHandler (a blocking op), be VERY careful
setting this to the correct number of concurrent sessions you expect.monitorExecutor - The scheduled executor that all sessions will share
to monitor themselves and expire requests. If null monitoring will
be disabled.public int getConnectionSize()
public void destroy()
SmppClientdestroy in interface SmppClientprotected BaseBind createBindRequest(SmppSessionConfiguration config) throws UnrecoverablePduException
UnrecoverablePduExceptionpublic SmppSession bind(SmppSessionConfiguration config) throws SmppTimeoutException, SmppChannelException, SmppBindException, UnrecoverablePduException, InterruptedException
public SmppSession bind(SmppSessionConfiguration config, SmppSessionHandler sessionHandler) throws SmppTimeoutException, SmppChannelException, SmppBindException, UnrecoverablePduException, InterruptedException
SmppClientbind in interface SmppClientconfig - The client session configurationsessionHandler - The session handlerSmppTimeoutException - Thrown if either the underlying TCP/IP connection
cannot connect within the "connectTimeout" or we can connect but don't
receive a response back to the bind request within the "bindTimeout".SmppChannelException - Thrown if there is an error with the underlying
TCP/IP connection such as a bad host name or the remote server's port
is not accepting connections.SmppBindException - Thrown only in the case where the "bind" request
was successfully sent to the remote system and we actually got back
a "bind" response that rejected the bind attempt.UnrecoverablePduException - Thrown in the case where we were able
to connect and send our "bind" request, but we got back data that
was not failed parsing into a PDU.InterruptedException - Thrown if the calling thread is interrupted
while we are attempting the bind.protected void doBind(DefaultSmppSession session, SmppSessionConfiguration config, SmppSessionHandler sessionHandler) throws SmppTimeoutException, SmppChannelException, SmppBindException, UnrecoverablePduException, InterruptedException
protected DefaultSmppSession doOpen(SmppSessionConfiguration config, SmppSessionHandler sessionHandler) throws SmppTimeoutException, SmppChannelException, InterruptedException
protected DefaultSmppSession createSession(org.jboss.netty.channel.Channel channel, SmppSessionConfiguration config, SmppSessionHandler sessionHandler) throws SmppTimeoutException, SmppChannelException, InterruptedException
protected org.jboss.netty.channel.Channel createConnectedChannel(String host, int port, long connectTimeoutMillis) throws SmppTimeoutException, SmppChannelException, InterruptedException
Copyright © 2009-2014 Cloudhopper by Twitter. All Rights Reserved.