@@ -36,7 +36,6 @@ public class CouchbaseWeatherSource implements WeatherSource {
3636 private static final Logger logger = LogManager .getLogger (CouchbaseWeatherSource .class );
3737
3838 private static final NamingConvention DEFAULT_NAMING_CONVENTION = NamingConvention .FLAT ;
39- private static final String DEFAULT_TIMESTAMP_PATTERN = "yyyy-MM-dd'T'HH:mm:ssxxx" ;
4039 /** The start of the document key, comparable to a table name in relational databases */
4140 private static final String DEFAULT_KEY_PREFIX = "weather" ;
4241
@@ -59,20 +58,13 @@ public class CouchbaseWeatherSource implements WeatherSource {
5958 * @param coordinateSource Source to obtain actual coordinates from
6059 * @param weatherFactory Factory to transfer field to value mapping into actual java object
6160 * instances
62- * @param timeStampPattern Pattern of time stamps to parse
6361 */
6462 public CouchbaseWeatherSource (
6563 CouchbaseConnector connector ,
6664 IdCoordinateSource coordinateSource ,
67- TimeBasedWeatherValueFactory weatherFactory ,
68- String timeStampPattern ) {
65+ TimeBasedWeatherValueFactory weatherFactory ) {
6966 this (
70- connector ,
71- coordinateSource ,
72- DEFAULT_KEY_PREFIX ,
73- DEFAULT_TIMESTAMP_PATTERN ,
74- DEFAULT_NAMING_CONVENTION ,
75- weatherFactory );
67+ connector , coordinateSource , DEFAULT_KEY_PREFIX , DEFAULT_NAMING_CONVENTION , weatherFactory );
7668 }
7769
7870 /**
@@ -85,22 +77,15 @@ public CouchbaseWeatherSource(
8577 * @param weatherFactory Factory to transfer field to value mapping into actual java object
8678 * instances
8779 * @deprecated Use {@link CouchbaseWeatherSource#CouchbaseWeatherSource(CouchbaseConnector,
88- * IdCoordinateSource, String, String, NamingConvention, TimeBasedWeatherValueFactory)}
89- * instead
80+ * IdCoordinateSource, String, NamingConvention, TimeBasedWeatherValueFactory)} instead
9081 */
9182 @ Deprecated
9283 public CouchbaseWeatherSource (
9384 CouchbaseConnector connector ,
9485 IdCoordinateSource coordinateSource ,
9586 String keyPrefix ,
9687 TimeBasedWeatherValueFactory weatherFactory ) {
97- this (
98- connector ,
99- coordinateSource ,
100- keyPrefix ,
101- DEFAULT_TIMESTAMP_PATTERN ,
102- DEFAULT_NAMING_CONVENTION ,
103- weatherFactory );
88+ this (connector , coordinateSource , keyPrefix , DEFAULT_NAMING_CONVENTION , weatherFactory );
10489 }
10590
10691 /**
@@ -110,7 +95,6 @@ public CouchbaseWeatherSource(
11095 * @param connector Connector, that establishes the connection to the couchbase instance
11196 * @param coordinateSource Source to obtain actual coordinates from
11297 * @param keyPrefix Prefix of entries, that belong to weather
113- * @param timeStampPattern Pattern of time stamps to parse
11498 * @param namingConvention the (case) convention, how columns are named
11599 * @param weatherFactory Factory to transfer field to value mapping into actual java object
116100 * instances
@@ -119,14 +103,13 @@ public CouchbaseWeatherSource(
119103 CouchbaseConnector connector ,
120104 IdCoordinateSource coordinateSource ,
121105 String keyPrefix ,
122- String timeStampPattern ,
123106 NamingConvention namingConvention ,
124107 TimeBasedWeatherValueFactory weatherFactory ) {
125108 this .connector = connector ;
126109 this .coordinateSource = coordinateSource ;
127110 this .keyPrefix = keyPrefix ;
128111 this .weatherFactory = weatherFactory ;
129- this .timeStampPattern = timeStampPattern ;
112+ this .timeStampPattern = weatherFactory . getTimeStampPattern () ;
130113 this .namingConvention = namingConvention ;
131114 this .coordinateIdColumnName = weatherFactory .getCoordinateIdFieldString (namingConvention );
132115 }
0 commit comments