All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jetdrone.vertx.yoke.store.SessionStore Maven / Gradle / Ivy

There is a newer version: 3.0.0
Show newest version
/**
 * Copyright 2011-2014 the original author or authors.
 */
package com.jetdrone.vertx.yoke.store;

import org.vertx.java.core.Handler;
import org.vertx.java.core.json.JsonArray;
import org.vertx.java.core.json.JsonObject;

/** # SessionStore */
public interface SessionStore {

    // Attempt to fetch session by the given `sid`.
    void get(String sid, Handler callback);

    // Commit the given `sess` object associated with the given `sid`.
    void set(String sid, JsonObject sess, Handler callback);

    // Destroy the session associated with the given `sid`.
    void destroy(String sid, Handler callback);

    // Invoke the given callback `fn` with all active sessions.
    void all(Handler callback);

    // Clear all sessions.
    void clear(Handler callback);

    // Fetch number of sessions.
    void length(Handler callback);
}