/*
 * The contents of this file are subject to the terms
 * of the Common Development and Distribution License
 * (the License).  You may not use this file except in
 * compliance with the License.
 *
 * You can obtain a copy of the license at
 * https://glassfish.dev.java.net/public/CDDLv1.0.html or
 * glassfish/bootstrap/legal/CDDLv1.0.txt.
 * See the License for the specific language governing
 * permissions and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL
 * Header Notice in each file and include the License file
 * at glassfish/bootstrap/legal/CDDLv1.0.txt.
 * If applicable, add the following below the CDDL Header,
 * with the fields enclosed by brackets [] replaced by
 * you own identifying information:
 * "Portions Copyrighted [year] [name of copyright owner]"
 *
 * Copyright (c) Ericsson AB, 2004-2007. All rights reserved.
 */
package com.ericsson.ssa.sip;

import java.io.IOException;


/**
 * Interface to a persistent store for SipApplicationSessions.
 *
 * @author jluehe
 */
public interface SipApplicationSessionStore extends SipStore {
    /**
     * Loads and returns the SipApplicationSession with the given id from
     * this store.
     *
     * @param id The id of the SipApplicationSession to load
     *
     * @return The SipApplicationSession with the given id, or null if not
     * found
     *
     * @throws IOException
     */
    public SipApplicationSessionImpl load(String id)
        throws IOException;

    /**
     * Saves the given SipApplicationSession to this store.
     *
     * If a SipApplicationSession with the same id already exists in this
     * store, it will be replaced.
     *
     * @param sas The SipApplicationSession to be saved
     *
     * @exception IOException
     */
    public void save(SipApplicationSessionImpl sas)
        throws IOException;

    /**
     * Removes the SipApplicationSession with the given id from this store.
     *
     * @param id The id of the SipApplicationSession to be removed
     *
     * @exception IOException
     */
    public void remove(String id) throws IOException;

    /**
     * Removes all SipApplicationSessions from this store.
     */
    public void clear() throws IOException;
}
