Package com.sun.appserv.ha.util

Examples of com.sun.appserv.ha.util.CompositeMetadata


    public static CompositeMetadata createCompositeMetadataFrom(ReplicationState state) {
        if (state == null || state.getState() == null) {
            return null;
        }
        Collection entries = deserializeStatesCollection(state.getState());
        CompositeMetadata result
            = new CompositeMetadata(
                state.getVersion()//version
                state.getLastAccess(), //lastAccess
                state.getMaxInactiveInterval(), //maxInactive
                entries,                        //entries
                state.getTrunkState(),          //trunkState
View Full Code Here


            this.putInReplicationCache(updatedState);
        }
    }
   
    private ReplicationState updateReplicationState(ReplicationState currentState, ReplicationState newState) {
        CompositeMetadata currentComposite
            = ReplicationState.createCompositeMetadataFrom(currentState);
        CompositeMetadata newComposite
            = ReplicationState.createCompositeMetadataFrom(newState);
        CompositeMetadata resultComposite
            = this.applyCompositeMetadataDeltas(currentComposite, newComposite);
        byte[] resultAttributeState = null;
        try {           
            resultAttributeState
                = ReplicationState.getByteArrayFromCollection(resultComposite.getEntries());
        } catch (IOException ex) {}
        ReplicationState updatedState
            = ReplicationState.createUpdatedStateFrom(newState, resultAttributeState);
        return updatedState;
    }
View Full Code Here

            = (ReplicationManagerBase)this.getManager();
        BackingStore replicator = mgr.getCompositeBackingStore();
        if(_logger.isLoggable(Level.FINE)) {
            _logger.fine("ReplicationAttributeStore>>save: replicator: " + replicator);                   
        }        
        CompositeMetadata compositeMetadata
            = createCompositeMetadata(modAttrSession);
               
        try {       
            replicator.save(session.getIdInternal(), //id
                    compositeMetadata, !((HASession) session).isPersistent());
View Full Code Here

        String userName = "";
        if(session.getPrincipal() !=null){
            userName = session.getPrincipal().getName();
            ((BaseHASession)session).setUserName(userName);
        }
        CompositeMetadata compositeMetadata
            = createCompositeMetadata(modAttrSession);
        String beKey = session.getBeKey();
        if(beKey != null) {
            compositeMetadata.setBeKey(beKey);
        }
        //need this here because save not called
        compositeMetadata.setOwningInstanceName(ReplicationUtil.getInstanceName());
        try {
            transmitState = jxtaReplicator.getCompositeTransmitState(session.getIdInternal(), compositeMetadata);
        } catch (BackingStoreException ex) {}
        return transmitState;
    }
View Full Code Here

            = (ReplicationManagerBase)this.getManager();
        BackingStore replicator = mgr.getCompositeBackingStore();
        if(_logger.isLoggable(Level.FINE)) {
            _logger.fine("ReplicationAttributeStore>>doSave: replicator: " + replicator);                   
        }        
        CompositeMetadata compositeMetadata
            = createCompositeMetadata(modAttrSession);
               
        try {       
            replicator.save(session.getIdInternal(), //id
                    compositeMetadata, !((HASession) session).isPersistent());
View Full Code Here

    }

    public Session load(String id, String version)
            throws ClassNotFoundException, IOException {
        try {
            CompositeMetadata metaData =
                    (CompositeMetadata) getCompositeBackingStore().load(id, version);
            if(_logger.isLoggable(Level.FINE)) {
                _logger.fine("ReplicationAttributeStore>>load:id=" + id + ", metaData=" + metaData);
            }
            Session session = getSession(metaData);
View Full Code Here

    *
    * @exception ClassNotFoundException if a deserialization error occurs
    * @exception IOException if an input/output error occurs
    */
    public Metadata __load(String id, String version) throws BackingStoreException {
        CompositeMetadata result = null;
        if(id == null) {
            return result;
        }
        ReplicationManagerBase repMgr =
            (ReplicationManagerBase)this.getManager();
View Full Code Here

        addToEntries(modAttrSession, entries,
                SessionAttributeMetadata.Operation.UPDATE, modifiedAttrs);
        entries = addToEntries(modAttrSession, entries,
                SessionAttributeMetadata.Operation.DELETE, deletedAttrs);

        CompositeMetadata result
            = new CompositeMetadata(modAttrSession.getVersion(),
                modAttrSession.getLastAccessedTimeInternal(),
                modAttrSession.getMaxInactiveInterval(),
                entries,
                trunkState,
                modAttrSession.getSsoId()); //ssoId is the extraParam here
View Full Code Here

    * @return
    *   A newly created CompositeMetadata object for the given state
    */
    private CompositeMetadata createCompositeMetadataFrom(ReplicationState state) {
        Collection entries = this.deserializeStatesCollection(state.getState());
        CompositeMetadata result
            = new CompositeMetadata(
                state.getVersion()//version
                state.getLastAccess(), //lastAccess
                state.getMaxInactiveInterval(), //maxInactive
                entries,                        //entries
                state.getTrunkState(),          //trunkState
View Full Code Here

TOP

Related Classes of com.sun.appserv.ha.util.CompositeMetadata

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.