001// Copyright 2004, 2005 The Apache Software Foundation
002//
003// Licensed under the Apache License, Version 2.0 (the "License");
004// you may not use this file except in compliance with the License.
005// You may obtain a copy of the License at
006//
007//     http://www.apache.org/licenses/LICENSE-2.0
008//
009// Unless required by applicable law or agreed to in writing, software
010// distributed under the License is distributed on an "AS IS" BASIS,
011// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
012// See the License for the specific language governing permissions and
013// limitations under the License.
014
015package org.apache.tapestry.contrib.table.model;
016
017import java.io.Serializable;
018
019/**
020 * An  interface responsible for determining <b>what</b> data would be stored 
021 * in the session between requests. 
022 * It could be only the table state, it could be entire table including the data,
023 * or it could be nothing at all. 
024 * It is all determined by the implemention of this interface.
025 * 
026 * @author mindbridge
027 */
028public interface ITableSessionStateManager
029{
030
031        /**
032         * Method getSessionState extracts the "persistent" portion of the table model
033         * @param objModel the table model to extract the session state from
034         * @return Object the session state to be saved between the requests
035         */
036        Serializable getSessionState(ITableModel objModel);
037
038        /**
039         * Method recreateTableModel recreates a table model from the saved session state
040         * @param objState the saved session state
041         * @return ITableModel the recreated table model
042         */
043        ITableModel recreateTableModel(Serializable objState);
044}