View Javadoc
1   /*
2    * $Header: /cvsroot/sinon/sinon/src/java/eteg/sinon/dao/CollectorDAO.java,v 1.2 2005/06/21 14:25:08 thiagohp Exp $
3    * $Revision: 1.2 $
4    * $Date: 2005/06/21 14:25:08 $
5    * $Author: thiagohp $
6    *
7    * =============================================================================
8    *
9    * Copyright 2004-2005 Eteg Internet Ltda. (http://www.eteg.com.br)
10   *
11   * Licensed under the Apache License, Version 2.0 (the "License");
12   * you may not use this file except in compliance with the License.
13   * You may obtain a copy of the License at
14   *
15   *     http://www.apache.org/licenses/LICENSE-2.0
16   *
17   * Unless required by applicable law or agreed to in writing, software
18   * distributed under the License is distributed on an "AS IS" BASIS,
19   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20   * See the License for the specific language governing permissions and
21   * limitations under the License.
22   */
23  package eteg.sinon.dao;
24  
25  import eteg.sinon.core.Collector;
26  
27  import java.util.List;
28  
29  /***
30   * Interface that defines a DAO (Data Accesss Object) to store and retrieve
31   * {@link Collector} instances.
32   *
33   * @author <a href="mailto:thiagohp at users.sourceforge.net">Thiago H. de Paula Figueiredo</a>
34   * @author Last modified by $Author: thiagohp $
35   * @version $Revision: 1.2 $
36   * @see eteg.sinon.core.Collector
37   */
38  public interface CollectorDAO {
39  
40      /***
41       * Stores <code>collector</code> in persistent memory.
42       * @param collector a {@link Collector} instance.
43       * @throws Exception if some error ocurrs.
44       */
45      public void store(Collector collector) throws Exception;
46  
47      /***
48       * Loads the {@link Collector} instance with identifier <code>id</code>
49       * from persistent memory.
50       * @param id a <code>String</code> containing the identifier of the
51       * {@link Collector} instance to be loaded.
52       * @return a {@link Collector} instance.
53       * @throws Exception if some error ocurrs.
54       */
55      public Collector load(String id) throws Exception;
56  
57      /***
58       * Loads all available {@link Collector} instances in a
59       * <code>java.util.List</code>.
60       * @return a <code>java.util.List</code> instance.
61       * @throws Exception if some error ocurrs.
62       */
63      public List findAll() throws Exception;
64  
65  }