org.mobicents.servlet.sip.message
Class SipServletRequestImpl

java.lang.Object
  extended by org.mobicents.servlet.sip.message.SipServletMessageImpl
      extended by org.mobicents.servlet.sip.message.SipServletRequestImpl
All Implemented Interfaces:
java.lang.Cloneable, javax.servlet.ServletRequest, SipServletMessage, SipServletRequest

public class SipServletRequestImpl
extends SipServletMessageImpl
implements SipServletRequest, java.lang.Cloneable


Nested Class Summary
 
Nested classes/interfaces inherited from interface javax.servlet.sip.SipServletMessage
SipServletMessage.HeaderForm
 
Field Summary
static java.util.Set<java.lang.String> nonInitialSipRequestMethods
           
 
Fields inherited from class org.mobicents.servlet.sip.message.SipServletMessageImpl
addressHeadersNames, attributes, currentApplicationName, defaultEncoding, dialog, headerCompact2FullNamesMappings, headerForm, headerFull2CompactNamesMappings, ianaAllowedContentTypes, isMessageSent, localAddr, localPort, message, parameterableHeadersNames, remoteAddr, remotePort, session, sipFactoryImpl, systemHeaders, transactionApplicationData, transport, userPrincipal
 
Constructor Summary
SipServletRequestImpl(javax.sip.message.Request request, SipFactoryImpl sipFactoryImpl, MobicentsSipSession sipSession, javax.sip.Transaction transaction, javax.sip.Dialog dialog, boolean createDialog)
           
 
Method Summary
 void addAppCompositionRRHeader()
          Add a record route header for app composition
 void addAuthHeader(SipServletResponse challengeResponse, AuthInfo authInfo)
           
 void addAuthHeader(SipServletResponse challengeResponse, java.lang.String username, java.lang.String password)
           
 void addInfoForRoutingBackToContainer(java.lang.String applicationName)
          Add a route header to route back to the container
protected  void checkMessageState()
           
 SipServletRequest createCancel()
           
 SipServletResponse createResponse(int statusCode)
           
 SipServletResponse createResponse(int statusCode, java.lang.String reasonPhrase)
           
 B2buaHelper getB2buaHelper()
           
 Address getInitialPoppedRoute()
          
 javax.servlet.ServletInputStream getInputStream()
           
 SipServletResponse getLastFinalResponse()
           
 SipServletRequestImpl getLinkedRequest()
           
 java.util.Locale getLocale()
           
 java.util.Enumeration getLocales()
           
 java.lang.String getLocalName()
           
 int getMaxForwards()
           
 java.lang.String getParameter(java.lang.String name)
           
 java.util.Map<java.lang.String,java.lang.String> getParameterMap()
           
 java.util.Enumeration<java.lang.String> getParameterNames()
           
 java.lang.String[] getParameterValues(java.lang.String arg0)
           
 Address getPoppedRoute()
           
 Proxy getProxy()
          
 Proxy getProxy(boolean create)
          
 java.io.BufferedReader getReader()
          
 java.lang.String getRealPath(java.lang.String arg0)
           
 SipApplicationRoutingRegion getRegion()
          
 java.lang.String getRemoteHost()
           
 javax.servlet.RequestDispatcher getRequestDispatcher(java.lang.String handler)
          
 URI getRequestURI()
          
 SipApplicationRoutingDirective getRoutingDirective()
           
 RoutingState getRoutingState()
           
 java.lang.String getScheme()
           
 java.lang.String getServerName()
           
 int getServerPort()
           
 URI getSubscriberURI()
          
 boolean is1xxResponseGenerated()
           
 boolean isCommitted()
           
 boolean isFinalResponseGenerated()
           
 boolean isInitial()
          
 boolean isSystemHeader(java.lang.String headerName)
          Applications must not add, delete, or modify so-called "system" headers.
 void pushPath(Address uri)
          
 void pushRoute(Address address)
          
 void pushRoute(SipURI uri)
           
 void send()
           
 void setB2buaHelper(B2buaHelperImpl helperImpl)
           
 void setLastFinalResponse(SipServletResponse finalResponse)
           
 void setLinkedRequest(SipServletRequestImpl linkedRequest)
           
 void setMaxForwards(int n)
           
 void setPoppedRoute(javax.sip.header.RouteHeader routeHeader)
          Set the popped route
 void setRequestURI(URI uri)
           
 void setRoutingDirective(SipApplicationRoutingDirective directive, SipServletRequest origRequest)
           
 void setRoutingRegion(SipApplicationRoutingRegion routingRegion)
          This method allows the application to set the region that the application is in with respect to this SipSession
 void setRoutingState(RoutingState routingState)
           
 void setSubscriberURI(URI uri)
           
 
Methods inherited from class org.mobicents.servlet.sip.message.SipServletMessageImpl
addAcceptLanguage, addAddressHeader, addHeader, addHeaderInternal, addParameterableHeader, clone, createParameterable, getAcceptLanguage, getAcceptLanguages, getAddressHeader, getAddressHeaders, getApplicationSession, getApplicationSession, getAttribute, getAttributeNames, getCallId, getCharacterEncoding, getCompactName, getContent, getContentLanguage, getContentLength, getContentType, getCorrectHeaderName, getCorrectHeaderName, getCurrentApplicationName, getDialog, getExpires, getFrom, getFullHeaderName, getHeader, getHeaderForm, getHeaderNames, getHeaders, getInitialRemoteAddr, getInitialRemotePort, getInitialTransport, getLocalAddr, getLocalPort, getMessage, getMethod, getParameterableHeader, getParameterableHeaders, getProtocol, getRawContent, getRemoteAddr, getRemotePort, getRemoteUser, getSession, getSession, getSipSession, getTo, getTransaction, getTransactionApplicationData, getTransport, getUserPrincipal, isAddressTypeHeader, isParameterable, isSecure, isUserInRole, removeAttribute, removeHeader, setAcceptLanguage, setAddressHeader, setAttribute, setCharacterEncoding, setContent, setContentLanguage, setContentLength, setContentType, setCurrentApplicationName, setExpires, setHeader, setHeaderForm, setLocalAddr, setLocalPort, setParameterableHeader, setSipSession, setTransaction, setTransactionApplicationData, setTransport, setUserPrincipal, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.servlet.sip.SipServletMessage
addAcceptLanguage, addAddressHeader, addHeader, addParameterableHeader, getAcceptLanguage, getAcceptLanguages, getAddressHeader, getAddressHeaders, getApplicationSession, getApplicationSession, getAttribute, getAttributeNames, getCallId, getCharacterEncoding, getContent, getContentLanguage, getContentLength, getContentType, getExpires, getFrom, getHeader, getHeaderForm, getHeaderNames, getHeaders, getInitialRemoteAddr, getInitialRemotePort, getInitialTransport, getLocalAddr, getLocalPort, getMethod, getParameterableHeader, getParameterableHeaders, getProtocol, getRawContent, getRemoteAddr, getRemotePort, getRemoteUser, getSession, getSession, getTo, getTransport, getUserPrincipal, isSecure, isUserInRole, removeAttribute, removeHeader, setAcceptLanguage, setAddressHeader, setAttribute, setCharacterEncoding, setContent, setContentLanguage, setContentLength, setContentType, setExpires, setHeader, setHeaderForm, setParameterableHeader
 
Methods inherited from interface javax.servlet.ServletRequest
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getLocalAddr, getLocalPort, getProtocol, getRemoteAddr, getRemotePort, isSecure, removeAttribute, setAttribute, setCharacterEncoding
 

Field Detail

nonInitialSipRequestMethods

public static final java.util.Set<java.lang.String> nonInitialSipRequestMethods
Constructor Detail

SipServletRequestImpl

public SipServletRequestImpl(javax.sip.message.Request request,
                             SipFactoryImpl sipFactoryImpl,
                             MobicentsSipSession sipSession,
                             javax.sip.Transaction transaction,
                             javax.sip.Dialog dialog,
                             boolean createDialog)
Method Detail

isSystemHeader

public boolean isSystemHeader(java.lang.String headerName)
Description copied from class: SipServletMessageImpl
Applications must not add, delete, or modify so-called "system" headers. These are header fields that the servlet container manages: From, To, Call-ID, CSeq, Via, Route (except through pushRoute), Record-Route. Contact is a system header field in messages other than REGISTER requests and responses, 3xx and 485 responses, and 200/OPTIONS responses. Additionally, for containers implementing the reliable provisional responses extension, RAck and RSeq are considered system headers also. This method should return true if passed name - full or compact is name of system header in context of this message. Each subclass has to implement it in the manner that it conforms to semantics of wrapping class

Specified by:
isSystemHeader in class SipServletMessageImpl
Parameters:
headerName - - either long or compact header name
Returns:

createCancel

public SipServletRequest createCancel()
Specified by:
createCancel in interface SipServletRequest

createResponse

public SipServletResponse createResponse(int statusCode)
Specified by:
createResponse in interface SipServletRequest

createResponse

public SipServletResponse createResponse(int statusCode,
                                         java.lang.String reasonPhrase)
Specified by:
createResponse in interface SipServletRequest

getB2buaHelper

public B2buaHelper getB2buaHelper()
Specified by:
getB2buaHelper in interface SipServletRequest

setB2buaHelper

public void setB2buaHelper(B2buaHelperImpl helperImpl)

getInputStream

public javax.servlet.ServletInputStream getInputStream()
                                                throws java.io.IOException
Specified by:
getInputStream in interface javax.servlet.ServletRequest
Specified by:
getInputStream in interface SipServletRequest
Throws:
java.io.IOException

getMaxForwards

public int getMaxForwards()
Specified by:
getMaxForwards in interface SipServletRequest

getPoppedRoute

public Address getPoppedRoute()
Specified by:
getPoppedRoute in interface SipServletRequest

setPoppedRoute

public void setPoppedRoute(javax.sip.header.RouteHeader routeHeader)
Set the popped route

Parameters:
routeHeader - the popped route header to set

getProxy

public Proxy getProxy()
               throws TooManyHopsException

Specified by:
getProxy in interface SipServletRequest
Throws:
TooManyHopsException

getProxy

public Proxy getProxy(boolean create)
               throws TooManyHopsException

Specified by:
getProxy in interface SipServletRequest
Throws:
TooManyHopsException

getReader

public java.io.BufferedReader getReader()
                                 throws java.io.IOException

Specified by:
getReader in interface javax.servlet.ServletRequest
Specified by:
getReader in interface SipServletRequest
Throws:
java.io.IOException

getRequestURI

public URI getRequestURI()

Specified by:
getRequestURI in interface SipServletRequest

isInitial

public boolean isInitial()

Specified by:
isInitial in interface SipServletRequest

isCommitted

public boolean isCommitted()
Specified by:
isCommitted in interface SipServletMessage

checkMessageState

protected void checkMessageState()
Specified by:
checkMessageState in class SipServletMessageImpl

pushPath

public void pushPath(Address uri)

Specified by:
pushPath in interface SipServletRequest

pushRoute

public void pushRoute(Address address)

Specified by:
pushRoute in interface SipServletRequest

pushRoute

public void pushRoute(SipURI uri)
Specified by:
pushRoute in interface SipServletRequest

setMaxForwards

public void setMaxForwards(int n)
Specified by:
setMaxForwards in interface SipServletRequest

setRequestURI

public void setRequestURI(URI uri)
Specified by:
setRequestURI in interface SipServletRequest

setRoutingDirective

public void setRoutingDirective(SipApplicationRoutingDirective directive,
                                SipServletRequest origRequest)
                         throws java.lang.IllegalStateException
Specified by:
setRoutingDirective in interface SipServletRequest
Throws:
java.lang.IllegalStateException

getLocalName

public java.lang.String getLocalName()
Specified by:
getLocalName in interface javax.servlet.ServletRequest

getLocale

public java.util.Locale getLocale()
Specified by:
getLocale in interface javax.servlet.ServletRequest

getLocales

public java.util.Enumeration getLocales()
Specified by:
getLocales in interface javax.servlet.ServletRequest

getParameter

public java.lang.String getParameter(java.lang.String name)
Specified by:
getParameter in interface javax.servlet.ServletRequest

getParameterMap

public java.util.Map<java.lang.String,java.lang.String> getParameterMap()
Specified by:
getParameterMap in interface javax.servlet.ServletRequest

getParameterNames

public java.util.Enumeration<java.lang.String> getParameterNames()
Specified by:
getParameterNames in interface javax.servlet.ServletRequest

getParameterValues

public java.lang.String[] getParameterValues(java.lang.String arg0)
Specified by:
getParameterValues in interface javax.servlet.ServletRequest

getRealPath

public java.lang.String getRealPath(java.lang.String arg0)
Specified by:
getRealPath in interface javax.servlet.ServletRequest

getRemoteHost

public java.lang.String getRemoteHost()
Specified by:
getRemoteHost in interface javax.servlet.ServletRequest

getRequestDispatcher

public javax.servlet.RequestDispatcher getRequestDispatcher(java.lang.String handler)

Specified by:
getRequestDispatcher in interface javax.servlet.ServletRequest

getScheme

public java.lang.String getScheme()
Specified by:
getScheme in interface javax.servlet.ServletRequest

getServerName

public java.lang.String getServerName()
Specified by:
getServerName in interface javax.servlet.ServletRequest

getServerPort

public int getServerPort()
Specified by:
getServerPort in interface javax.servlet.ServletRequest

getRoutingDirective

public SipApplicationRoutingDirective getRoutingDirective()
Specified by:
getRoutingDirective in interface SipServletRequest
Returns:
the routingDirective

send

public void send()
Specified by:
send in interface SipServletMessage
Specified by:
send in interface SipServletRequest
Specified by:
send in class SipServletMessageImpl

addInfoForRoutingBackToContainer

public void addInfoForRoutingBackToContainer(java.lang.String applicationName)
                                      throws java.text.ParseException
Add a route header to route back to the container

Parameters:
applicationName - the application name that was chosen by the AR to route the request
Throws:
java.text.ParseException

addAppCompositionRRHeader

public void addAppCompositionRRHeader()
                               throws java.text.ParseException,
                                      javax.sip.SipException
Add a record route header for app composition

Throws:
java.text.ParseException - if anything goes wrong while creating the record route header
javax.sip.SipException
java.lang.NullPointerException

setLinkedRequest

public void setLinkedRequest(SipServletRequestImpl linkedRequest)

getLinkedRequest

public SipServletRequestImpl getLinkedRequest()

getRoutingState

public RoutingState getRoutingState()
Returns:
the routingState

setRoutingState

public void setRoutingState(RoutingState routingState)
                     throws java.lang.IllegalStateException
Parameters:
routingState - the routingState to set
Throws:
java.lang.IllegalStateException

addAuthHeader

public void addAuthHeader(SipServletResponse challengeResponse,
                          AuthInfo authInfo)
Specified by:
addAuthHeader in interface SipServletRequest

addAuthHeader

public void addAuthHeader(SipServletResponse challengeResponse,
                          java.lang.String username,
                          java.lang.String password)
Specified by:
addAuthHeader in interface SipServletRequest

getLastFinalResponse

public SipServletResponse getLastFinalResponse()
Returns:
the finalResponse

setLastFinalResponse

public void setLastFinalResponse(SipServletResponse finalResponse)
Parameters:
finalResponse - the finalResponse to set

getInitialPoppedRoute

public Address getInitialPoppedRoute()

Specified by:
getInitialPoppedRoute in interface SipServletRequest

getRegion

public SipApplicationRoutingRegion getRegion()

Specified by:
getRegion in interface SipServletRequest

setRoutingRegion

public void setRoutingRegion(SipApplicationRoutingRegion routingRegion)
This method allows the application to set the region that the application is in with respect to this SipSession

Parameters:
routingRegion - the region that the application is in

getSubscriberURI

public URI getSubscriberURI()

Specified by:
getSubscriberURI in interface SipServletRequest

setSubscriberURI

public void setSubscriberURI(URI uri)

is1xxResponseGenerated

public boolean is1xxResponseGenerated()
Returns:
the is1xxResponseGenerated

isFinalResponseGenerated

public boolean isFinalResponseGenerated()
Returns:
the isFinalResponseGenerated


Copyright © 2008. All Rights Reserved.