Package com.opencloud.slee.resources.smpp
This package contains the resource adaptor type API for the SMPP resource adaptor.
This resource adaptor supports generic SMPP services, in which SBBs are responsible for opening and closing SMPP sessions, and performing all session-related logic for an External Short Message Entity (ESME) or Message Center (MC) role. It also supports persistent bound connections to a Message Centre (the behaviour previously provided by the SMPP Bound resource adaptor. Bound sessions are configured in SLEE profiles. Services using bound sessions can only function as ESME nodes.
When using service-managed sessions, services can function as ESME or MC nodes, or both (an RE or Routing Entity). The type of node is determined automatically when the service sends or receives its first PDUs in a session. For example, if a service creates a session and then sends an OUTBIND request, then this is MC behaviour so the node is treated as an MC from that point on, until the end of the session. Similarly if a node creates a session, and then sends a BIND_TRANSMITTER request then this is ESME behaviour. The node type determines what PDUs are allowed to be sent or received in a session. For example, an MC cannot send SUBMIT_SM requests because this is not allowed by the SMPP protocol.
SBB Interface
The SBB interface object that is bound into the SBB's JNDI namespace is an instance of SmppProvider
.
Activities
The activity for the generic resource adaptor is an SMPP Session, which is a TCP connection between 2 SMPP peers,
and some associated session state. This is represented by the SmppSession
interface.
An `SmppSession` activity is created when an incoming connection is received, or when an SBB calls
SmppProvider.openSession()
.
The SMPP RA does not generate an `SMPP_NEW_SESSION` event if an SBB opened the session. Bound sessions do not have
a session activity associated with them, but the SmppSession
interface
is still used to interact with the session.
If an SBB calls SmppSession.closeSession()
then
the SmppSession activity will be ended. The SMPP RA does not generate an `SMPP_END_SESSION` event in this case,
but the SLEE will still generate an ActivityEndEvent
.
Events
Each type of SMPP Protocol Data Unit (PDU) is a separate SLEE event type. In addition, there are several more event types that represent session opening/closing and communication error events (timeouts, I/O errors).
Simple Message Center Example
**Receiving bind_transmitter request**
public void onBindTransmitterEvent(SmppRequestEvent event, ActivityContextInterface aci) { SmppSession smppSession = event.getSession(); BindTransmitter bindRequest = (BindTransmitter) event.getRequest(); BindTransmitterResp bindResponse = (BindTransmitterResp) bindRequest.createResponse(CommandStatus.ESME_ROK); // add sc_interface_version TLV byte[] version = {0x50}; bindResponse.addTLV(new TLV(TLV.SC_INTERFACE_VERSION, version)); smppSession.sendResponse(bindResponse); }
Receiving submit_sm request
public void onSubmitSMEvent(SmppRequestEvent event, ActivityContextInterface aci) { SubmitSM smRequest = (SubmitSM) event.getRequest(); SubmitSMResp smResponse = (SubmitSMResp) smRequest.createResponse(CommandStatus.ESME_ROK); smResponse.setMessageID("12345"); ((IncomingSmppRequestActivity)aci.getActivity()).sendResponse(smResponse); }
Receiving unbind request
public void onUnbindEvent(SmppRequestEvent event, ActivityContextInterface aci) { SmppSession smppSession = event.getSession(); Unbind unbindRequest = (Unbind) event.getRequest(); UnbindResp unbindResponse = (UnbindResp) unbindRequest.createResponse(CommandStatus.ESME_ROK); smppSession.sendResponse(unbindResponse); }
-
Interface Summary Interface Description IncomingSmppRequestActivity An incoming request activity, created when an SMPP request is received by the RA.OutgoingSmppRequestActivity An outgoing request activity, created by an SBB to send an SMPP request.ResponseFuture<T extends Response> A future for services to wait for and get responses from.SmppActivity A superinterface for SMPP request/response activities.SmppActivityContextInterfaceFactory Interface for factory (implemented by the SLEE) to provide `ActivityContextInterface` instances for SMPP activities.SmppProvider Entry point to API for sending SMPP requests.SmppSession This interface represents an SBB's view of an SMPP session.Versions Contains constants for component versions. -
Class Summary Class Description SmppErrorEvent Event fired when an error has occurred, or a timeout has expired.SmppRequestEvent Event fired when a valid SMPP request PDU is received.SmppResponseEvent Event fired when a valid SMPP response PDU is received.SmppSessionEvent Event fired when an SMPP session has been created or torn down by a remote SMPP node. -
Enum Summary Enum Description SmppErrorType -
Exception Summary Exception Description SmppException An exception used when general errors occur, and as a superclass of other SMPP exceptions.SmppSendException An exception used when requests or responses could not be sent.