@Test public void testTimeZoneDate() { RelatedItem product = new RelatedItem("1".toCharArray(),"1920-01-02T01:59:59+02:00",null,new RelatedItemAdditionalProperties()); String name = hourBasedMapper.getLocationName(product); assertEquals(config.getStorageIndexNamePrefix() + "-1920-01-01_23",name); }
@Override public String getLocationName(RelatedItem product) { String dateStr = product.getDate(); String date; if(dateStr==null) { date = currentDayFormatter.getCurrentDayAndHour(); } else { date = currentDayFormatter.parseToDateAndHour(dateStr); } StringBuilder indexName = new StringBuilder(indexNameSize); return indexName.append(this.indexPrefixName).append(date).toString(); }
HourBasedStorageLocationMapper implements RelatedItemStorageLocationMapper { @Override public String getLocationName(RelatedItem product) { String dateStr = product.getDate(); String date; if(dateStr==null) { date = currentDayFormatter.getCurrentDayAndHour(); } else { date = currentDayFormatter.parseToDateAndHour(dateStr); } StringBuilder indexName = new StringBuilder(indexNameSize); return indexName.append(this.indexPrefixName).append(date).toString(); } }
HourBasedStorageLocationMapper implements RelatedItemStorageLocationMapper { @Override public String getLocationName(RelatedItem product) { String dateStr = product.getDate(); String date; if(dateStr==null) { date = currentDayFormatter.getCurrentDayAndHour(); } else { date = currentDayFormatter.parseToDateAndHour(dateStr); } StringBuilder indexName = new StringBuilder(indexNameSize); return indexName.append(this.indexPrefixName).append(date).toString(); } HourBasedStorageLocationMapper(Configuration configuration,
                                          UTCCurrentDateAndHourFormatter dateFormatter); }
HourBasedStorageLocationMapper implements RelatedItemStorageLocationMapper { @Override public String getLocationName(RelatedItem product) { String dateStr = product.getDate(); String date; if(dateStr==null) { date = currentDayFormatter.getCurrentDayAndHour(); } else { date = currentDayFormatter.parseToDateAndHour(dateStr); } StringBuilder indexName = new StringBuilder(indexNameSize); return indexName.append(this.indexPrefixName).append(date).toString(); } HourBasedStorageLocationMapper(Configuration configuration,
                                          UTCCurrentDateAndHourFormatter dateFormatter); @Override String getLocationName(RelatedItem product); }
HourBasedStorageLocationMapper implements RelatedItemStorageLocationMapper { @Override public String getLocationName(RelatedItem product) { String dateStr = product.getDate(); String date; if(dateStr==null) { date = currentDayFormatter.getCurrentDayAndHour(); } else { date = currentDayFormatter.parseToDateAndHour(dateStr); } StringBuilder indexName = new StringBuilder(indexNameSize); return indexName.append(this.indexPrefixName).append(date).toString(); } HourBasedStorageLocationMapper(Configuration configuration,
                                          UTCCurrentDateAndHourFormatter dateFormatter); @Override String getLocationName(RelatedItem product);  }