Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/DifferencesState.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 | 856701739443 |
children | 99912f51468d |
comparison
equal
deleted
inserted
replaced
8201:4b8c5a08de04 | 8202:e4606eae8ea5 |
---|---|
48 */ | 48 */ |
49 public class DifferencesState | 49 public class DifferencesState |
50 extends DefaultState | 50 extends DefaultState |
51 implements FacetTypes | 51 implements FacetTypes |
52 { | 52 { |
53 /** The logger used in this class. */ | 53 /** The log used in this class. */ |
54 private static Logger logger = Logger.getLogger(DifferencesState.class); | 54 private static Logger log = Logger.getLogger(DifferencesState.class); |
55 public static final String I18N_DIFF_YEAR = "beddifference.year"; | 55 public static final String I18N_DIFF_YEAR = "beddifference.year"; |
56 | 56 |
57 public static final String I18N_FACET_BED_DIFF_YEAR = "facet.bedheight.diff.year"; | 57 public static final String I18N_FACET_BED_DIFF_YEAR = "facet.bedheight.diff.year"; |
58 public static final String I18N_FACET_BED_DIFF_YEAR_RAW = "facet.bedheight.diff.year.raw"; | 58 public static final String I18N_FACET_BED_DIFF_YEAR_RAW = "facet.bedheight.diff.year.raw"; |
59 public static final String I18N_FACET_BED_DIFF_ABSOLUTE = "facet.bedheight.diff.absolute"; | 59 public static final String I18N_FACET_BED_DIFF_ABSOLUTE = "facet.bedheight.diff.absolute"; |
72 } | 72 } |
73 | 73 |
74 @Override | 74 @Override |
75 public Object computeAdvance(D4EArtifact artifact, String hash, | 75 public Object computeAdvance(D4EArtifact artifact, String hash, |
76 CallContext context, List<Facet> facets, Object old) { | 76 CallContext context, List<Facet> facets, Object old) { |
77 logger.debug("DifferencesState.computeAdvance"); | 77 log.debug("DifferencesState.computeAdvance"); |
78 | 78 |
79 List<Facet> newFacets = new ArrayList<Facet>(); | 79 List<Facet> newFacets = new ArrayList<Facet>(); |
80 | 80 |
81 BedDifferencesAccess access = new BedDifferencesAccess(artifact); | 81 BedDifferencesAccess access = new BedDifferencesAccess(artifact); |
82 | 82 |
89 } | 89 } |
90 | 90 |
91 BedDifferencesResult[] results = (BedDifferencesResult[]) res.getData(); | 91 BedDifferencesResult[] results = (BedDifferencesResult[]) res.getData(); |
92 | 92 |
93 if (results == null || results.length == 0) { | 93 if (results == null || results.length == 0) { |
94 logger.warn("Calculation computed no results!"); | 94 log.warn("Calculation computed no results!"); |
95 return res; | 95 return res; |
96 } | 96 } |
97 | 97 |
98 generateFacets(context, newFacets, results, getID(), hash); | 98 generateFacets(context, newFacets, results, getID(), hash); |
99 logger.debug("Created " + newFacets.size() + " new Facets."); | 99 log.debug("Created " + newFacets.size() + " new Facets."); |
100 | 100 |
101 facets.addAll(newFacets); | 101 facets.addAll(newFacets); |
102 | 102 |
103 Calculation report = res.getReport(); | 103 Calculation report = res.getReport(); |
104 if (report != null && report.hasProblems()) { | 104 if (report != null && report.hasProblems()) { |
105 facets.add(new ReportFacet(ComputeType.ADVANCE, hash, id)); | 105 facets.add(new ReportFacet(ComputeType.ADVANCE, hash, id)); |
106 logger.warn("Problems: " + report.problemsToString()); | 106 log.warn("Problems: " + report.problemsToString()); |
107 } | 107 } |
108 | 108 |
109 return res; | 109 return res; |
110 } | 110 } |
111 | 111 |
117 List<Facet> newFacets, | 117 List<Facet> newFacets, |
118 BedDifferencesResult[] results, | 118 BedDifferencesResult[] results, |
119 String stateId, | 119 String stateId, |
120 String hash | 120 String hash |
121 ) { | 121 ) { |
122 logger.debug("DifferencesState.generateFacets"); | 122 log.debug("DifferencesState.generateFacets"); |
123 | 123 |
124 CallMeta meta = context.getMeta(); | 124 CallMeta meta = context.getMeta(); |
125 | 125 |
126 newFacets.add(new DataFacet(CSV, "CSV data", ComputeType.ADVANCE, hash, id)); | 126 newFacets.add(new DataFacet(CSV, "CSV data", ComputeType.ADVANCE, hash, id)); |
127 newFacets.add(new DataFacet(PDF, "PDF data", ComputeType.ADVANCE, hash, id)); | 127 newFacets.add(new DataFacet(PDF, "PDF data", ComputeType.ADVANCE, hash, id)); |