Search in sources :

Example 6 with ReportType

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);
        }
    }
}
Also used : JSONObject(org.json.simple.JSONObject) ReportType(com.tremolosecurity.config.xml.ReportType)

Aggregations

ReportType (com.tremolosecurity.config.xml.ReportType)6 OrgType (com.tremolosecurity.config.xml.OrgType)3 AuthInfo (com.tremolosecurity.proxy.auth.AuthInfo)3 AzSys (com.tremolosecurity.proxy.auth.AzSys)3 IOException (java.io.IOException)3 HashSet (java.util.HashSet)3 Gson (com.google.gson.Gson)2 ReportsType (com.tremolosecurity.config.xml.ReportsType)2 ProvisioningException (com.tremolosecurity.provisioning.core.ProvisioningException)2 ProvisioningError (com.tremolosecurity.provisioning.service.util.ProvisioningError)2 ProvisioningResult (com.tremolosecurity.provisioning.service.util.ProvisioningResult)2 ReportInformation (com.tremolosecurity.provisioning.service.util.ReportInformation)2 ReportsList (com.tremolosecurity.provisioning.service.util.ReportsList)2 AuthController (com.tremolosecurity.proxy.auth.AuthController)2 ScaleError (com.tremolosecurity.scalejs.data.ScaleError)2 Connection (java.sql.Connection)2 SQLException (java.sql.SQLException)2 ServletException (javax.servlet.ServletException)2 RichTextString (org.apache.poi.ss.usermodel.RichTextString)2 XSSFRichTextString (org.apache.poi.xssf.usermodel.XSSFRichTextString)2