com.tinkerpop.rexster.gremlin
Class GremlinSessions

java.lang.Object
  extended by com.tinkerpop.rexster.gremlin.GremlinSessions

public class GremlinSessions
extends Object

Keeps track of currently running gremlin sessions. Each one is associated with a web client and a particular graph hosted within Rexster.

Credit to Neo Technology (http://neotechnology.com/) for most of the code related to the Gremlin in Rexster. Specifically, this code was borrowed from https://github.com/neo4j/webadmin and re-purposed for Rexster's needs.

Original author Jacob Hansson


Field Summary
protected static ConcurrentHashMap<String,GremlinSession> sessions
           
 
Constructor Summary
GremlinSessions()
           
 
Method Summary
static void destroyAllSessions()
           
static void destroySession(String sessionKey)
          Destroy a session using the session key.
static void destroySession(String sessionId, String graphName)
          Destroy a session
protected static void ensureSessionExists(String sessionId, String graphName, RexsterApplication ra)
           
static GremlinSession findSessionByKey(String sessionKey)
           
static GremlinSession getSession(String sessionId, String graphName, RexsterApplication ra)
          Gets a GremlinSession for a given session identifier and graph name, creating a GremlinSession if one does not exist.
static Collection<String> getSessionKeys()
           
static boolean hasSession(String sessionId, String graphName)
           
static boolean hasSessionKey(String sessionKey)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sessions

protected static ConcurrentHashMap<String,GremlinSession> sessions
Constructor Detail

GremlinSessions

public GremlinSessions()
Method Detail

getSession

public static GremlinSession getSession(String sessionId,
                                        String graphName,
                                        RexsterApplication ra)
Gets a GremlinSession for a given session identifier and graph name, creating a GremlinSession if one does not exist.


findSessionByKey

public static GremlinSession findSessionByKey(String sessionKey)

destroySession

public static void destroySession(String sessionId,
                                  String graphName)
Destroy a session

Parameters:
sessionId - The unique identifier for the session.
graphName - The name of the graph the Gremlin session is connected to.

destroySession

public static void destroySession(String sessionKey)
Destroy a session using the session key.

Parameters:
sessionKey - The session identifier concatenated with the graph name.

destroyAllSessions

public static void destroyAllSessions()

hasSession

public static boolean hasSession(String sessionId,
                                 String graphName)

hasSessionKey

public static boolean hasSessionKey(String sessionKey)

getSessionKeys

public static Collection<String> getSessionKeys()

ensureSessionExists

protected static void ensureSessionExists(String sessionId,
                                          String graphName,
                                          RexsterApplication ra)


Copyright © 2009-2012. All Rights Reserved.