* 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.
import org.onap.aaf.auth.layer.Result;
import org.onap.aaf.auth.org.OrganizationException;
import org.onap.aaf.cadi.CadiException;
-import org.onap.aaf.cadi.client.Holder;
+import org.onap.aaf.cadi.util.Holder;
import org.onap.aaf.cadi.util.CSV;
import org.onap.aaf.misc.env.APIException;
import org.onap.aaf.misc.env.Env;
private List<File> extFiles;
private final int extendBy;
private int gcType;
-
+
public Extend(AuthzTrans trans) throws APIException, IOException, OrganizationException {
super(trans.env());
trans.info().log("Starting Connection Process");
-
+
noAvg = env.newTransNoAvg();
noAvg.setUser(new BatchPrincipal("Extend"));
} finally {
tt.done();
}
- cqlBatch = new CQLBatch(noAvg.info(),session);
+ cqlBatch = new CQLBatch(noAvg.info(),session);
} finally {
tt0.done();
}
gcType = GregorianCalendar.WEEK_OF_YEAR;
int weeks = 4;
-
+
Set<String> cmd = new HashSet<>();
for(int i=0; i< args().length;++i) {
if("-weeks".equals(args()[i])) {
cmd.add(args()[i]);
}
}
-
+
if(weeks<1 || weeks > 24) {
throw new APIException("Invalid --weeks");
}
extendBy = weeks;
- // Create Intermediate Output
+ // Create Intermediate Output
File logDir = logDir();
extFiles = new ArrayList<>();
if(cmd.isEmpty()) {
extFiles.add(new File(logDir, fn));
}
}
-
+
// Load Cred. We don't follow Visitor, because we have to gather up everything into Identity Anyway
// to find the last one.
}
CSV csv = new CSV(env.access(),f);
try {
csv.visit(new CSV.Visitor() {
- final Holder<Integer> hi = new Holder<>(0);
+ final Holder<Integer> hi = new Holder<>(0);
@Override
public void visit(List<String> row) throws IOException, CadiException {
int i = hi.get();
StringBuilder sb = hsb.get();
if(sb==null) {
- hsb.set(sb=cqlBatch.begin());
+ sb=cqlBatch.begin();
+ hsb.set(sb);
}
switch(row.get(0)) {
case "info":
e.printStackTrace();
}
}
-
+
// Cleanup, if required.
cqlBatch.execute(dryRun);
}
-
+
@Override
protected void _close(AuthzTrans trans) {
trans.info().log("End " + this.getClass().getSimpleName() + " processing" );