class IndexSelector {

	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();
	}

	public  IndexSelector(Clock clock);

}