Search in sources :

Example 6 with JMSSessionHolder

use of com.tremolosecurity.provisioning.jms.JMSSessionHolder 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

JMSSessionHolder (com.tremolosecurity.provisioning.jms.JMSSessionHolder)6 JMSException (javax.jms.JMSException)4 LDAPAttribute (com.novell.ldap.LDAPAttribute)2 LDAPException (com.novell.ldap.LDAPException)2 ParamType (com.tremolosecurity.config.xml.ParamType)2 Attribute (com.tremolosecurity.saml.Attribute)2 FileNotFoundException (java.io.FileNotFoundException)2 IOException (java.io.IOException)2 UnsupportedEncodingException (java.io.UnsupportedEncodingException)2 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 SocketException (java.net.SocketException)2 InvalidAlgorithmParameterException (java.security.InvalidAlgorithmParameterException)2 InvalidKeyException (java.security.InvalidKeyException)2 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)2 SQLException (java.sql.SQLException)2 HashMap (java.util.HashMap)2 BadPaddingException (javax.crypto.BadPaddingException)2 IllegalBlockSizeException (javax.crypto.IllegalBlockSizeException)2 NoSuchPaddingException (javax.crypto.NoSuchPaddingException)2 MessagingException (javax.mail.MessagingException)2