public interface Session
SessionStateListener
and register it to a session
addSessionStateListener(SessionStateListener)
.
Commonly, every SMPP request has a response. The maximum waiting time can be configured as transaction timer.
To terminate the communication with the Message Center gracefully, invoke
unbindAndClose()
. It will send UNBIND command and close the
connection. This method will wait the UNIBIND_RESP but, negative response
will be acceptable and closing connection will be done immediately.
SessionState
Modifier and Type | Method and Description |
---|---|
void |
addSessionStateListener(SessionStateListener l) |
void |
close()
Forced close connection without sending UNBIND command to Message Center.
|
DataSmResult |
dataShortMessage(String serviceType,
TypeOfNumber sourceAddrTon,
NumberingPlanIndicator sourceAddrNpi,
String sourceAddr,
TypeOfNumber destAddrTon,
NumberingPlanIndicator destAddrNpi,
String destinationAddr,
ESMClass esmClass,
RegisteredDelivery registeredDelivery,
DataCoding dataCoding,
OptionalParameter... optionalParameters)
Sending a short message like SUBMIT_SM.
|
int |
getEnquireLinkTimer() |
long |
getLastActivityTimestamp()
Get the last reading valid PDU from remote host.
|
String |
getSessionId()
Get session id.
|
SessionState |
getSessionState() |
long |
getTransactionTimer() |
void |
removeSessionStateListener(SessionStateListener l) |
void |
setEnquireLinkTimer(int enquireLinkTimer) |
void |
setTransactionTimer(long transactionTimer) |
void |
unbindAndClose()
Sending UNBIND and close connection immediately.
|
DataSmResult dataShortMessage(String serviceType, TypeOfNumber sourceAddrTon, NumberingPlanIndicator sourceAddrNpi, String sourceAddr, TypeOfNumber destAddrTon, NumberingPlanIndicator destAddrNpi, String destinationAddr, ESMClass esmClass, RegisteredDelivery registeredDelivery, DataCoding dataCoding, OptionalParameter... optionalParameters) throws PDUException, ResponseTimeoutException, InvalidResponseException, NegativeResponseException, IOException
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_address.esmClass
- is the esm_class.registeredDelivery
- is the registered_delivery.dataCoding
- is the data_coding.optionalParameters
- is the optional parameters.PDUException
- if there is invalid PDU parameter found.ResponseTimeoutException
- if timeout has been reached.InvalidResponseException
- if response is invalid.NegativeResponseException
- if negative response received.IOException
- if there is an I/O error found.String getSessionId()
void setEnquireLinkTimer(int enquireLinkTimer)
int getEnquireLinkTimer()
void setTransactionTimer(long transactionTimer)
long getTransactionTimer()
SessionState getSessionState()
void addSessionStateListener(SessionStateListener l)
void removeSessionStateListener(SessionStateListener l)
long getLastActivityTimestamp()
void close()
void unbindAndClose()