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

de.yourinspiration.jexpresso.session.SessionStore Maven / Gradle / Ivy

There is a newer version: 1.0.1
Show newest version
package de.yourinspiration.jexpresso.session;

import java.io.Serializable;

/**
 * Stores session data as key value pairs.
 * 
 * @author Marcel Härle
 *
 */
public interface SessionStore {

    /**
     * Retrieves the value of the session data for the given name. The name must
     * not be null.
     * 
     * @param name
     *            the name of the session data
     * @param sessionId
     *            the current sessionId
     * @param clazz
     *            the class of the session data
     * @return returns null if no such name exists
     */
     T get(final String name, final String sessionId, final Class clazz);

    /**
     * Sets value for the given name. The name must not be null.
     * 
     * @param name
     *            the name for the session data
     * @param value
     *            the value
     * @param sessionId
     *            the current sessionId
     */
    void set(final String name, final Serializable value, final String sessionId);

    /**
     * Get the current count of the existing sessions.
     * 
     * @return the count of the existing sessions
     */
    long size();

    /**
     * Deletes all sessions and data.
     */
    void clear();

    /**
     * Deletes all session data for the given sessionId.
     * 
     * @param sessionId
     *            the sessionId
     */
    void clear(final String sessionId);

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy