Mercurial > dive4elements > gnv-client
annotate gnv-artifacts/src/main/java/de/intevation/gnv/state/cache/QueryObject.java @ 1129:ccfa07b88476
merged geo-backend
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Fri, 28 Sep 2012 12:14:01 +0200 |
parents | f953c9a559d8 |
children |
rev | line source |
---|---|
1115
f953c9a559d8
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1036
diff
changeset
|
1 /* |
f953c9a559d8
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1036
diff
changeset
|
2 * Copyright (c) 2010 by Intevation GmbH |
f953c9a559d8
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1036
diff
changeset
|
3 * |
f953c9a559d8
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1036
diff
changeset
|
4 * This program is free software under the LGPL (>=v2.1) |
f953c9a559d8
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1036
diff
changeset
|
5 * Read the file LGPL.txt coming with the software for details |
f953c9a559d8
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1036
diff
changeset
|
6 * or visit http://www.gnu.org/licenses/ if it does not exist. |
f953c9a559d8
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1036
diff
changeset
|
7 */ |
f953c9a559d8
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1036
diff
changeset
|
8 |
845
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
9 package de.intevation.gnv.state.cache; |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
10 /** |
1036 | 11 * This Class is a Container which carries the |
12 * databasequery which belongs to an state. | |
13 * It is also possible to look up if the query contains a specific | |
14 * TableName. | |
845
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
15 * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
16 * |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
17 */ |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
18 public class QueryObject { |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
19 |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
20 /** |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
21 * The Id of the State the Query belongs to |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
22 */ |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
23 private String stateId = null; |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
24 |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
25 /** |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
26 * The Query which belongs to the State |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
27 */ |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
28 private String query = null; |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
29 |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
30 /** |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
31 * Constructor |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
32 * @param stateId the Id of the State the Query belongs to |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
33 * @param query the Query which belongs to the State |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
34 */ |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
35 public QueryObject(String stateId, String query) { |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
36 this.stateId = stateId; |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
37 this.query = query.toUpperCase(); |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
38 } |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
39 |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
40 /** |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
41 * Returns the StateId |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
42 * @return the Stateid |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
43 */ |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
44 public String getStateId() { |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
45 return stateId; |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
46 } |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
47 |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
48 /** |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
49 * Returns the Querystring |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
50 * @return the QueryString |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
51 */ |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
52 public String getQuery() { |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
53 return query; |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
54 } |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
55 |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
56 /** |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
57 * Returns true if the given Name of the Table is Contained in the Query |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
58 * @param tableName the Name of the Table |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
59 * @return true if the Name of the Table is contained in the Query |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
60 */ |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
61 public boolean queryContainsTableName(String tableName){ |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
62 return this.query.contains(tableName); |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
63 } |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
64 } |