org.mobicents.slee.resources.smpp
Class SmppSessionImpl

java.lang.Object
  extended by org.mobicents.slee.resources.smpp.SmppSessionImpl
All Implemented Interfaces:
net.java.slee.resources.smpp.SmppSession

public class SmppSessionImpl
extends java.lang.Object
implements net.java.slee.resources.smpp.SmppSession

Author:
amit bhayani

Field Summary
protected  java.util.Timer timer
           
protected  java.util.concurrent.ConcurrentMap<java.lang.Long,SmppTransactionImpl> transactions
           
 
Constructor Summary
SmppSessionImpl(SmppResourceAdaptor smppResourceAdaptor)
           
 
Method Summary
 net.java.slee.resources.smpp.util.AbsoluteSMPPDate createAbsoluteSMPPDate(java.util.Calendar calendar, boolean hasTz)
           
 net.java.slee.resources.smpp.pdu.Address createAddress(int addTon, int addNpi, java.lang.String address)
           
 net.java.slee.resources.smpp.util.RelativeSMPPDate createRelativeSMPPDate(int years, int months, int days, int hours, int minutes, int seconds)
           
 net.java.slee.resources.smpp.pdu.SmppRequest createSmppRequest(int commandId)
           
 boolean equals(java.lang.Object obj)
           
 java.lang.String getSessionId()
           
protected  SmppTransactionImpl getSmppTransactionImpl(net.java.slee.resources.smpp.pdu.PDU pdu, boolean createActivity, SmppTransactionType txType)
          This method will return the existing SmppTransaction (Activity) if already exist else create new if creayeActivity is true.
 java.lang.String getSMSCHost()
           
 int getSMSPort()
           
 int hashCode()
           
 boolean isAlive()
           
 net.java.slee.resources.smpp.SmppTransaction sendRequest(net.java.slee.resources.smpp.pdu.SmppRequest request)
           
 void sendResponse(net.java.slee.resources.smpp.SmppTransaction txn, net.java.slee.resources.smpp.pdu.SmppResponse response)
           
protected  void setIsAlive(boolean isAlive)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

transactions

protected java.util.concurrent.ConcurrentMap<java.lang.Long,SmppTransactionImpl> transactions

timer

protected java.util.Timer timer
Constructor Detail

SmppSessionImpl

public SmppSessionImpl(SmppResourceAdaptor smppResourceAdaptor)
Method Detail

createAddress

public net.java.slee.resources.smpp.pdu.Address createAddress(int addTon,
                                                              int addNpi,
                                                              java.lang.String address)
Specified by:
createAddress in interface net.java.slee.resources.smpp.SmppSession

createSmppRequest

public net.java.slee.resources.smpp.pdu.SmppRequest createSmppRequest(int commandId)
Specified by:
createSmppRequest in interface net.java.slee.resources.smpp.SmppSession

createAbsoluteSMPPDate

public net.java.slee.resources.smpp.util.AbsoluteSMPPDate createAbsoluteSMPPDate(java.util.Calendar calendar,
                                                                                 boolean hasTz)
Specified by:
createAbsoluteSMPPDate in interface net.java.slee.resources.smpp.SmppSession

createRelativeSMPPDate

public net.java.slee.resources.smpp.util.RelativeSMPPDate createRelativeSMPPDate(int years,
                                                                                 int months,
                                                                                 int days,
                                                                                 int hours,
                                                                                 int minutes,
                                                                                 int seconds)
Specified by:
createRelativeSMPPDate in interface net.java.slee.resources.smpp.SmppSession

getSMSCHost

public java.lang.String getSMSCHost()
Specified by:
getSMSCHost in interface net.java.slee.resources.smpp.SmppSession

getSMSPort

public int getSMSPort()
Specified by:
getSMSPort in interface net.java.slee.resources.smpp.SmppSession

getSessionId

public java.lang.String getSessionId()
Specified by:
getSessionId in interface net.java.slee.resources.smpp.SmppSession

isAlive

public boolean isAlive()
Specified by:
isAlive in interface net.java.slee.resources.smpp.SmppSession

sendRequest

public net.java.slee.resources.smpp.SmppTransaction sendRequest(net.java.slee.resources.smpp.pdu.SmppRequest request)
                                                         throws java.lang.IllegalStateException,
                                                                java.lang.NullPointerException,
                                                                java.io.IOException
Specified by:
sendRequest in interface net.java.slee.resources.smpp.SmppSession
Throws:
java.lang.IllegalStateException
java.lang.NullPointerException
java.io.IOException

sendResponse

public void sendResponse(net.java.slee.resources.smpp.SmppTransaction txn,
                         net.java.slee.resources.smpp.pdu.SmppResponse response)
                  throws java.lang.IllegalStateException,
                         java.lang.NullPointerException,
                         java.io.IOException
Specified by:
sendResponse in interface net.java.slee.resources.smpp.SmppSession
Throws:
java.lang.IllegalStateException
java.lang.NullPointerException
java.io.IOException

setIsAlive

protected void setIsAlive(boolean isAlive)

getSmppTransactionImpl

protected SmppTransactionImpl getSmppTransactionImpl(net.java.slee.resources.smpp.pdu.PDU pdu,
                                                     boolean createActivity,
                                                     SmppTransactionType txType)
This method will return the existing SmppTransaction (Activity) if already exist else create new if creayeActivity is true. If already exist we remove it from transactions Map as this Tx life is only till response is received back

Parameters:
pdu -
createActivity -
requestReceived -
Returns:

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object


Copyright © 2010. All Rights Reserved.