Search in sources :

Example 6 with DynamicPortalUrlsType

use of com.tremolosecurity.config.xml.DynamicPortalUrlsType in project OpenUnison by TremoloSecurity.

the class SendMessageThread method initListeners.

@Override
public void initListeners() throws ProvisioningException {
    this.listenerSessions = new HashMap<String, JMSSessionHolder>();
    if (this.cfgMgr.getCfg().getProvisioning() == null || this.cfgMgr.getCfg().getProvisioning().getListeners() == null) {
        logger.warn("No listeners defined");
        return;
    }
    try {
        for (MessageListenerType mlt : this.cfgMgr.getCfg().getProvisioning().getListeners().getListener()) {
            addMessageListener(mlt);
        }
        if (cfgMgr.getCfg().getProvisioning().getListeners().getDynamicListeners() != null && cfgMgr.getCfg().getProvisioning().getListeners().getDynamicListeners().isEnabled()) {
            DynamicPortalUrlsType dynamicMessageListeners = cfgMgr.getCfg().getProvisioning().getListeners().getDynamicListeners();
            String className = dynamicMessageListeners.getClassName();
            HashMap<String, Attribute> cfgAttrs = new HashMap<String, Attribute>();
            for (ParamType pt : dynamicMessageListeners.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());
            }
            DynamicQueueListeners dynamicQueueListener = (DynamicQueueListeners) Class.forName(className).newInstance();
            dynamicQueueListener.loadDynamicQueueListeners(cfgMgr, this, cfgAttrs);
        }
    } catch (Exception e) {
        logger.warn("Could not initialize listeners", e);
    }
}
Also used : Attribute(com.tremolosecurity.saml.Attribute) LDAPAttribute(com.novell.ldap.LDAPAttribute) HashMap(java.util.HashMap) DynamicPortalUrlsType(com.tremolosecurity.config.xml.DynamicPortalUrlsType) JMSSessionHolder(com.tremolosecurity.provisioning.jms.JMSSessionHolder) DynamicQueueListeners(com.tremolosecurity.provisioning.listeners.DynamicQueueListeners) ParamType(com.tremolosecurity.config.xml.ParamType) InvocationTargetException(java.lang.reflect.InvocationTargetException) NoSuchAlgorithmException(java.security.NoSuchAlgorithmException) InvalidKeyException(java.security.InvalidKeyException) LDAPException(com.novell.ldap.LDAPException) InvalidAlgorithmParameterException(java.security.InvalidAlgorithmParameterException) SocketException(java.net.SocketException) SQLException(java.sql.SQLException) SchedulerException(org.quartz.SchedulerException) IOException(java.io.IOException) MessagingException(javax.mail.MessagingException) IllegalBlockSizeException(javax.crypto.IllegalBlockSizeException) JMSException(javax.jms.JMSException) JAXBException(javax.xml.bind.JAXBException) FileNotFoundException(java.io.FileNotFoundException) UnsupportedEncodingException(java.io.UnsupportedEncodingException) NoSuchPaddingException(javax.crypto.NoSuchPaddingException) BadPaddingException(javax.crypto.BadPaddingException) MessageListenerType(com.tremolosecurity.config.xml.MessageListenerType)

Example 7 with DynamicPortalUrlsType

use of com.tremolosecurity.config.xml.DynamicPortalUrlsType 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

DynamicPortalUrlsType (com.tremolosecurity.config.xml.DynamicPortalUrlsType)7 ParamType (com.tremolosecurity.config.xml.ParamType)7 Attribute (com.tremolosecurity.saml.Attribute)7 HashMap (java.util.HashMap)7 LDAPAttribute (com.novell.ldap.LDAPAttribute)5 IOException (java.io.IOException)3 LDAPException (com.novell.ldap.LDAPException)2 AuthChainType (com.tremolosecurity.config.xml.AuthChainType)2 AuthMechParamType (com.tremolosecurity.config.xml.AuthMechParamType)2 MechanismType (com.tremolosecurity.config.xml.MechanismType)2 ProvisioningException (com.tremolosecurity.provisioning.core.ProvisioningException)2 FileNotFoundException (java.io.FileNotFoundException)2 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)2 ApplicationType (com.tremolosecurity.config.xml.ApplicationType)1 ErrorPage (com.tremolosecurity.config.xml.ApplicationsType.ErrorPage)1 AuthMechType (com.tremolosecurity.config.xml.AuthMechType)1 AuthMechTypes (com.tremolosecurity.config.xml.AuthMechTypes)1 ConfigType (com.tremolosecurity.config.xml.ConfigType)1 CustomAzRuleType (com.tremolosecurity.config.xml.CustomAzRuleType)1 JobType (com.tremolosecurity.config.xml.JobType)1