{
Object version = o.get(getContextAttributeKey(__VERSION));
Long created = (Long)o.get(__CREATED);
Long accessed = (Long)o.get(__ACCESSED);
NoSqlSession session = null;
// get the session for the context
DBObject attrs = (DBObject)getNestedValue(o,getContextKey());
__log.debug("MongoSessionManager:attrs {}", attrs);
if (attrs != null)
{
__log.debug("MongoSessionManager: session {} present for context {}", clusterId, getContextKey());
//only load a session if it exists for this context
session = new NoSqlSession(this,created,accessed,clusterId,version);
for (String name : attrs.keySet())
{
//skip special metadata attribute which is not one of the actual session attributes
if ( __METADATA.equals(name) )
continue;
String attr = decodeName(name);
Object value = decodeValue(attrs.get(name));
session.doPutOrRemove(attr,value);
session.bindValue(attr,value);
}
session.didActivate();
}
else
__log.debug("MongoSessionManager: session {} not present for context {}",clusterId, getContextKey());
return session;