2 * ============LICENSE_START====================================================
4 * ===========================================================================
5 * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
6 * ===========================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END====================================================
21 package org.onap.aaf.auth.batch.approvalsets;
23 import java.text.ParseException;
24 import java.util.Date;
25 import java.util.List;
27 import org.onap.aaf.cadi.util.CSV.Writer;
28 import org.onap.aaf.misc.env.util.Chrono;
30 public class Pending {
31 public static final String REMIND = "remind";
38 * Use this Constructor when there is no Last Notified Date
47 * Use this constructor to indicate when last Notified
48 * @param last_notified
50 public Pending(Date last_notified) {
52 hasNew = last_notified==null;
53 earliest = last_notified;
59 * @throws ParseException
61 public Pending(List<String> row) throws ParseException {
62 hasNew = Boolean.parseBoolean(row.get(2));
63 String d = row.get(3);
64 if(d==null || d.isEmpty()) {
67 earliest = Chrono.dateOnlyFmt.parse(d);
69 qty = Integer.parseInt(row.get(4));
77 public void row(Writer approveCW, String key) {
78 approveCW.row(REMIND,key,hasNew,Chrono.dateOnlyStamp(earliest),qty);
85 public void inc(Pending value) {
89 public void earliest(Date lastnotified) {
90 if(lastnotified==null) {
92 } else if (earliest==null || lastnotified.before(earliest)) {
93 earliest = lastnotified;
101 public Date earliest() {
105 public boolean newApprovals() {