View Javadoc

1   /*
2    * Copyright (c) 2004-2005, University Health Network.  All rights reserved. Distributed under the BSD 
3    * license (see http://opensource.org/licenses/bsd-license.php).
4    *  
5    * Created on 6-Dec-2004
6    */
7   package ca.uhn.cache;
8   
9   import ca.uhn.cache.exception.DataSourceException;
10  
11  /***
12   * Encapsulates a source of data, for example an original source of data 
13   * that are to be cached, or a caching proxy around such a data source. 
14   * 
15   * IMPORTANT: It is assumed that the data provided by this interface are STATIONARY
16   * in the sense that an individual item of data can't move from one semantic region to another 
17   * over time.  In other words, attributes of a data item may be updated over time, but not 
18   * those that are mapped to IQueryParams.  If this is not the case for your data, you 
19   * must use IUnstationaryDataSource instead.       
20   * 
21   * @author <a href="mailto:alexei.guevara@uhn.on.ca">Alexei Guevara</a>
22   * @author <a href="mailto:bryan.tripp@uhn.on.ca">Bryan Tripp</a>
23   * @version $Revision: 1.1 $ updated on $Date: 2005/01/24 22:52:08 $ by $Author: bryan_tripp $
24   */
25  public interface IDataSource {
26  
27      /***
28       * Runs one or more queries against the data source.  
29       * 
30       * @param theQueries queries to run
31       *  
32       * @return data matching the given queries (may return before all 
33       *      data are available)
34       *      
35       * @throws DataSourceException If the <b>execute</b> operation could not be successfully completed.
36       * 
37       * @precondition theQueries != null 
38       * @precondition CollectionUtils.select( Arrays.asList( theQueries ), NotNullPredicate.INSTANCE ).isEmpty() 
39       */
40      public IQueryResult execute( IQuery[] theQueries ) throws DataSourceException;
41  
42  }