summaryrefslogtreecommitdiffstats
path: root/auth/auth-batch/src/main
diff options
context:
space:
mode:
authorArundathi Patil <arundpil@in.ibm.com>2018-12-17 22:45:17 +0530
committerIBM602-PC0F1E3C\Arundathi <arundpil@in.ibm.com>2018-12-17 22:45:36 +0530
commitac83763af54e635eab032835c36b88a6a08f06ea (patch)
tree26138932949c5f88d928539a3af75195d4279bd5 /auth/auth-batch/src/main
parent52c89c9940544c1b2db1dd1e0ce9b22e2fcdca42 (diff)
Sonar Fix: ExpireRange.java
Fixed sonar issues/code-smells across this file Issue-ID: AAF-674 Change-Id: I2dfe1dd8b861af084b9031b186e7cef8f788eded Signed-off-by: Arundathi Patil <arundpil@in.ibm.com>
Diffstat (limited to 'auth/auth-batch/src/main')
-rw-r--r--auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/ExpireRange.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/ExpireRange.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/ExpireRange.java
index a985640b..c459dc66 100644
--- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/ExpireRange.java
+++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/ExpireRange.java
@@ -3,6 +3,8 @@
* org.onap.aaf
* ===========================================================================
* Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ *
+ * Modifications Copyright © 2018 IBM.
* ===========================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,20 +32,19 @@ import java.util.Map;
import java.util.Set;
import org.onap.aaf.cadi.Access;
-import org.onap.aaf.cadi.PropAccess;
public class ExpireRange {
private static final String AAF_BATCH_RANGE = "aaf_batch_range.";
public Map<String,List<Range>> ranges;
public final Date now;
+ public String rangeOneMonth = "OneMonth";
public ExpireRange(final Access access) {
now = new Date();
ranges = new HashMap<>();
int i=0;
String prop = access.getProperty(AAF_BATCH_RANGE + i,null);
- if(prop==null) {
- if(i==0) {
+ if(prop==null && i==0) {
List<Range> lcred = getRangeList("cred");
List<Range> lur = getRangeList("ur");
List<Range> lx509 = getRangeList("x509");
@@ -55,14 +56,13 @@ public class ExpireRange {
lcred.add(new Range("CredOneWeek",3,1,0,0,GregorianCalendar.WEEK_OF_MONTH,1));
lcred.add(new Range("CredTwoWeek",2,1,GregorianCalendar.WEEK_OF_MONTH,1,GregorianCalendar.WEEK_OF_MONTH,2));
- lcred.add(new Range("OneMonth",1,7,GregorianCalendar.WEEK_OF_MONTH,2,GregorianCalendar.MONTH,1));
+ lcred.add(new Range(rangeOneMonth,1,7,GregorianCalendar.WEEK_OF_MONTH,2,GregorianCalendar.MONTH,1));
lcred.add(new Range("TwoMonth",1,0,GregorianCalendar.MONTH,1,GregorianCalendar.MONTH,2));
- lur.add(new Range("OneMonth",1,7,GregorianCalendar.WEEK_OF_MONTH,2,GregorianCalendar.MONTH,1));
+ lur.add(new Range(rangeOneMonth,1,7,GregorianCalendar.WEEK_OF_MONTH,2,GregorianCalendar.MONTH,1));
- lx509.add(new Range("OneMonth",1,7,GregorianCalendar.WEEK_OF_MONTH,2,GregorianCalendar.MONTH,1));
+ lx509.add(new Range(rangeOneMonth,1,7,GregorianCalendar.WEEK_OF_MONTH,2,GregorianCalendar.MONTH,1));
}
- }
}
public Set<String> names() {