use of com.tremolosecurity.config.xml.ReportType in project OpenUnison by TremoloSecurity.
the class LoadReportsFromK8s method deleteObject.
@Override
public void deleteObject(TremoloType cfg, JSONObject item) throws ProvisioningException {
JSONObject metadata = (JSONObject) item.get("metadata");
String name = (String) metadata.get("name");
JSONObject spec = (JSONObject) item.get("spec");
logger.info("Deleting report '" + name + "'");
String reportName = (String) spec.get("name");
synchronized (this.cfgMgr.getCfg().getProvisioning().getReports()) {
ReportType existingRep = null;
for (ReportType rt : this.cfgMgr.getCfg().getProvisioning().getReports().getReport()) {
if (rt.getName().equals(reportName)) {
existingRep = rt;
break;
}
}
if (existingRep != null) {
this.cfgMgr.getCfg().getProvisioning().getReports().getReport().remove(existingRep);
}
}
}
Aggregations