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.io.IOException;
24 import java.util.List;
26 import org.onap.aaf.auth.batch.reports.Notify;
27 import org.onap.aaf.auth.env.AuthzTrans;
28 import org.onap.aaf.cadi.Access;
30 public abstract class NotifyCredBody extends NotifyBody {
32 private final String explanation;
33 public NotifyCredBody(Access access, String name) throws IOException {
37 explanation = "The following Credentials are expiring on the dates shown. "
38 + "Failure to act before the expiration date will cause your App's Authentications to fail.";
42 public boolean body(AuthzTrans trans, StringBuilder sb, int indent, Notify n, String id) {
43 println(sb,indent,explanation);
44 println(sb,indent,"<br><br>");
45 println(sb,indent,"<table>");
47 println(sb,indent,"<tr>");
49 println(sb,indent,"<th>Fully Qualified ID</th>");
50 println(sb,indent,"<th>Type</th>");
51 println(sb,indent,"<th>Details</th>");
52 println(sb,indent,"<th>Expires</th>");
53 println(sb,indent,"<th>Cred Detail Page</th>");
55 println(sb,indent,"</tr>");
56 String theid, type, info, gui, expires, notes;
57 String p_theid=null, p_type=null, p_gui=null, p_expires=null;
58 for(List<String> row : rows.get(id)) {
65 type = "x509 (Certificate)";
68 type = "Unknown, see AAF GUI";
71 gui = "<a href=\""+n.guiURL+"/creddetail?ns="+row.get(2)+"\">"+row.get(2)+"</a>";
75 if(notes!=null && !notes.isEmpty()) {
76 info += "<br>" + notes;
79 println(sb,indent,"<tr>");
81 printCell(sb,indent,theid,p_theid);
82 printCell(sb,indent,type,p_type);
83 printCell(sb,indent,info,null);
84 printCell(sb,indent,expires,p_expires);
85 printCell(sb,indent,gui,p_gui);
87 println(sb,indent,"</tr>");
94 println(sb,indent,"</table>");
100 public String user(List<String> row) {
101 if( (row != null) && row.size()>1) {