test_class.declarator: clock
test_class.modifier: private
test_class.original_string: private Clock clock;
test_class.type: Clock
test_class.var_name: clock
test_class.declarator: indexSelector
test_class.modifier: private
test_class.original_string: private IndexSelector indexSelector;
test_class.type: IndexSelector
test_class.var_name: indexSelector
test_class.file: stagemonitor-core/src/test/java/org/stagemonitor/core/elasticsearch/IndexSelectorTest.java
test_class.identifier: IndexSelectorTest
test_case.body: @Test
  	public void testSelectIndexYearChange33Days() throws Exception {
  		final String indexPattern = indexSelector.getIndexPatternOlderThanDays("metrics-", 33);
  		assertEquals("metrics-*,-metrics-1970.01.*,-metrics-1969.12.*,-metrics-1969.11.30,-metrics-1969.11.29", indexPattern);
  	}
test_case.class_method_signature: IndexSelectorTest.testSelectIndexYearChange33Days()
test_case.full_signature: @Test public void testSelectIndexYearChange33Days()
test_case.identifier: testSelectIndexYearChange33Days
test_case.invocations: getIndexPatternOlderThanDays assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testSelectIndexYearChange33Days()
focal_class.declarator: clock
focal_class.modifier: private final
focal_class.original_string: private final Clock clock;
focal_class.type: Clock
focal_class.var_name: clock
focal_class.file: stagemonitor-core/src/main/java/org/stagemonitor/core/elasticsearch/IndexSelector.java
focal_class.identifier: IndexSelector
focal_class.class_method_signature: IndexSelector.IndexSelector(Clock clock)
focal_class.full_signature: public  IndexSelector(Clock clock)
focal_class.identifier: IndexSelector
focal_class.modifiers: public
focal_class.parameters: (Clock clock)
focal_class.signature:  IndexSelector(Clock clock)
focal_class.class_method_signature: IndexSelector.getIndexPatternOlderThanDays(String prefix, int days)
focal_class.full_signature: public String getIndexPatternOlderThanDays(String prefix, int days)
focal_class.identifier: getIndexPatternOlderThanDays
focal_class.modifiers: public
focal_class.parameters: (String prefix, int days)
focal_class.return: String
focal_class.signature: String getIndexPatternOlderThanDays(String prefix, int days)
focal_class.class_method_signature: IndexSelector.excludeMonths(String prefix, GregorianCalendar now, StringBuilder sb, GregorianCalendar lastDayToExclude, GregorianCalendar alreadyExcluded)
focal_class.full_signature: private void excludeMonths(String prefix, GregorianCalendar now, StringBuilder sb, GregorianCalendar lastDayToExclude, GregorianCalendar alreadyExcluded)
focal_class.identifier: excludeMonths
focal_class.modifiers: private
focal_class.parameters: (String prefix, GregorianCalendar now, StringBuilder sb, GregorianCalendar lastDayToExclude, GregorianCalendar alreadyExcluded)
focal_class.return: void
focal_class.signature: void excludeMonths(String prefix, GregorianCalendar now, StringBuilder sb, GregorianCalendar lastDayToExclude, GregorianCalendar alreadyExcluded)
focal_class.class_method_signature: IndexSelector.excludeDays(String prefix, StringBuilder sb, GregorianCalendar lastDayToExclude, GregorianCalendar alreadyExcluded)
focal_class.full_signature: private void excludeDays(String prefix, StringBuilder sb, GregorianCalendar lastDayToExclude, GregorianCalendar alreadyExcluded)
focal_class.identifier: excludeDays
focal_class.modifiers: private
focal_class.parameters: (String prefix, StringBuilder sb, GregorianCalendar lastDayToExclude, GregorianCalendar alreadyExcluded)
focal_class.return: void
focal_class.signature: void excludeDays(String prefix, StringBuilder sb, GregorianCalendar lastDayToExclude, GregorianCalendar alreadyExcluded)
focal_class.class_method_signature: IndexSelector.getLastDayToExclude(int days)
focal_class.full_signature: private GregorianCalendar getLastDayToExclude(int days)
focal_class.identifier: getLastDayToExclude
focal_class.modifiers: private
focal_class.parameters: (int days)
focal_class.return: GregorianCalendar
focal_class.signature: GregorianCalendar getLastDayToExclude(int days)
focal_class.class_method_signature: IndexSelector.getNowUTC()
focal_class.full_signature: private GregorianCalendar getNowUTC()
focal_class.identifier: getNowUTC
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: GregorianCalendar
focal_class.signature: GregorianCalendar getNowUTC()
focal_class.class_method_signature: IndexSelector.formatTwoDigitsLeadingZero(int i)
focal_class.full_signature: private static String formatTwoDigitsLeadingZero(int i)
focal_class.identifier: formatTwoDigitsLeadingZero
focal_class.modifiers: private static
focal_class.parameters: (int i)
focal_class.return: String
focal_class.signature: String formatTwoDigitsLeadingZero(int i)
focal_method.body: public String getIndexPatternOlderThanDays(String prefix, int days) {
  		// select all indices, then exclude months and days that are not older than the days parameter
  		// Example:
  		// stagemonitor-metrics-*,-stagemonitor-metrics-2015.10.*,-stagemonitor-metrics-2015.09.30
  		final StringBuilder indexPattern = new StringBuilder(prefix).append('*');
  
  		final GregorianCalendar now = getNowUTC();
  		final GregorianCalendar lastDayToExclude = getLastDayToExclude(days);
  		final GregorianCalendar alreadyExcluded = getNowUTC();
  
  		excludeMonths(prefix, now, indexPattern, lastDayToExclude, alreadyExcluded);
  		excludeDays(prefix, indexPattern, lastDayToExclude, alreadyExcluded);
  
  		return indexPattern.toString();
  	}
focal_method.class_method_signature: IndexSelector.getIndexPatternOlderThanDays(String prefix, int days)
focal_method.full_signature: public String getIndexPatternOlderThanDays(String prefix, int days)
focal_method.identifier: getIndexPatternOlderThanDays
focal_method.invocations: append getNowUTC getLastDayToExclude getNowUTC excludeMonths excludeDays toString
focal_method.modifiers: public
focal_method.parameters: (String prefix, int days)
focal_method.return: String
focal_method.signature: String getIndexPatternOlderThanDays(String prefix, int days)