Package com.sun.enterprise.ee.web.sessmgmt

Examples of com.sun.enterprise.ee.web.sessmgmt.ReplicationState


            _logger.fine("processApplicationStatusQueryMessage:appId: " + applicationId + " found: " + (findApp(applicationId) == null));
        }
        if(findApp(applicationId) == null) {
            isAppRegistered = "N";           
        }
        ReplicationState responseState
            = ReplicationState.createQueryResponseFrom(message, ReplicationUtil.getInstanceName(), isAppRegistered);
        sendQueryResponse(responseState, message.getInstanceName());
    }
View Full Code Here


    }
   
    protected ReplicationState sendQueryResponse(ReplicationState transmitState, String returnInstance) {
        JxtaReplicationSender replicationSender =
                JxtaReplicationSender.createInstance();
        ReplicationState resultState =
                replicationSender.sendReplicationStateQueryResponse(transmitState, returnInstance);
        return resultState;
    }   
View Full Code Here

         */
        BaseCache replicaCache = getReplicaCache();
        if(replicaCache != null) {
            replicaCache.remove(id);
        }
        ReplicationState sessionState = loadSessionFromRemoteActiveCache(
                id, String.valueOf(expat.getVersion()), expat.getInstanceName());
        if (_logger.isLoggable(Level.FINE)) {
            _logger.fine("SipApplicationSessionStoreImpl>>loadFromActiveCache:id="
                    + id + ", sessionState=" + sessionState);
        }
View Full Code Here

    SimpleMetadata __load(String id, String version)
    throws BackingStoreException {
        SimpleMetadata result = null;
        SipTransactionPersistentManager repMgr
            = (SipTransactionPersistentManager)this.getSipSessionManager();
        ReplicationState localCachedState
            = repMgr.removeFromSipApplicationSessionReplicationCache(id);
        //check if we got a hit from our own replica cache
        //and check if we can trust it. If so save and return it immediately
        boolean trustCachedState = canTrustLocallyCachedState(id, version, localCachedState);
        if(_logger.isLoggable(Level.FINE)) {
            _logger.fine("SipApplicationSessionStoreImpl>>__load:id= " + id + ", localCachedState=" +
                    localCachedState + ", trustCachedState=" + trustCachedState);
        }
        ReplicationState bestState = null;
        if(trustCachedState) {
            bestState = localCachedState;
        } else {
            ReplicationState broadcastResultState =
                    findSessionViaBroadcastOrUnicast(id, version);
            bestState = ReplicationState.getBestResult(localCachedState, broadcastResultState);
            if(_logger.isLoggable(Level.FINE)) {
                _logger.fine("SipApplicationSessionStoreImpl>>__load:id=" + id + ", broadcastResultState " +
                        "from broadcast or unicast=" + broadcastResultState + ", bestState = " + bestState);
View Full Code Here

        }
        if(_logger.isLoggable(Level.FINE)) {
            _logger.fine("SipApplicationSessionStoreImpl>>" +
                    "findSessionViaBroadcast: jxtaReplicator: " + jxtaReplicator);                      
        }
        ReplicationState queryResult = jxtaReplicator != null ?
                jxtaReplicator.__load(id, version) : null;
        return queryResult;
    }
View Full Code Here

    private ReplicationState loadSessionFromRemoteActiveCache(String id,
                                                              String version,
                                                              String instanceName)
            throws BackingStoreException {
        ReplicationState returnState = findSessionViaUnicast(id, version, instanceName);
        if (returnState != null && returnState.getState() != null) {
            __addToRemotelyLoadedSessionIds(id);
        }
        return returnState;
    }
View Full Code Here

        BackingStore replicator = mgr.getSipApplicationSessionBackingStore();
        if(!(replicator instanceof JxtaBackingStoreImpl)) {
            return null;
        }
        JxtaBackingStoreImpl jxtaReplicator = (JxtaBackingStoreImpl)replicator;
        ReplicationState transmitState = null;
        byte[] sessionState = ReplicationUtil.getByteArray(haSas, isReplicationCompressionEnabled());

        SimpleMetadata simpleMetadata =
            SimpleMetadataFactory.createSimpleMetadata(
                haSas.getVersion(),
View Full Code Here

   
    void sendLoadAdvisory(String id, String instanceName, HashSet<String> expiredIds) {
        SipTransactionPersistentManager mgr
            = (SipTransactionPersistentManager)getSipSessionManager();
        String theCommand = mgr.MESSAGE_LOAD_ADVISORY_SAS;
        ReplicationState loadAdvisoryState
            = ReplicationState.createUnicastLoadAdvisoryState(MODE_SIP, id,
                this.getApplicationId(), 0L, mgr.getInstanceName(), theCommand);

        if(expiredIds != null && !expiredIds.isEmpty()) {
            try {
                byte[] bytes = ReplicationUtil.getByteArray(expiredIds);
                loadAdvisoryState.setState(bytes);
            } catch(IOException ex) {}
        }
       
        JxtaReplicationSender sender
            = JxtaReplicationSender.createInstance();
View Full Code Here

                                        String bekey,
                                        HashSet<String> ids) {
        SipTransactionPersistentManager mgr
                = (SipTransactionPersistentManager) getSipSessionManager();
        String theCommand = mgr.MESSAGE_BROADCAST_LOAD_RECEIVED_SAS;
        ReplicationState loadReceivedState =
                ReplicationState.createBroadcastLoadReceivedState(MODE_SIP, id,
                        this.getApplicationId(), 0L, mgr.getInstanceName(), theCommand);

        if (bekey != null) {
            String ignoreInstance =
                    SipApplicationSessionUtil.getFailoverServerInstanceForBeKey(bekey);
            if (ignoreInstance != null) {
                loadReceivedState.setProperty(ReplicationState.IGNORE_REMOVE_INSTANCE_NAME, ignoreInstance);
            }
        }

        if (ids != null && !ids.isEmpty()) {
            try {
                byte[] bytes = ReplicationUtil.getByteArray(ids);
                loadReceivedState.setState(bytes);
            } catch (IOException ex) {
            }
        }

        JxtaReplicationSender sender
View Full Code Here

    public ReplicationState sendUnicastLoadQuery(String id, String version, String instanceName) {
        SipTransactionPersistentManager mgr
            = (SipTransactionPersistentManager)getSipSessionManager();
        String theCommand = mgr.LOAD_SAS_COMMAND;
        ReplicationState loadState
            = ReplicationState.createUnicastLoadState(MODE_SIP, id, this.getApplicationId(), ReplicationUtil.parseLong(version), mgr.getInstanceName(), theCommand);
        JxtaReplicationSender sender
            = JxtaReplicationSender.createInstance();
        ReplicationState returnState
            = sender.sendReplicationLoadState(loadState, instanceName, useReplicationUnicastLoadBatching);
        return returnState;
    }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.ee.web.sessmgmt.ReplicationState

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.