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);
}
}
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);
}
}
Aggregations