org.jsmpp.session
Class SMPPServerSession
java.lang.Object
org.jsmpp.session.AbstractSession
org.jsmpp.session.SMPPServerSession
- All Implemented Interfaces:
- ServerSession, Session
public class SMPPServerSession
- extends AbstractSession
- implements ServerSession
- Author:
- uudashr
Constructor Summary |
SMPPServerSession(Connection conn,
SessionStateListener sessionStateListener,
ServerMessageReceiverListener messageReceiverListener,
ServerResponseDeliveryListener responseDeliveryListener,
int pduProcessorDegree)
|
SMPPServerSession(Connection conn,
SessionStateListener sessionStateListener,
ServerMessageReceiverListener messageReceiverListener,
ServerResponseDeliveryListener responseDeliveryListener,
int pduProcessorDegree,
PDUSender pduSender,
PDUReader pduReader)
|
Method Summary |
void |
alertNotification(int sequenceNumber,
TypeOfNumber sourceAddrTon,
NumberingPlanIndicator sourceAddrNpi,
java.lang.String sourceAddr,
TypeOfNumber esmeAddrTon,
NumberingPlanIndicator esmeAddrNpi,
java.lang.String esmeAddr,
OptionalParameter... optionalParameters)
Send alert notification to ESME in order to notify the particular mobile
subscriber has become available. |
protected Connection |
connection()
|
void |
deliverShortMessage(java.lang.String serviceType,
TypeOfNumber sourceAddrTon,
NumberingPlanIndicator sourceAddrNpi,
java.lang.String sourceAddr,
TypeOfNumber destAddrTon,
NumberingPlanIndicator destAddrNpi,
java.lang.String destinationAddr,
ESMClass esmClass,
byte protocoId,
byte priorityFlag,
RegisteredDelivery registeredDelivery,
DataCoding dataCoding,
byte[] shortMessage,
OptionalParameter... optionalParameters)
Submit a short message to specified destination address (ESME). |
ServerMessageReceiverListener |
getMessageReceiverListener()
|
protected GenericMessageReceiverListener |
messageReceiverListener()
|
protected AbstractSessionContext |
sessionContext()
|
void |
setMessageReceiverListener(ServerMessageReceiverListener messageReceiverListener)
|
void |
setResponseDeliveryListener(ServerResponseDeliveryListener responseDeliveryListener)
|
BindRequest |
waitForBind(long timeout)
Wait for bind request. |
Methods inherited from class org.jsmpp.session.AbstractSession |
addSessionStateListener, close, dataShortMessage, executeSendCommand, fireAcceptDataSm, getEnquireLinkTimer, getLastActivityTimestamp, getPduProcessorDegree, getSessionId, getSessionState, getTransactionTimer, pduSender, removePendingResponse, removeSessionStateListener, sendEnquireLink, sequence, setEnquireLinkTimer, setPduProcessorDegree, setTransactionTimer, unbindAndClose |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SMPPServerSession
public SMPPServerSession(Connection conn,
SessionStateListener sessionStateListener,
ServerMessageReceiverListener messageReceiverListener,
ServerResponseDeliveryListener responseDeliveryListener,
int pduProcessorDegree)
SMPPServerSession
public SMPPServerSession(Connection conn,
SessionStateListener sessionStateListener,
ServerMessageReceiverListener messageReceiverListener,
ServerResponseDeliveryListener responseDeliveryListener,
int pduProcessorDegree,
PDUSender pduSender,
PDUReader pduReader)
waitForBind
public BindRequest waitForBind(long timeout)
throws java.lang.IllegalStateException,
java.util.concurrent.TimeoutException
- Wait for bind request.
- Parameters:
timeout
- is the timeout.
- Returns:
- the
BindRequest
.
- Throws:
java.lang.IllegalStateException
- if this invocation of this method has been
made or invoke when state is not OPEN.
java.util.concurrent.TimeoutException
- if the timeout has been reach and
SMPPServerSession
are no more valid because the
connection will be close automatically.
deliverShortMessage
public void deliverShortMessage(java.lang.String serviceType,
TypeOfNumber sourceAddrTon,
NumberingPlanIndicator sourceAddrNpi,
java.lang.String sourceAddr,
TypeOfNumber destAddrTon,
NumberingPlanIndicator destAddrNpi,
java.lang.String destinationAddr,
ESMClass esmClass,
byte protocoId,
byte priorityFlag,
RegisteredDelivery registeredDelivery,
DataCoding dataCoding,
byte[] shortMessage,
OptionalParameter... optionalParameters)
throws PDUException,
ResponseTimeoutException,
InvalidResponseException,
NegativeResponseException,
java.io.IOException
- Description copied from interface:
ServerSession
- Submit a short message to specified destination address (ESME). This method will
blocks until response received or timeout reached. This method simplify
operations of sending DELIVER_SM command and receiving the DELIVER_SM_RESP.
- Specified by:
deliverShortMessage
in interface ServerSession
- Parameters:
serviceType
- is the service_type.sourceAddrTon
- is the source_addr_ton.sourceAddrNpi
- is the source_addr_npi.sourceAddr
- is the source_addr.destAddrTon
- is the dest_addr_ton.destAddrNpi
- is the dest_addr_npi.destinationAddr
- is the destination_addr.esmClass
- is the esm_class.protocoId
- is the protocol_id.priorityFlag
- is the priority_flag.registeredDelivery
- is the registered_delivery.dataCoding
- is the data_coding.shortMessage
- is the short_message.optionalParameters
- is the optional parameters.
- Throws:
PDUException
- if there is invalid PDU parameter found.
ResponseTimeoutException
- if timeout has been reach.
InvalidResponseException
- if response is invalid.
NegativeResponseException
- if negative response received.
java.io.IOException
- if there is an I/O error found.
alertNotification
public void alertNotification(int sequenceNumber,
TypeOfNumber sourceAddrTon,
NumberingPlanIndicator sourceAddrNpi,
java.lang.String sourceAddr,
TypeOfNumber esmeAddrTon,
NumberingPlanIndicator esmeAddrNpi,
java.lang.String esmeAddr,
OptionalParameter... optionalParameters)
throws PDUStringException,
java.io.IOException
- Description copied from interface:
ServerSession
- Send alert notification to ESME in order to notify the particular mobile
subscriber has become available.
- Specified by:
alertNotification
in interface ServerSession
- Parameters:
sequenceNumber
- is the sequence_number.sourceAddrTon
- is the source_addr_ton.sourceAddrNpi
- is the source_addr_npi.sourceAddr
- is the source_addr.esmeAddrTon
- is the esm_addr_ton.esmeAddrNpi
- is the esme_addr_npi.esmeAddr
- is the esme_addr.optionalParameters
- is the optional parameters.
- Throws:
PDUStringException
- if there is invalid string found.
java.io.IOException
- if there is an I/O error found.
connection
protected Connection connection()
- Specified by:
connection
in class AbstractSession
sessionContext
protected AbstractSessionContext sessionContext()
- Specified by:
sessionContext
in class AbstractSession
messageReceiverListener
protected GenericMessageReceiverListener messageReceiverListener()
- Specified by:
messageReceiverListener
in class AbstractSession
getMessageReceiverListener
public ServerMessageReceiverListener getMessageReceiverListener()
setMessageReceiverListener
public void setMessageReceiverListener(ServerMessageReceiverListener messageReceiverListener)
setResponseDeliveryListener
public void setResponseDeliveryListener(ServerResponseDeliveryListener responseDeliveryListener)