View Javadoc

1   /*
2       Jameleon - An automation testing tool..
3       Copyright (C) 2003 Christian W. Hargraves (engrean@hotmail.com)
4       
5       This library is free software; you can redistribute it and/or
6       modify it under the terms of the GNU Lesser General Public
7       License as published by the Free Software Foundation; either
8       version 2.1 of the License, or (at your option) any later version.
9   
10      This library is distributed in the hope that it will be useful,
11      but WITHOUT ANY WARRANTY; without even the implied warranty of
12      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13      Lesser General Public License for more details.
14  
15      You should have received a copy of the GNU Lesser General Public
16      License along with this library; if not, write to the Free Software
17      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  */
19  package net.sf.jameleon;
20  
21  import java.io.IOException;
22  
23  /***
24   * Used to represent an object that needs to store it's state. This is intended to store the state that an function point was in
25   * at a certain moment.
26   */
27  public interface Storable{
28  
29      /***
30       * Stores the current state of the object to a given <code>File</code>.
31       * @param filename - the name of file to store the state to
32       * @param event - The even that occured (error, state change ...)
33       * @throws IOException - If the state of the object could not be stored in File <code>f</code>.
34       */
35      public void store(String filename, int event) throws IOException;
36  
37  
38      /***
39       * Gets the filename to store the state of the application to. 
40       * The default implementation is to simply use timestamps. 
41       * If this is not the desired behavior, override this method.
42       * @param event - the StateStorer Event
43       * @return the appropriate filename which starts with ERROR- if the StateStorer Event was an Error
44       */
45      public String getStoreToFileName(int event);
46  
47  }