* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
public final Range approveDelete ;
private Range delRange;
-
+
public ExpireRange(final Access access) {
ranges = new HashMap<>();
intervalDates = new HashMap<>();
List<Range> lcred = getRangeList("cred");
List<Range> lur = getRangeList("ur");
List<Range> lx509 = getRangeList("x509");
-
-
+
+
/*
Range(Name, ReportingLevel, PeopleInterval, AppInterval, Start(Type,Qty) End(Type,Qty) )
Interval of -1 Means "only once"
lur.add(delRange);
lcred.add(delRange);
lx509.add(delRange);
-
+
lcred.add(new Range(ONE_WEEK ,3,-1,1,0,0,GregorianCalendar.WEEK_OF_MONTH,1));
lcred.add(new Range(TWO_WEEK ,2,-1,-1,GregorianCalendar.WEEK_OF_MONTH,1,GregorianCalendar.WEEK_OF_MONTH,2));
lcred.add(new Range(ONE_MONTH,1,7,7,GregorianCalendar.WEEK_OF_MONTH,2,GregorianCalendar.MONTH,1));
lcred.add(new Range(TWO_MONTH,1,-1,-1,GregorianCalendar.MONTH,1,GregorianCalendar.MONTH,2));
-
+
lur.add( new Range(ONE_MONTH,1,-1,-1,0,0,GregorianCalendar.MONTH,1));
// Comment out until we can get some more clear actions in place for GUI
// lur.add( new Range(ONE_MONTH,1,-1,-1,GregorianCalendar.WEEK_OF_MONTH,2,GregorianCalendar.MONTH,1));
// lur.add( new Range(ONE_WEEK,2,-1,1,0,0,GregorianCalendar.WEEK_OF_MONTH,1));
-
+
lx509.add(new Range(ONE_MONTH,1,-1,-1,GregorianCalendar.WEEK_OF_MONTH,2,GregorianCalendar.MONTH,1));
}
}
-
+
public Range newFutureRange() {
return new Range("Approval",7,7,1,0,0,GregorianCalendar.MONTH,1);
}
-
+
public Set<String> names() {
Set<String> names = new HashSet<>();
for(List<Range> lr : ranges.values()) {
return names;
}
-
+
private synchronized List<Range> getRangeList(final String key) {
List<Range> rv = ranges.get(key);
if(rv==null) {
}
return rv;
}
-
+
public class Range {
private final String name;
private final int reportingLevel;
private final Date start;
private final Date end;
private final Date lowerValid;
-
+
public Range(
- final String name, final int reportingLevel,
- final int peopleInterval, final int appInterval,
- final int startGCType, final int startQty,
+ final String name, final int reportingLevel,
+ final int peopleInterval, final int appInterval,
+ final int startGCType, final int startQty,
final int endGCType,final int endQty) {
this.name = name;
this.reportingLevel = reportingLevel;
gc.add(startGCType, startQty);
}
start = gc.getTime();
-
+
if(endGCType<0) {
gc.set(GregorianCalendar.YEAR, 1);
} else {
gc.add(endGCType, endQty);
}
end = gc.getTime();
-
+
if(endGCType<0) {
gc.set(GregorianCalendar.YEAR, -1);
lowerValid = gc.getTime();
}
-
+
public String name() {
return name;
}
-
+
public int reportingLevel() {
return reportingLevel;
}
public Date getStart() {
return start;
}
-
+
public Date getEnd() {
return end;
}
-
+
public boolean inRange(final Date date) {
if(date==null) {
return false;
public Date now() {
return now;
}
-
+
}