Search in sources :

Example 1 with DynamicQueueListeners

use of com.tremolosecurity.provisioning.listeners.DynamicQueueListeners 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)

Aggregations

LDAPAttribute (com.novell.ldap.LDAPAttribute)1 LDAPException (com.novell.ldap.LDAPException)1 DynamicPortalUrlsType (com.tremolosecurity.config.xml.DynamicPortalUrlsType)1 MessageListenerType (com.tremolosecurity.config.xml.MessageListenerType)1 ParamType (com.tremolosecurity.config.xml.ParamType)1 JMSSessionHolder (com.tremolosecurity.provisioning.jms.JMSSessionHolder)1 DynamicQueueListeners (com.tremolosecurity.provisioning.listeners.DynamicQueueListeners)1 Attribute (com.tremolosecurity.saml.Attribute)1 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 SocketException (java.net.SocketException)1 InvalidAlgorithmParameterException (java.security.InvalidAlgorithmParameterException)1 InvalidKeyException (java.security.InvalidKeyException)1 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)1 SQLException (java.sql.SQLException)1 HashMap (java.util.HashMap)1 BadPaddingException (javax.crypto.BadPaddingException)1 IllegalBlockSizeException (javax.crypto.IllegalBlockSizeException)1