Search in sources :

Example 1 with DynamicWorkflows

use of com.tremolosecurity.provisioning.workflows.DynamicWorkflows in project OpenUnison by TremoloSecurity.

the class SendMessageThread method initWorkFlows.

/* (non-Javadoc)
	 * @see com.tremolosecurity.provisioning.core.ProvisioningEngine#initWorkFlows()
	 */
@Override
public void initWorkFlows() throws ProvisioningException {
    Iterator<String> wfNames = this.workflows.keySet().iterator();
    while (wfNames.hasNext()) {
        String name = wfNames.next();
        this.workflows.get(name).init();
    }
    try {
        if (cfgMgr.getCfg().getProvisioning() != null && cfgMgr.getCfg().getProvisioning().getWorkflows() != null && cfgMgr.getCfg().getProvisioning().getWorkflows().getDynamicWorkflows() != null && cfgMgr.getCfg().getProvisioning().getWorkflows().getDynamicWorkflows().isEnabled()) {
            DynamicPortalUrlsType dynamicWorkflows = cfgMgr.getCfg().getProvisioning().getWorkflows().getDynamicWorkflows();
            String className = dynamicWorkflows.getClassName();
            HashMap<String, Attribute> cfgAttrs = new HashMap<String, Attribute>();
            for (ParamType pt : dynamicWorkflows.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());
            }
            DynamicWorkflows dynWorkflows = (DynamicWorkflows) Class.forName(className).newInstance();
            dynWorkflows.loadDynamicWorkflows(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) ParamType(com.tremolosecurity.config.xml.ParamType) DynamicPortalUrlsType(com.tremolosecurity.config.xml.DynamicPortalUrlsType) DynamicWorkflows(com.tremolosecurity.provisioning.workflows.DynamicWorkflows)

Aggregations

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