annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WQKmsFacet.java @ 2149:b5f3b29544ea

Added cache definition for hyks. flys-artifacts/trunk@3731 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Fri, 20 Jan 2012 08:30:50 +0000
parents a202a9e048a5
children fd9aece97aa3
rev   line source
1825
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.artifacts.model;
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
2
2124
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
3 import org.apache.log4j.Logger;
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
4
1825
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
5 import de.intevation.artifacts.Artifact;
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
6 import de.intevation.artifacts.CallContext;
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
7
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
8 import de.intevation.flys.artifacts.StaticWQKmsArtifact;
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
9 import de.intevation.flys.artifacts.model.FacetTypes;
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
10
2124
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
11 import de.intevation.flys.artifacts.states.DefaultState;
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
12 import de.intevation.flys.artifacts.states.DefaultState.ComputeType;
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
13
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
14
1825
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
15 /**
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
16 * Facet to show W|Q|km Values.
2124
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
17 * We have following 'Types' (from FacetTypes):
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
18 * String STATIC_WQKMS = "other.wqkms";
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
19 * String STATIC_WQMS_W = "other.wqkms.w";
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
20 * String STATIC_WQKMS_Q = "other.wqkms.q";
1825
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
21 */
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
22 public class WQKmsFacet
2124
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
23 extends DataFacet
1825
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
24 implements FacetTypes {
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
25
2124
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
26 /** House logger. */
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
27 private static Logger logger = Logger.getLogger(WQKmsFacet.class);
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
28
1825
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
29 /** Trivial Constructor. */
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
30 public WQKmsFacet(String description) {
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
31 this(STATIC_WQKMS, description);
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
32 }
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
33
2124
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
34
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
35 /**
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
36 * @param name Name of this facet (we have at least two flavors (w and q).
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
37 */
1825
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
38 public WQKmsFacet(String name, String description) {
2124
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
39 super(0, name, description, ComputeType.FEED, null, null);
1825
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
40 }
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
41
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
42
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
43 /**
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
44 * Returns the data this facet requires.
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
45 *
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
46 * @param artifact the owner artifact.
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
47 * @param context the CallContext (ignored).
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
48 *
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
49 * @return the data.
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
50 */
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
51 @Override
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
52 public Object getData(Artifact artifact, CallContext context) {
2124
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
53 logger.debug("WQKmsFacet.getData");
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
54
1825
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
55 StaticWQKmsArtifact staticData =
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
56 (StaticWQKmsArtifact) artifact;
2124
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
57 Object res = staticData.compute(context, hash, stateId, type, false);
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
58
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
59 return res;
1825
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
60 }
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
61
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
62
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
63 /**
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
64 * Create a deep copy of this Facet.
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
65 * @return a deep copy.
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
66 */
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
67 @Override
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
68 public WQKmsFacet deepCopy() {
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
69 WQKmsFacet copy = new WQKmsFacet(description);
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
70 copy.set(this);
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
71 return copy;
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
72 }
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
73 }
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
74 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org