org.mobicents.slee.enabler.sip
Class PublicationClientChildSbb

java.lang.Object
  extended by org.mobicents.slee.enabler.sip.PublicationClientChildSbb
All Implemented Interfaces:
javax.slee.Sbb, PublicationClientChild

public abstract class PublicationClientChildSbb
extends java.lang.Object
implements javax.slee.Sbb, PublicationClientChild

SIP Publication Client SLEE Enabler. It creates PUBLISH interaction and manages it. It automatically refreshes publication based on content of ECS/PA response. It keeps map of ETag to publish interaction.

Author:
baranowb, martins

Field Summary
protected  javax.sip.address.AddressFactory addressFactory
           
protected  javax.sip.address.Address ecsAddress
           
protected  int expiresDrift
           
protected  javax.sip.header.HeaderFactory headerFactory
           
protected  javax.sip.message.MessageFactory messageFactory
           
protected  org.mobicents.slee.SbbContextExt sbbContext
           
protected  net.java.slee.resource.sip.SipActivityContextInterfaceFactory sipActivityContextInterfaceFactory
           
protected  net.java.slee.resource.sip.SleeSipProvider sleeSipProvider
           
 
Constructor Summary
PublicationClientChildSbb()
           
 
Method Summary
protected  javax.sip.message.Request createNewPublishRequest(java.lang.String entity, java.lang.String eventPackage, int expires, java.lang.String contentType, java.lang.String contentSubType, java.lang.String document)
           
protected  javax.sip.message.Request createPublishRequest(java.lang.String entity)
           
protected  javax.sip.message.Request createRefreshPublishRequest()
           
protected  javax.sip.message.Request createRemovePublishRequest()
           
protected  javax.sip.message.Request createUpdatePublishRequest(java.lang.String contentType, java.lang.String contentSubType, java.lang.String document)
           
protected  void doRefresh()
           
 java.lang.String getEntity()
          Retrieve entity for which this child publishes.
abstract  java.lang.String getEntityCMP()
           
 java.lang.String getETag()
          Retrieve ETag used in last publish request.
abstract  java.lang.String getETagCMP()
           
abstract  java.lang.String getEventPackageCMP()
           
abstract  int getExpiresCMP()
           
abstract  PublicationClientParentSbbLocalObject getParentSbbCMP()
           
abstract  PostponedRequest getPostponedRequestCMP()
           
abstract  org.mobicents.slee.enabler.sip.PublishRequestType getPublishRequestTypeCMP()
           
protected  void handleFailure(int statusCode, javax.slee.ActivityContextInterface ac)
           
 void modifyPublication(java.lang.String document, java.lang.String contentType, java.lang.String contentSubType, int expires)
          Modifies publication with passed document.
 void newPublication(java.lang.String entity, java.lang.String eventPackage, java.lang.String document, java.lang.String contentType, java.lang.String contentSubType, int expires)
          This method should be used to create new publication.
 void onClientErrorRespEvent(javax.sip.ResponseEvent event, javax.slee.ActivityContextInterface aci)
           
 void onGlobalFailureRespEvent(javax.sip.ResponseEvent event, javax.slee.ActivityContextInterface aci)
           
 void onServerErrorRespEvent(javax.sip.ResponseEvent event, javax.slee.ActivityContextInterface aci)
           
 void onSuccessRespEvent(javax.sip.ResponseEvent event, javax.slee.ActivityContextInterface aci)
           
 void onTimerEvent(javax.slee.facilities.TimerEvent event, javax.slee.ActivityContextInterface aci)
           
 void onTransactionTimeoutEvent(javax.sip.TimeoutEvent event, javax.slee.ActivityContextInterface aci)
           
 void removePublication()
          Issues remove request.
 void sbbActivate()
           
 void sbbCreate()
           
 void sbbExceptionThrown(java.lang.Exception arg0, java.lang.Object arg1, javax.slee.ActivityContextInterface arg2)
           
 void sbbLoad()
           
 void sbbPassivate()
           
 void sbbPostCreate()
           
 void sbbRemove()
           
 void sbbRolledBack(javax.slee.RolledBackContext arg0)
           
 void sbbStore()
           
abstract  void setEntityCMP(java.lang.String d)
           
abstract  void setETagCMP(java.lang.String d)
           
abstract  void setEventPackageCMP(java.lang.String eventPackage)
           
abstract  void setExpiresCMP(int expires)
           
 void setParentSbb(PublicationClientParentSbbLocalObject parent)
          Set parent which will be notified about call results.
abstract  void setParentSbbCMP(PublicationClientParentSbbLocalObject parent)
           
abstract  void setPostponedRequestCMP(PostponedRequest pr)
           
abstract  void setPublishRequestTypeCMP(org.mobicents.slee.enabler.sip.PublishRequestType t)
           
 void setSbbContext(javax.slee.SbbContext sbbContext)
           
 void unsetSbbContext()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sbbContext

protected org.mobicents.slee.SbbContextExt sbbContext

sipActivityContextInterfaceFactory

protected net.java.slee.resource.sip.SipActivityContextInterfaceFactory sipActivityContextInterfaceFactory

sleeSipProvider

protected net.java.slee.resource.sip.SleeSipProvider sleeSipProvider

messageFactory

protected javax.sip.message.MessageFactory messageFactory

addressFactory

protected javax.sip.address.AddressFactory addressFactory

headerFactory

protected javax.sip.header.HeaderFactory headerFactory

ecsAddress

protected javax.sip.address.Address ecsAddress

expiresDrift

protected int expiresDrift
Constructor Detail

PublicationClientChildSbb

public PublicationClientChildSbb()
Method Detail

setParentSbb

public void setParentSbb(PublicationClientParentSbbLocalObject parent)
Description copied from interface: PublicationClientChild
Set parent which will be notified about call results.

Specified by:
setParentSbb in interface PublicationClientChild

getEntity

public java.lang.String getEntity()
Description copied from interface: PublicationClientChild
Retrieve entity for which this child publishes.

Specified by:
getEntity in interface PublicationClientChild
Returns:

getETag

public java.lang.String getETag()
Description copied from interface: PublicationClientChild
Retrieve ETag used in last publish request.

Specified by:
getETag in interface PublicationClientChild
Returns:

newPublication

public void newPublication(java.lang.String entity,
                           java.lang.String eventPackage,
                           java.lang.String document,
                           java.lang.String contentType,
                           java.lang.String contentSubType,
                           int expires)
Description copied from interface: PublicationClientChild
This method should be used to create new publication.

Specified by:
newPublication in interface PublicationClientChild
Parameters:
entity - - entity id handling this part of publication. AOR of resource.
eventPackage - - name of event package, ie: "publish"
document - - encoded document, which should be sent for publication
contentType - - main type of MIME type
contentSubType - - sub type of MIME type
expires - - number of seconds for which publication should be active. If its equal to 0, it means ESC/PA should determine expires interval by itself.

modifyPublication

public void modifyPublication(java.lang.String document,
                              java.lang.String contentType,
                              java.lang.String contentSubType,
                              int expires)
Description copied from interface: PublicationClientChild
Modifies publication with passed document. Update request uses stored information(ETag,entity,ecs address and MIME).

Specified by:
modifyPublication in interface PublicationClientChild
Parameters:
document - - encoded document, which should be sent for publication
contentType - - main type of MIME type
contentSubType - - sub type of MIME type
expires - - number of seconds for which publication should be active

removePublication

public void removePublication()
Description copied from interface: PublicationClientChild
Issues remove request. Request uses uses stored information(ETag,entity,ecs address). After this operation, Publication child can be used to public something new.

Specified by:
removePublication in interface PublicationClientChild

setParentSbbCMP

public abstract void setParentSbbCMP(PublicationClientParentSbbLocalObject parent)

getParentSbbCMP

public abstract PublicationClientParentSbbLocalObject getParentSbbCMP()

setEntityCMP

public abstract void setEntityCMP(java.lang.String d)

getEntityCMP

public abstract java.lang.String getEntityCMP()

setEventPackageCMP

public abstract void setEventPackageCMP(java.lang.String eventPackage)

getEventPackageCMP

public abstract java.lang.String getEventPackageCMP()

setExpiresCMP

public abstract void setExpiresCMP(int expires)

getExpiresCMP

public abstract int getExpiresCMP()

setETagCMP

public abstract void setETagCMP(java.lang.String d)

getETagCMP

public abstract java.lang.String getETagCMP()

setPostponedRequestCMP

public abstract void setPostponedRequestCMP(PostponedRequest pr)

getPostponedRequestCMP

public abstract PostponedRequest getPostponedRequestCMP()

setPublishRequestTypeCMP

public abstract void setPublishRequestTypeCMP(org.mobicents.slee.enabler.sip.PublishRequestType t)

getPublishRequestTypeCMP

public abstract org.mobicents.slee.enabler.sip.PublishRequestType getPublishRequestTypeCMP()

onSuccessRespEvent

public void onSuccessRespEvent(javax.sip.ResponseEvent event,
                               javax.slee.ActivityContextInterface aci)

onClientErrorRespEvent

public void onClientErrorRespEvent(javax.sip.ResponseEvent event,
                                   javax.slee.ActivityContextInterface aci)

onServerErrorRespEvent

public void onServerErrorRespEvent(javax.sip.ResponseEvent event,
                                   javax.slee.ActivityContextInterface aci)

onGlobalFailureRespEvent

public void onGlobalFailureRespEvent(javax.sip.ResponseEvent event,
                                     javax.slee.ActivityContextInterface aci)

onTimerEvent

public void onTimerEvent(javax.slee.facilities.TimerEvent event,
                         javax.slee.ActivityContextInterface aci)

onTransactionTimeoutEvent

public void onTransactionTimeoutEvent(javax.sip.TimeoutEvent event,
                                      javax.slee.ActivityContextInterface aci)

createPublishRequest

protected javax.sip.message.Request createPublishRequest(java.lang.String entity)
                                                  throws java.text.ParseException,
                                                         javax.sip.TransportNotSupportedException,
                                                         javax.sip.InvalidArgumentException
Parameters:
expires -
eventPackage -
entity -
contentType -
contentSubType -
document -
Returns:
Throws:
java.text.ParseException
javax.sip.TransportNotSupportedException
javax.sip.InvalidArgumentException

createNewPublishRequest

protected javax.sip.message.Request createNewPublishRequest(java.lang.String entity,
                                                            java.lang.String eventPackage,
                                                            int expires,
                                                            java.lang.String contentType,
                                                            java.lang.String contentSubType,
                                                            java.lang.String document)
                                                     throws java.text.ParseException,
                                                            javax.sip.TransportNotSupportedException,
                                                            javax.sip.InvalidArgumentException
Parameters:
contentType -
contentSubType -
document -
Returns:
Throws:
java.text.ParseException
javax.sip.TransportNotSupportedException
javax.sip.InvalidArgumentException

createUpdatePublishRequest

protected javax.sip.message.Request createUpdatePublishRequest(java.lang.String contentType,
                                                               java.lang.String contentSubType,
                                                               java.lang.String document)
                                                        throws java.text.ParseException,
                                                               javax.sip.TransportNotSupportedException,
                                                               javax.sip.InvalidArgumentException
Parameters:
contentType -
contentSubType -
document -
Returns:
Throws:
java.text.ParseException
javax.sip.TransportNotSupportedException
javax.sip.InvalidArgumentException

createRemovePublishRequest

protected javax.sip.message.Request createRemovePublishRequest()
                                                        throws java.text.ParseException,
                                                               javax.sip.TransportNotSupportedException,
                                                               javax.sip.InvalidArgumentException
Returns:
Throws:
java.text.ParseException
javax.sip.TransportNotSupportedException
javax.sip.InvalidArgumentException

createRefreshPublishRequest

protected javax.sip.message.Request createRefreshPublishRequest()
                                                         throws java.text.ParseException,
                                                                javax.sip.TransportNotSupportedException,
                                                                javax.sip.InvalidArgumentException
Throws:
java.text.ParseException
javax.sip.TransportNotSupportedException
javax.sip.InvalidArgumentException

handleFailure

protected void handleFailure(int statusCode,
                             javax.slee.ActivityContextInterface ac)
Parameters:
statusCode -

doRefresh

protected void doRefresh()

sbbActivate

public void sbbActivate()
Specified by:
sbbActivate in interface javax.slee.Sbb

sbbCreate

public void sbbCreate()
               throws javax.slee.CreateException
Specified by:
sbbCreate in interface javax.slee.Sbb
Throws:
javax.slee.CreateException

sbbExceptionThrown

public void sbbExceptionThrown(java.lang.Exception arg0,
                               java.lang.Object arg1,
                               javax.slee.ActivityContextInterface arg2)
Specified by:
sbbExceptionThrown in interface javax.slee.Sbb

sbbLoad

public void sbbLoad()
Specified by:
sbbLoad in interface javax.slee.Sbb

sbbPassivate

public void sbbPassivate()
Specified by:
sbbPassivate in interface javax.slee.Sbb

sbbPostCreate

public void sbbPostCreate()
                   throws javax.slee.CreateException
Specified by:
sbbPostCreate in interface javax.slee.Sbb
Throws:
javax.slee.CreateException

sbbRemove

public void sbbRemove()
Specified by:
sbbRemove in interface javax.slee.Sbb

sbbRolledBack

public void sbbRolledBack(javax.slee.RolledBackContext arg0)
Specified by:
sbbRolledBack in interface javax.slee.Sbb

sbbStore

public void sbbStore()
Specified by:
sbbStore in interface javax.slee.Sbb

setSbbContext

public void setSbbContext(javax.slee.SbbContext sbbContext)
Specified by:
setSbbContext in interface javax.slee.Sbb

unsetSbbContext

public void unsetSbbContext()
Specified by:
unsetSbbContext in interface javax.slee.Sbb


Copyright © 2011. All Rights Reserved.