Search in sources :

Example 1 with DynamicReports

use of com.tremolosecurity.provisioning.reports.DynamicReports in project OpenUnison by TremoloSecurity.

the class SendMessageThread method initReports.

@Override
public void initReports() throws ProvisioningException {
    try {
        if (cfgMgr.getCfg().getProvisioning() != null && cfgMgr.getCfg().getProvisioning().getReports() != null && cfgMgr.getCfg().getProvisioning().getReports().getDynamicReports() != null && cfgMgr.getCfg().getProvisioning().getReports().getDynamicReports().isEnabled()) {
            DynamicPortalUrlsType dynamicReports = cfgMgr.getCfg().getProvisioning().getReports().getDynamicReports();
            String className = dynamicReports.getClassName();
            HashMap<String, Attribute> cfgAttrs = new HashMap<String, Attribute>();
            for (ParamType pt : dynamicReports.getParams()) {
                Attribute attr = cfgAttrs.get(pt.getName());
                if (attr == null) {
                    attr = new Attribute(pt.getName());
                    cfgAttrs.put(pt.getName(), attr);
                }
                attr.getValues().add(pt.getValue());
            }
            DynamicReports dynamicReport = (DynamicReports) Class.forName(className).newInstance();
            dynamicReport.loadDynamicReports(cfgMgr, this, cfgAttrs);
        }
    } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
        throw new ProvisioningException("Could not initialize dynamic targets", e);
    }
}
Also used : Attribute(com.tremolosecurity.saml.Attribute) LDAPAttribute(com.novell.ldap.LDAPAttribute) HashMap(java.util.HashMap) DynamicReports(com.tremolosecurity.provisioning.reports.DynamicReports) DynamicPortalUrlsType(com.tremolosecurity.config.xml.DynamicPortalUrlsType) ParamType(com.tremolosecurity.config.xml.ParamType)

Aggregations

LDAPAttribute (com.novell.ldap.LDAPAttribute)1 DynamicPortalUrlsType (com.tremolosecurity.config.xml.DynamicPortalUrlsType)1 ParamType (com.tremolosecurity.config.xml.ParamType)1 DynamicReports (com.tremolosecurity.provisioning.reports.DynamicReports)1 Attribute (com.tremolosecurity.saml.Attribute)1 HashMap (java.util.HashMap)1