Package com.ericsson.ssa.sip

Examples of com.ericsson.ssa.sip.SipApplicationSessionImpl


        }

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

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

        try {
            ref = m_SipSessionManager.findSipApplicationSession(sasId);

            if ((ref != null) && !ref.isValid()) {
                m_SipSessionManager.removeSipApplicationSession(ref);
                ref = null;
            }
        } catch (RemoteLockException ex) {
            throw new RemoteLockRuntimeException(ex);
        }

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

            return ref;
        }

        // Need to create a new SAS and store it
        SipApplicationSessionImpl sas = m_SipSessionManager.createSipApplicationSession(sasId, m_Ctx.getSipApplicationListeners());
        sas.setShouldBePersisted(); // on a SAS created by key we want to persist

        return sas;
    }
View Full Code Here


     * @see javax.servlet.sip.TimerService#createTimer(javax.servlet.sip.SipApplicationSession, long, boolean, java.io.Serializable)
     */
    public ServletTimer createTimer(SipApplicationSession appSession,
        long delay, boolean isPersistent, Serializable info) {

        SipApplicationSessionImpl as = (SipApplicationSessionImpl) appSession;
        SipSessionManager ssm = as.getSipSessionManager();

        if ((null == ssm) || (as.isValid() == false)) {
            throw new IllegalStateException("Invalid SipApplicationSession");
        }

        TimerListener tl = as.getTimerListener();

        if (tl == null) {
            throw new IllegalStateException("No TimerListener is configured ");
        }

View Full Code Here

        if (period < 1) {
            throw new IllegalArgumentException(
                "Period should be greater than 0");
        }

        SipApplicationSessionImpl as = (SipApplicationSessionImpl) appSession;
        SipSessionManager ssm = as.getSipSessionManager();

        if ((null == ssm) || (as.isValid() == false)) {
            throw new IllegalStateException("Invalid SipApplicationSession");
        }

        TimerListener tl = as.getTimerListener();

        if (tl == null) {
            throw new IllegalStateException("No TimerListener is configured ");
        }
View Full Code Here

     */
    public void cancel(boolean mayInterruptIfRunning,
                       boolean removeFromParentSAS) {
        super.cancel(mayInterruptIfRunning);
        if (removeFromParentSAS) {
            SipApplicationSessionImpl sas = getPFieldAppSession();
            if (sas != null) {
                sas.cancelServletTimer(this);
            }
        }
    }
View Full Code Here

     * @param p
     */
    public void setPersistent(boolean p) {
        setPFieldPersistent(p);

        SipApplicationSessionImpl appSession = getPFieldAppSession();

        if (p && (appSession != null)) {
            appSession.setServletTimerShouldBePersisted(this);
        }
    }
View Full Code Here

        return info;
    }

    @Override
    protected SipApplicationSessionImpl getPFieldAppSession() {
        SipApplicationSessionImpl sas = null;

        try {
            SipSessionManager ssm = getSipSessionManager();
            if(ssm != null) {
                sas = ssm.findSipApplicationSession(sasId);
View Full Code Here

    }

    @Override
    public Object call() throws Exception {

        SipApplicationSessionImpl sas = (SipApplicationSessionImpl)
            getApplicationSession();
        if (sas != null && sas.hasServletTimer(getId()) && sas.isValid()) {
            if (sas.isReplicationEnabled()) {
                // Instantiate a unit-of-work to collect any entities/artifacts
                // modified during TimerListener invocation.
                // If unit-of-work already exists, leverage it instead of
                // creating a new one
                if (ReplicationUnitOfWork.getThreadLocalUnitOfWork() == null) {
View Full Code Here

        }
    }

    private void removeFromSAS() {
        try {
            SipApplicationSessionImpl sas =
                    (SipApplicationSessionImpl) getApplicationSession(false);
            if (sas != null) {
                // don't attempt to remove the httpsession again from its sessionmanager,
                // super.invalidate() would already have removed it.
                sas.removeSession(httpSession, false);
            }
        } catch (Exception e) { // could be remotelock or illegalstate exception.
            logger.log(Level.WARNING, e.getMessage(), e);
        }
    }
View Full Code Here

                    unlock();

                    return;
                }

                SipApplicationSessionImpl sas = (SipApplicationSessionImpl) ss.getApplicationSession();

                if (sas != null) {
                    if (dialogLocks == null) {
                        dialogLocks = new HashSet<SipApplicationSessionImpl>();
                    }

                    if (dialogLocks.add(sas)) {
                        sas.lockForegroundWithRetry();
                    }
                } else {
                    if (logger.isLoggable(Level.FINE)) {
                        logger.log(Level.FINE, "attempted to lock df {0} but it has no sas. Not obtaining the lock", new Object[] {
                                df
View Full Code Here

    public SipApplicationSessionImpl createSipApplicationSession(
            SipApplicationListeners sipApplicationListeners) {
        String bekey = DataCentricUtilHolder.getInstance().getLocalKey();
        String id = SipApplicationSessionUtil.createSasId(
                bekey, convergedContext.getAppName(), UUIDUtil.randomUUID());
        SipApplicationSessionImpl sess = createNewSipApplicationSession(id);
        // Add to active cache
        initSipApplicationSession(sess, sipApplicationListeners);
        addSipApplicationSession(sess);       
        return sess;
    }
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.