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.reports.bodies;
23 import java.util.List;
25 import org.onap.aaf.auth.batch.reports.Notify;
26 import org.onap.aaf.auth.env.AuthzTrans;
27 import org.onap.aaf.cadi.Access;
29 public class NotifyPendingApprBody extends NotifyBody {
30 private final String explanation;
32 public NotifyPendingApprBody(Access access) {
33 super(access,"appr","PendingApproval");
34 explanation = "The following Approvals are awaiting your action. ";
38 public boolean body(AuthzTrans trans, StringBuilder sb, int indent, Notify n, String id) {
39 println(sb,indent,explanation);
40 /* println(sb,indent,"<table>");
42 println(sb,indent,"<tr>");
44 println(sb,indent,"<th>Fully Qualified ID</th>");
45 println(sb,indent,"<th>Unique ID</th>");
46 println(sb,indent,"<th>Type</th>");
47 println(sb,indent,"<th>Expires</th>");
48 println(sb,indent,"<th>Warnings</th>");
50 println(sb,indent,"</tr>");
51 String theid, type, info, expires, warnings;
52 GregorianCalendar gc = new GregorianCalendar();
53 for(List<String> row : rows.get(id)) {
61 type = "x509 (Certificate)";
64 type = "Unknown, see AAF GUI";
67 theid = "<a href=\""+n.guiURL+"/creddetail?ns="+row.get(2)+"\">"+theid+"</a>";
68 gc.setTimeInMillis(Long.parseLong(row.get(5)));
69 expires = Chrono.niceUTCStamp(gc);
74 println(sb,indent,"<tr>");
76 printCell(sb,indent,theid);
77 printCell(sb,indent,info);
78 printCell(sb,indent,type);
79 printCell(sb,indent,expires);
80 printCell(sb,indent,warnings);
82 println(sb,indent,"</tr>");
85 println(sb,indent,"</table>");
91 public String user(List<String> row) {
92 if( (row != null) && row.size()>1) {
99 public String subject() {
100 return String.format("AAF Pending Approval Notification (ENV: %s)",env);