comparison artifacts/src/main/java/org/dive4elements/river/artifacts/QSectorArtifact.java @ 8202:e4606eae8ea5

sed src/**/*.java 's/logger/log/g'
author Sascha L. Teichmann <teichmann@intevation.de>
date Fri, 05 Sep 2014 12:58:17 +0200
parents 8d5ca5175038
children 5e38e2924c07
comparison
equal deleted inserted replaced
8201:4b8c5a08de04 8202:e4606eae8ea5
38 * Artifact to produce sector markers. 38 * Artifact to produce sector markers.
39 */ 39 */
40 public class QSectorArtifact 40 public class QSectorArtifact
41 extends StaticD4EArtifact 41 extends StaticD4EArtifact
42 { 42 {
43 /** The logger for this class. */ 43 /** The log for this class. */
44 private static Logger logger = Logger.getLogger(QSectorArtifact.class); 44 private static Logger log = Logger.getLogger(QSectorArtifact.class);
45 45
46 /** The name of the artifact. */ 46 /** The name of the artifact. */
47 public static final String ARTIFACT_NAME = "qsector"; 47 public static final String ARTIFACT_NAME = "qsector";
48 48
49 49
50 /** 50 /**
51 * Trivial Constructor. 51 * Trivial Constructor.
52 */ 52 */
53 public QSectorArtifact() { 53 public QSectorArtifact() {
54 logger.debug("QSectorArtifact.QSectorArtifact()"); 54 log.debug("QSectorArtifact.QSectorArtifact()");
55 } 55 }
56 56
57 57
58 /** 58 /**
59 * Gets called from factory, to set things up. 59 * Gets called from factory, to set things up.
65 Object context, 65 Object context,
66 CallMeta callMeta, 66 CallMeta callMeta,
67 Document data, 67 Document data,
68 List<Class> loadFacets) 68 List<Class> loadFacets)
69 { 69 {
70 logger.debug("QSectorArtifact.setup"); 70 log.debug("QSectorArtifact.setup");
71 super.setup(identifier, factory, context, callMeta, data, loadFacets); 71 super.setup(identifier, factory, context, callMeta, data, loadFacets);
72 initialize(null, context, callMeta); 72 initialize(null, context, callMeta);
73 } 73 }
74 74
75 75
87 87
88 GaugeFinderFactory ggf = GaugeFinderFactory.getInstance(); 88 GaugeFinderFactory ggf = GaugeFinderFactory.getInstance();
89 GaugeFinder gf = ggf.getGaugeFinder(river); 89 GaugeFinder gf = ggf.getGaugeFinder(river);
90 90
91 if (gf == null) { 91 if (gf == null) {
92 logger.warn("No gauge finder found for river '" + river + "'"); 92 log.warn("No gauge finder found for river '" + river + "'");
93 return null; 93 return null;
94 } 94 }
95 95
96 GaugeRange gr = gf.find(km); 96 GaugeRange gr = gf.find(km);
97 if (gr == null) { 97 if (gr == null) {
98 logger.debug("No gauge range found for km " 98 log.debug("No gauge range found for km "
99 + km + " on river " + river + "."); 99 + km + " on river " + river + ".");
100 return null; 100 return null;
101 } 101 }
102 102
103 if (logger.isDebugEnabled()) { 103 if (log.isDebugEnabled()) {
104 logger.debug(gr); 104 log.debug(gr);
105 } 105 }
106 106
107 for (int i = 0; i < FixingsKMChartService.I18N_Q_SECTOR_BOARDERS.length; ++i) { 107 for (int i = 0; i < FixingsKMChartService.I18N_Q_SECTOR_BOARDERS.length; ++i) {
108 String key = FixingsKMChartService.I18N_Q_SECTOR_BOARDERS[i]; 108 String key = FixingsKMChartService.I18N_Q_SECTOR_BOARDERS[i];
109 String def = FixingsKMChartService.DEFAULT_Q_SECTOR_BORDERS[i]; 109 String def = FixingsKMChartService.DEFAULT_Q_SECTOR_BORDERS[i];
117 117
118 118
119 /** Setup state and facet. */ 119 /** Setup state and facet. */
120 @Override 120 @Override
121 protected void initialize(Artifact artifact, Object context, CallMeta meta) { 121 protected void initialize(Artifact artifact, Object context, CallMeta meta) {
122 logger.debug("QSectorArtifact.initialize"); 122 log.debug("QSectorArtifact.initialize");
123 List<Facet> fs = new ArrayList<Facet>(); 123 List<Facet> fs = new ArrayList<Facet>();
124 124
125 D4EArtifact flys = (D4EArtifact) artifact; 125 D4EArtifact flys = (D4EArtifact) artifact;
126 importData(flys, "river"); 126 importData(flys, "river");
127 127
128 DefaultState state = (DefaultState) getCurrentState(context); 128 DefaultState state = (DefaultState) getCurrentState(context);
129 state.computeInit(this, hash(), context, meta, fs); 129 state.computeInit(this, hash(), context, meta, fs);
130 if (!fs.isEmpty()) { 130 if (!fs.isEmpty()) {
131 logger.debug("Facets to add in QSectorArtifact.initialize ."); 131 log.debug("Facets to add in QSectorArtifact.initialize .");
132 addFacets(getCurrentStateId(), fs); 132 addFacets(getCurrentStateId(), fs);
133 } 133 }
134 else { 134 else {
135 logger.debug("No facets to add in QSectorArtifact.initialize (" 135 log.debug("No facets to add in QSectorArtifact.initialize ("
136 + state.getID() + ")."); 136 + state.getID() + ").");
137 } 137 }
138 } 138 }
139 } 139 }
140 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : 140 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org