Mercurial > dive4elements > gnv-client
annotate geo-backend/src/main/java/de/intevation/gnv/geobackend/base/query/QueryExecutor.java @ 1127:ebeb56428409
Added license headers and license file.
geo-backend/trunk@1261 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 02 Nov 2010 17:52:22 +0000 |
parents | 02cd2935b5fa |
children |
rev | line source |
---|---|
1127
ebeb56428409
Added license headers and license file.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
897
diff
changeset
|
1 /* |
ebeb56428409
Added license headers and license file.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
897
diff
changeset
|
2 * Copyright (c) 2010 by Intevation GmbH |
ebeb56428409
Added license headers and license file.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
897
diff
changeset
|
3 * |
ebeb56428409
Added license headers and license file.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
897
diff
changeset
|
4 * This program is free software under the LGPL (>=v2.1) |
ebeb56428409
Added license headers and license file.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
897
diff
changeset
|
5 * Read the file LGPL.txt coming with the software for details |
ebeb56428409
Added license headers and license file.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
897
diff
changeset
|
6 * or visit http://www.gnu.org/licenses/ if it does not exist. |
ebeb56428409
Added license headers and license file.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
897
diff
changeset
|
7 */ |
ebeb56428409
Added license headers and license file.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
897
diff
changeset
|
8 |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
9 package de.intevation.gnv.geobackend.base.query; |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
10 |
895
eb777022b628
Integrated a CacheCleaner that will cleanup the SQL-Cache if necessary
Tim Englich <tim.englich@intevation.de>
parents:
887
diff
changeset
|
11 import java.util.Collection; |
eb777022b628
Integrated a CacheCleaner that will cleanup the SQL-Cache if necessary
Tim Englich <tim.englich@intevation.de>
parents:
887
diff
changeset
|
12 |
886
8b442223741c
Ordered imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
541
diff
changeset
|
13 import de.intevation.gnv.geobackend.base.Result; |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
14 import de.intevation.gnv.geobackend.base.query.exception.QueryException; |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
15 |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
16 /** |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
17 * This Interface provides the Method to execute Queries |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
18 * against a Datastore eg. Databases |
887
b757def3ff55
Bring @author javadoc tags in form '@author <a href="john.doe@example.com">John Doe</a>'
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
886
diff
changeset
|
19 * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
20 * |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
21 */ |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
22 public interface QueryExecutor { |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
23 |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
24 |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
25 /** |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
26 * This Method executes the Query an returns the Result |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
27 * in an Collection. |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
28 * @param queryID the ID of the Query which should be used. |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
29 * @param filter the Filterarguments to limit the Data |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
30 * @return the fetched Values |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
31 * @throws QueryException |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
32 */ |
897
02cd2935b5fa
Removed trailing whitespace.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
895
diff
changeset
|
33 Collection<Result> executeQuery(String queryID, |
02cd2935b5fa
Removed trailing whitespace.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
895
diff
changeset
|
34 String[] filter) |
895
eb777022b628
Integrated a CacheCleaner that will cleanup the SQL-Cache if necessary
Tim Englich <tim.englich@intevation.de>
parents:
887
diff
changeset
|
35 throws QueryException; |
541
3cbf11c67fdc
Experimental caching of SQL results via Ehache
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
132
diff
changeset
|
36 |
895
eb777022b628
Integrated a CacheCleaner that will cleanup the SQL-Cache if necessary
Tim Englich <tim.englich@intevation.de>
parents:
887
diff
changeset
|
37 /** |
eb777022b628
Integrated a CacheCleaner that will cleanup the SQL-Cache if necessary
Tim Englich <tim.englich@intevation.de>
parents:
887
diff
changeset
|
38 * Returns the cached results to a given Query. |
eb777022b628
Integrated a CacheCleaner that will cleanup the SQL-Cache if necessary
Tim Englich <tim.englich@intevation.de>
parents:
887
diff
changeset
|
39 * @param query the Query that should identify the Result |
eb777022b628
Integrated a CacheCleaner that will cleanup the SQL-Cache if necessary
Tim Englich <tim.englich@intevation.de>
parents:
887
diff
changeset
|
40 * @return the Cached results or null if no results are cached. |
eb777022b628
Integrated a CacheCleaner that will cleanup the SQL-Cache if necessary
Tim Englich <tim.englich@intevation.de>
parents:
887
diff
changeset
|
41 */ |
541
3cbf11c67fdc
Experimental caching of SQL results via Ehache
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
132
diff
changeset
|
42 Collection<Result> cachedResults(String query); |
3cbf11c67fdc
Experimental caching of SQL results via Ehache
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
132
diff
changeset
|
43 |
895
eb777022b628
Integrated a CacheCleaner that will cleanup the SQL-Cache if necessary
Tim Englich <tim.englich@intevation.de>
parents:
887
diff
changeset
|
44 /** |
eb777022b628
Integrated a CacheCleaner that will cleanup the SQL-Cache if necessary
Tim Englich <tim.englich@intevation.de>
parents:
887
diff
changeset
|
45 * Writes the Result into the Cache |
eb777022b628
Integrated a CacheCleaner that will cleanup the SQL-Cache if necessary
Tim Englich <tim.englich@intevation.de>
parents:
887
diff
changeset
|
46 * @param query the Query that will be used as Identifier. |
eb777022b628
Integrated a CacheCleaner that will cleanup the SQL-Cache if necessary
Tim Englich <tim.englich@intevation.de>
parents:
887
diff
changeset
|
47 * @param results The Results that should be cached. |
eb777022b628
Integrated a CacheCleaner that will cleanup the SQL-Cache if necessary
Tim Englich <tim.englich@intevation.de>
parents:
887
diff
changeset
|
48 */ |
541
3cbf11c67fdc
Experimental caching of SQL results via Ehache
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
132
diff
changeset
|
49 void cacheResults(String query, Collection<Result> results); |
895
eb777022b628
Integrated a CacheCleaner that will cleanup the SQL-Cache if necessary
Tim Englich <tim.englich@intevation.de>
parents:
887
diff
changeset
|
50 |
eb777022b628
Integrated a CacheCleaner that will cleanup the SQL-Cache if necessary
Tim Englich <tim.englich@intevation.de>
parents:
887
diff
changeset
|
51 /** |
eb777022b628
Integrated a CacheCleaner that will cleanup the SQL-Cache if necessary
Tim Englich <tim.englich@intevation.de>
parents:
887
diff
changeset
|
52 * Clears the Cache using the Names of the Database-Tables |
eb777022b628
Integrated a CacheCleaner that will cleanup the SQL-Cache if necessary
Tim Englich <tim.englich@intevation.de>
parents:
887
diff
changeset
|
53 * @param tableNames the Tablenames that should be used to Clear the Cache. |
eb777022b628
Integrated a CacheCleaner that will cleanup the SQL-Cache if necessary
Tim Englich <tim.englich@intevation.de>
parents:
887
diff
changeset
|
54 */ |
eb777022b628
Integrated a CacheCleaner that will cleanup the SQL-Cache if necessary
Tim Englich <tim.englich@intevation.de>
parents:
887
diff
changeset
|
55 void clearCache(String[] tableNames); |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
56 } |