1 package org.opendaylight.controller.clustersession.service;
3 import java.util.HashMap;
5 import org.apache.catalina.Session;
6 import org.apache.catalina.util.SessionIdGenerator;
7 import org.opendaylight.controller.clustersession.ClusterSession;
10 * A service to handle session persistence and retrieval in any data store
12 * @author harman singh
15 public interface ClusterSessionService {
18 * This method performs all startup operations
20 void startInternal(SessionIdGenerator sessionIdGenerator);
23 * Method to perform all clean up operations
28 * Find Session object based on provided session id from persistance
30 * @return an instance of Session
32 Session findSession(final String id);
35 * Get an array of session objects available in storage
37 Session[] findSessions();
40 * Remove a session object from persistence
41 * @param id of session object need to be removed
43 void removeSession(final String id);
46 * Expire and remove a session object from persistence
47 * @param id of session object need to be expired
49 void expireSession(final String id);
52 * Create a session object based on session id, if session is not present
53 * use random session id
55 * @return an instance of Session
57 Session createSession(final String sessionId);
60 * Add a session object in persistence
61 * @param session an instance of ClusterSession
63 void addSession(final ClusterSession session);
66 * Create an empty Session object
67 * @return session object
69 Session createEmptySession();
72 * Fetch attributes of Session object fetched by supplied session id
76 HashMap<String, String> getSession(String sessionId);
79 * update the session object in persistence
82 void updateSession(final ClusterSession session);