import org.onap.aaf.auth.batch.reports.Notify;
import org.onap.aaf.auth.env.AuthzTrans;
import org.onap.aaf.cadi.Access;
+import org.onap.aaf.cadi.config.Config;
import org.onap.aaf.misc.env.APIException;
public abstract class NotifyBody {
protected Map<String,List<List<String>>> rows;
private final String name;
private final String type;
+ protected final String env;
private String date;
private int escalation;
+ private int count;
- public NotifyBody(final String type, final String name) {
+ public NotifyBody(Access access, final String type, final String name) {
rows = new TreeMap<>();
this.name = name;
this.type = type;
date="";
escalation = 1;
+ count = 0;
+ env = access.getProperty(Config.AAF_ENV,"DEVL");
}
public void store(List<String> row) {
return name;
}
+ public String type() {
+ return type;
+ }
+
public String date() {
return date;
}
*/
protected abstract String user(List<String> row);
+ public abstract String subject();
+
/**
* Get Notify Body based on key of
* type|name
}
}
}
-
protected void println(StringBuilder sb, int indent, Object ... objs) {
for(int i=0;i<indent;++i) {
sb.append('\n');
}
- protected void printCell(StringBuilder sb, int indent, String current, String prev) {
+ protected String printCell(StringBuilder sb, int indent, String current, String prev) {
if(current.equals(prev)) {
println(sb,indent,DUPL);
} else {
- println(sb,indent,"<td>",current,"</td>");
+ printCell(sb,indent,current);
}
+ return current; // use to set prev...
+ }
+
+ protected void printCell(StringBuilder sb, int indent, String current) {
+ println(sb,indent,"<td>",current,"</td>");
+ }
+
+ public synchronized void inc() {
+ ++count;
+ }
+
+ public int count() {
+ return count;
}
-
}