Package com.ericsson.ssa.sip

Examples of com.ericsson.ssa.sip.SipApplicationSessionImpl


        // Lock SAS if one is being referenced
        ConvergedHttpSessionFacade chs = (ConvergedHttpSessionFacade)
            createSessionFacade((StandardSession) sess);
        if (chs != null) {
            SipApplicationSessionImpl sas = (SipApplicationSessionImpl)
                chs.getApplicationSession(false);
            if (sas != null) {
                ReplicationUnitOfWork uow =
                    ReplicationUnitOfWork.getThreadLocalUnitOfWork();
                if (uow != null) {
View Full Code Here


    /**
     * {@inheritDoc}
     */
    public void forward(ServletRequest request, ServletResponse response)
        throws ServletException, IOException {
        SipApplicationSessionImpl session = null;

        if (request != null) {
            if (request instanceof SipServletRequestImpl) {
                session = (SipApplicationSessionImpl) ((SipServletRequestImpl) request).getApplicationSession();
            } else {
                throw new IllegalArgumentException(
                    "Only SIP requests are allowed.");
            }
        }

        if (response != null) {
            if (response instanceof SipServletResponseImpl) {
                if (session == null) {
                    session = (SipApplicationSessionImpl) ((SipServletResponseImpl) response).getApplicationSession();
                }
            } else {
                throw new IllegalArgumentException(
                    "Only SIP responses are allowed.");
            }
        }

        if (session == null) {
            throw new IllegalArgumentException(
                "A SIP request or a SIP response must be supplied.");
        }

        Servlet servlet = serviceHandler.getHandler(session.getName(),
                servletName);

        if (servlet == null) {
            throw new IllegalStateException("SIP servlet " + servletName +
                " not found.");
        }

        // Set the new servlet as handler in the Dialog for Application Path, UAS/Proxy
        SipSessionDialogImpl dialog = (SipSessionDialogImpl) ((SipServletRequest) request).getSession();
        dialog.setHandler(servletName);
       
        // Set servlet as currentServlet in the ApplicationSesson, used for UAC case
        session.setCurrentServlet(servletName);
       
        servlet.service(request, response);
    }
View Full Code Here

     * Basically, first Join/Replace header is considered for targetting. If it
     * is not there, look for encoded sas.
     */
    static SipTargetedRequestInfo get (SipServletRequestImpl request) {
        try {           
            SipApplicationSessionImpl sas = null;
            String appName = null;
            SipTargetedRequestInfo stri = null;
           
            SessionTarget st = request.getSessionTarget();
           
            if (st != null) {
                return st.getTargetedRequestInfo();
            }
           
           
            // XXX it is a pity that we do the SAS loading twice.
            // once here to check for a targeted request and once in the Factory
            // when we actually create the ss/sas for the request
            // maybe we can refactor a bit, so that if we have a targeted
            // request we already set the SAS that we found on the request somehow...
            String uriEncodedSasId = null;
            Address routeAddr = request.getInitialPoppedRoute();
            if (routeAddr != null) {
                uriEncodedSasId = UriUtil.getAndDecodeParameter(
                        routeAddr.getURI(), URIImpl.SASID_PARAM);
            }
            if (uriEncodedSasId == null)
                uriEncodedSasId = UriUtil.getAndDecodeParameter(request.getRequestURI(), URIImpl.SASID_PARAM);
            if (uriEncodedSasId != null) {
                appName = SipApplicationSessionUtil.getApplicationName(uriEncodedSasId);
                if (appName != null) {
                    sas = SipSessionManagerRegistry.getInstance().get(appName).findSipApplicationSession(uriEncodedSasId);
                    if (sas != null && sas.isValid()) {
                        if (m_logger.isLoggable(Level.FINEST)) {
                                    m_logger.log(Level.FINEST, "targeted request for app {0} with encodedURI: {1}", new Object[] {appName, uriEncodedSasId});
                                }
                        return new SipTargetedRequestInfo(SipTargetedRequestType.ENCODED_URI, appName);
                    }
View Full Code Here

    static SipApplicationSessionImpl
    getApplicationSession(SipServletRequestImpl request,
    SipApplicationRouterInfo info) {
        SessionTarget st = request.getSessionTarget();
        if (st != null && (request.getSessionImpl() == null)) {
            SipApplicationSessionImpl sas = st.getApplicationSessionImpl();
            if (sas != null && sas.isValid()) {
                String app = info.getNextApplicationName();
                if (app != null && app.equals(sas.getApplicationName())) {
                    return sas;
                }
            }
        }
       
View Full Code Here

            }
        }



        SipApplicationSessionImpl as = null;
        List<String> servlets = findServlets(request);

        // Found servlet(s) in an application which can handle the request
        // (mapping roles),
        // but if empty WE DO NOT need to do anything here. AD will invoke
        // this method with next the application.
        if (!servlets.isEmpty()) {
            URI subscriberURI = getSubscriberURI(info);
            request.setSubscriberURI(subscriberURI);

            as = TargettedRequestHandler.getApplicationSession(request, info);
            if (as == null) {
                as = m_sipFactory.createApplicationSession(request);
            }

            Iterator<String> i = servlets.iterator();

            if (i.hasNext()) {
                String servletToInvoke = i.next();
                matched = true;
                // Setting a current servlet in the AS to be used as

                // DefaultHandler.              
             
               

                as.setCurrentServlet(servletToInvoke);

                createSession(request, as, servletToInvoke, subscriberURI);
                SecurityInterceptor si = SecurityInterceptor.getInstance();

                if (!si.verifyRequest(request, authModule, servletToInvoke)) {
View Full Code Here

     * <br>
     * Used by the application
     * @return the created SAS
     */
    public SipApplicationSession createApplicationSession() {
        SipApplicationSessionImpl as = createApplicationSessionImpl();
        as.setShouldBePersisted(); // could delay until ID is requested

        return as;
    }
View Full Code Here

     * <br>
     * Used internally
     * @return the created SAS
     */
    public SipApplicationSessionImpl createApplicationSessionImpl() {
        SipApplicationSessionImpl as = m_SipSessionManager.createSipApplicationSession(m_Ctx.getSipApplicationListeners());

        return as;
    }
View Full Code Here

     * Implements the jsr289 session key lookup concept
     * Checks if there is any ref to clear and then if the SAS that we are
     * looking for is already created
     */
    public SipApplicationSessionImpl createApplicationSession(SipServletRequestImpl request) {
        SipApplicationSessionImpl sas = null;

        sas = extractUriEncodedSas(request);

        if (sas != null) {
            return sas;
View Full Code Here

                if (!appName.equals(m_ApplicationName)) {
                    logger.log(Level.WARNING, "com.ericsson.ssa.config.SipFactoryFacade.appname_mismatch", new Object[] {
                            appName, m_ApplicationName
                        });
                } else {
                    SipApplicationSessionImpl proposedSas = m_SipSessionManager.findSipApplicationSession(uriEncodedSasId);

                    if ((proposedSas != null) && proposedSas.isValid()) {
                        return proposedSas;
                    }

                    logger.log(Level.WARNING, "com.ericsson.ssa.config.SipFactoryFacade.uri_encoded_sas_not_found");
                }
View Full Code Here

                }

                String sasId = SipApplicationSessionUtil.createSasId(key, m_Ctx.getAppName(), null);

                // There is a key now look for an existing SAS
                SipApplicationSessionImpl ref = null;

                try {
                    ref = m_SipSessionManager.findSipApplicationSession(sasId);
                } catch (RemoteLockException e) {
                    throw new RemoteLockRuntimeException(e);
                }

                if ((ref != null) && !ref.isValid()) {
                    m_SipSessionManager.removeSipApplicationSession(ref);
                    ref = null;
                }

                if (ref != null) { // There is a cached value to be recycled
View Full Code Here

TOP

Related Classes of com.ericsson.ssa.sip.SipApplicationSessionImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.