public interface SmppSession
| Modifier and Type | Interface and Description |
|---|---|
static class |
SmppSession.Type
The type of SMPP session.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
STATE_BINDING
Session is in the process of binding.
|
static int |
STATE_BOUND
Session is bound (ready to process requests)
|
static int |
STATE_CLOSED
Session is unbound and closed (destroyed)
|
static int |
STATE_INITIAL
Session is in an initial state (not connected, but created)
|
static int |
STATE_OPEN
Session is connected and a bind is pending
|
static int |
STATE_UNBINDING
Session is in the process of un-binding.
|
static String[] |
STATES
Descriptions of each state
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
areOptionalParametersSupported()
Returns whether optional parameters are supported with the remote
endpoint.
|
void |
close()
Immediately close the session by closing the underlying socket/channel.
|
void |
destroy()
Destroy a session by ensuring the socket is closed and all
resources are cleaned up.
|
EnquireLinkResp |
enquireLink(EnquireLink request,
long timeoutMillis)
Synchronously sends an "enquire_link" request to the remote endpoint and
waits for up to a specified number of milliseconds for a response.
|
SmppBindType |
getBindType()
Gets the type of bind for this session such as "transceiver", "receiver",
or "transmitter".
|
long |
getBoundTime()
Returns the System.currentTimeMillis() value of when this session reached
the "BOUND" state.
|
SmppSessionConfiguration |
getConfiguration()
Gets the configuration associated with this session.
|
SmppSessionCounters |
getCounters()
Gets the counters this session is tracking.
|
byte |
getInterfaceVersion()
Gets the interface version currently in use between local and remote
endpoints.
|
SmppSession.Type |
getLocalType()
Gets the session type of the local system.
|
SmppSession.Type |
getRemoteType()
Gets the session type of the remote system.
|
com.cloudhopper.commons.util.windowing.Window<Integer,PduRequest,PduResponse> |
getRequestWindow()
Deprecated.
|
com.cloudhopper.commons.util.windowing.Window<Integer,PduRequest,PduResponse> |
getSendWindow()
Gets the underlying request "window" for this session.
|
String |
getStateName()
Gets the name of the current state of the session.
|
boolean |
hasCounters()
Returns true if and only if this session has counters enabled.
|
boolean |
isBinding()
Checks if the session is currently in the "BINDING" state.
|
boolean |
isBound()
Checks if the session is currently in the "BOUND" state.
|
boolean |
isClosed()
Checks if the session is currently in the "CLOSED" state.
|
boolean |
isOpen()
Checks if the session is currently in the "OPEN" state.
|
boolean |
isUnbinding()
Checks if the session is currently in the "UNBINDING" state.
|
com.cloudhopper.commons.util.windowing.WindowFuture<Integer,PduRequest,PduResponse> |
sendRequestPdu(PduRequest request,
long timeoutMillis,
boolean synchronous)
Main underlying method for sending a request PDU to the remote endpoint.
|
void |
sendResponsePdu(PduResponse response)
Main underlying method for sending a response PDU to the remote endpoint.
|
SubmitSmResp |
submit(SubmitSm request,
long timeoutMillis)
Synchronously sends a "submit" request to the remote endpoint and
waits for up to a specified number of milliseconds for a response.
|
void |
unbind(long timeoutMillis)
Attempts to "unbind" the session, waiting up to a specified period of
milliseconds for an unbind response from the remote endpoint.
|
static final int STATE_INITIAL
static final int STATE_OPEN
static final int STATE_BINDING
static final int STATE_BOUND
static final int STATE_UNBINDING
static final int STATE_CLOSED
static final String[] STATES
SmppBindType getBindType()
SmppSession.Type getLocalType()
SmppSession.Type getRemoteType()
SmppSessionConfiguration getConfiguration()
String getStateName()
byte getInterfaceVersion()
boolean areOptionalParametersSupported()
boolean isOpen()
boolean isBinding()
boolean isBound()
boolean isUnbinding()
boolean isClosed()
long getBoundTime()
com.cloudhopper.commons.util.windowing.Window<Integer,PduRequest,PduResponse> getRequestWindow()
getSendWindow()com.cloudhopper.commons.util.windowing.Window<Integer,PduRequest,PduResponse> getSendWindow()
boolean hasCounters()
SmppSessionCounters getCounters()
void close()
unbind(long)void unbind(long timeoutMillis)
timeoutMillis - The number of milliseconds to wait until an unbind
response is received from the SMSC.close()void destroy()
EnquireLinkResp enquireLink(EnquireLink request, long timeoutMillis) throws RecoverablePduException, UnrecoverablePduException, SmppTimeoutException, SmppChannelException, InterruptedException
request - The request to send to the remote endpointtimeoutMillis - The number of milliseconds to wait until a valid
response is received.RecoverablePduException - Thrown when a recoverable PDU error occurs.
A recoverable PDU error includes the partially decoded PDU in order
to generate a negative acknowledgement (NACK) response.UnrecoverablePduException - Thrown when an unrecoverable PDU error
occurs. This indicates a seriours error occurred and usually indicates
the session should be immediately terminated.SmppTimeoutException - A timeout occurred while waiting for a response
from the remote endpoint. A timeout can either occur with an unresponse
remote endpoint or the bytes were not written in time.SmppChannelException - Thrown when the underlying socket/channel was
unable to write the request.InterruptedException - The calling thread was interrupted while waiting
to acquire a lock or write/read the bytes from the socket/channel.SubmitSmResp submit(SubmitSm request, long timeoutMillis) throws RecoverablePduException, UnrecoverablePduException, SmppTimeoutException, SmppChannelException, InterruptedException
request - The request to send to the remote endpointtimeoutMillis - The number of milliseconds to wait until a valid
response is received.RecoverablePduException - Thrown when a recoverable PDU error occurs.
A recoverable PDU error includes the partially decoded PDU in order
to generate a negative acknowledgement (NACK) response.UnrecoverablePduException - Thrown when an unrecoverable PDU error
occurs. This indicates a seriours error occurred and usually indicates
the session should be immediately terminated.SmppTimeoutException - A timeout occurred while waiting for a response
from the remote endpoint. A timeout can either occur with an unresponse
remote endpoint or the bytes were not written in time.SmppChannelException - Thrown when the underlying socket/channel was
unable to write the request.InterruptedException - The calling thread was interrupted while waiting
to acquire a lock or write/read the bytes from the socket/channel.com.cloudhopper.commons.util.windowing.WindowFuture<Integer,PduRequest,PduResponse> sendRequestPdu(PduRequest request, long timeoutMillis, boolean synchronous) throws RecoverablePduException, UnrecoverablePduException, SmppTimeoutException, SmppChannelException, InterruptedException
requestPdu - The request PDU to sendtimeoutMillis - If synchronous is true, this represents the time to
wait for a slot to open in the underlying window AND the time to wait
for a response back from the remote endpoint. If synchronous is false,
this only represents the time to wait for a slot to open in the
underlying window.synchronous - True if the calling thread plans on waiting for a
response on the returned future. False if the calling thread plans
on discarding the returned future and expects the response PDU to
be passed to the "fireExpectedPduResponseReceived" method on the session handler.RecoverablePduException - Thrown when a recoverable PDU error occurs.
A recoverable PDU error includes the partially decoded PDU in order
to generate a negative acknowledgment (NACK) response.UnrecoverablePduException - Thrown when an unrecoverable PDU error
occurs. This indicates a serious error occurred and usually indicates
the session should be immediately terminated.SmppTimeoutException - A timeout occurred while waiting for a response
from the remote endpoint. A timeout can either occur with an unresponsive
remote endpoint or the bytes were not written in time.SmppChannelException - Thrown when the underlying socket/channel was
unable to write the request.InterruptedException - The calling thread was interrupted while waiting
to acquire a lock or write/read the bytes from the socket/channel.void sendResponsePdu(PduResponse response) throws RecoverablePduException, UnrecoverablePduException, SmppChannelException, InterruptedException
response - The response PDU to sendRecoverablePduException - Thrown when a recoverable PDU error occurs.
A recoverable PDU error includes the partially decoded PDU in order
to generate a negative acknowledgment (NACK) response.UnrecoverablePduException - Thrown when an unrecoverable PDU error
occurs. This indicates a serious error occurred and usually indicates
the session should be immediately terminated.SmppChannelException - Thrown when the underlying socket/channel was
unable to write the request.InterruptedException - The calling thread was interrupted while waiting
to acquire a lock or write/read the bytes from the socket/channel.Copyright © 2009-2014 Cloudhopper by Twitter. All Rights Reserved.