@Override
    protected NoSqlSession loadSession(final String clusterId)
    {
        log.debug("loadSession: loading: id=" + clusterId);
        ISerializableSession data = getKey(clusterId);
        log.debug("loadSession: loaded: id=" + clusterId + ", data=" + data);

        if (data == null)
        {
            return null;
        }

        boolean valid = data.isValid();
        if (!valid)
        {
            log.debug("loadSession: id=" + clusterId + ", data=" + data + " has been invalidated.");
            return null;
        }

        if (!clusterId.equals(data.getId()))
        {
            log.warn("loadSession: invalid id (expected:" + clusterId + ", got:" + data.getId() + ")");
            return null;
        }

        synchronized (_cookieDomain)
        {
            if (_cookieDomain != null && !data.getDomain().equals("*") && !_cookieDomain.equals(data.getDomain()))
            {
                log.warn("loadSession: invalid cookie domain (expected:" + _cookieDomain + ", got:" + data.getDomain()
                    + ")");
                return null;
            }
        }

        synchronized (_cookiePath)
        {
            if (_cookiePath != null && !data.getPath().equals("*") && !_cookiePath.equals(data.getPath()))
            {
                log.warn("loadSession: invalid cookie path (expected:" + _cookiePath + ", got:" + data.getPath() + ")");
                return null;
            }
        }

        try
        {
            long version = data.getVersion();
            long created = data.getCreationTime();
            long accessed = data.getAccessed();
            SmarterNoSqlSession session = new SmarterNoSqlSession(this, created, accessed, clusterId, version);

            // get the attributes for the context
            Enumeration<String> attrs = data.getAttributeNames();

            //			log.debug("attrs: " + Collections.list(attrs));
            if (attrs != null)
            {
                while (attrs.hasMoreElements())
                {
                    String name = attrs.nextElement();
                    Object value = data.getAttribute(name);

                    session.initializeAttribute(name, value);
                    session.bindValue(name, value);

                }
            }
            session.didActivate();

            return session;
        }
        catch (Exception e)
        {
            log.warn(e);
        }
        return null;
    }
@ Override protected NoSqlSession loadSession ( final String clusterId ) { log . debug ( "loadSession: loading: id=" + clusterId ) ; ISerializableSession data = getKey ( clusterId ) ; log . debug ( "loadSession: loaded: id=" + clusterId + ", data=" + data ) ; if ( data == null ) { return null ; } boolean valid = data . isValid ( ) ; if ( ! valid ) { log . debug ( "loadSession: id=" + clusterId + ", data=" + data + " has been invalidated." ) ; return null ; } if ( ! clusterId . equals ( data . getId ( ) ) ) { log . warn ( "loadSession: invalid id (expected:" + clusterId + ", got:" + data . getId ( ) + ")" ) ; return null ; } synchronized ( _cookieDomain ) { if ( _cookieDomain != null && ! data . getDomain ( ) . equals ( "*" ) && ! _cookieDomain . equals ( data . getDomain ( ) ) ) { log . warn ( "loadSession: invalid cookie domain (expected:" + _cookieDomain + ", got:" + data . getDomain ( ) + ")" ) ; return null ; } } synchronized ( _cookiePath ) { if ( _cookiePath != null && ! data . getPath ( ) . equals ( "*" ) && ! _cookiePath . equals ( data . getPath ( ) ) ) { log . warn ( "loadSession: invalid cookie path (expected:" + _cookiePath + ", got:" + data . getPath ( ) + ")" ) ; return null ; } } try { long version = data . getVersion ( ) ; long created = data . getCreationTime ( ) ; long accessed = data . getAccessed ( ) ; SmarterNoSqlSession session = new SmarterNoSqlSession ( this , created , accessed , clusterId , version ) ; Enumeration < String > attrs = data . getAttributeNames ( ) ; if ( attrs != null ) { while ( attrs . hasMoreElements ( ) ) { String name = attrs . nextElement ( ) ; Object value = data . getAttribute ( name ) ; session . initializeAttribute ( name , value ) ; session . bindValue ( name , value ) ; } } session . didActivate ( ) ; return session ; } catch ( Exception e ) { log . warn ( e ) ; } return null ; }
/*------------------------------------------------------------