@Override public void send(ProducerBrokerExchange producerExchange, final Message messageSend) throws Exception { ActiveMQDestination activeMQDestination = messageSend.getDestination(); if (!interceptorMap.isEmpty() && activeMQDestination != null) { Set<MessageInterceptor> set = interceptorMap.get(activeMQDestination); if (set != null && !set.isEmpty()) { for (MessageInterceptor mi : set) { mi.intercept(producerExchange, messageSend); } } else { super.send(producerExchange, messageSend); } } else { super.send(producerExchange, messageSend); } } }
public void send(ProducerBrokerExchange producerExchange, Message messageSend) throws Exception { final ConnectionContext context = producerExchange.getConnectionContext(); String userID = context.getUserName(); if (isUseAuthenticatePrincipal()) { SecurityContext securityContext = context.getSecurityContext(); if (securityContext != null) { Set<?> principals = securityContext.getPrincipals(); if (principals != null) { for (Object candidate : principals) { if (candidate instanceof UserPrincipal) { userID = ((UserPrincipal)candidate).getName(); break; } } } } } messageSend.setUserID(userID); super.send(producerExchange, messageSend); }
@Override public void send(ProducerBrokerExchange producerExchange, Message messageSend) throws Exception { final SecurityContext securityContext = checkSecurityContext(producerExchange.getConnectionContext()); if (!securityContext.isBrokerContext() && !securityContext.getAuthorizedWriteDests().containsValue(messageSend.getDestination())) { Set<?> allowedACLs = null; if (!messageSend.getDestination().isTemporary()) { allowedACLs = authorizationMap.getWriteACLs(messageSend.getDestination()); } else { allowedACLs = authorizationMap.getTempDestinationWriteACLs(); } if (allowedACLs != null && !securityContext.isInOneOf(allowedACLs)) { throw new SecurityException("User " + securityContext.getUserName() + " is not authorized to write to: " + messageSend.getDestination()); } securityContext.getAuthorizedWriteDests().put(messageSend.getDestination(), messageSend.getDestination()); } super.send(producerExchange, messageSend); }
/** * Re-inject into the Broker chain */ void injectMessage(ProducerBrokerExchange producerExchange, final Message messageSend) throws Exception { ProducerBrokerExchange pe = producerExchange; if (pe == null) { pe = new ProducerBrokerExchange(); ConnectionContext cc = new ConnectionContext(); cc.setBroker(this.getRoot()); pe.setConnectionContext(cc); pe.setMutable(true); pe.setProducerState(new ProducerState(new ProducerInfo())); } super.send(pe, messageSend); }
super.send(producerExchange, messageSend);
producerExchange.setMutable(true); producerExchange.setProducerState(new ProducerState(new ProducerInfo())); super.send(producerExchange, messageSend); } catch (Exception e) { LOG.error("Failed to send scheduled message {}", id, e);
/** * Overide methods to pause the broker whilst camel routes are loaded */ @Override public void send(ProducerBrokerExchange producerExchange, Message message) throws Exception { blockWhileLoadingCamelRoutes(); super.send(producerExchange, message); }
/** * Overide methods to pause the broker whilst camel routes are loaded */ @Override public void send(ProducerBrokerExchange producerExchange, Message message) throws Exception { blockWhileLoadingCamelRoutes(); super.send(producerExchange, message); }
@Override public void send(ProducerBrokerExchange producerExchange, final Message messageSend) throws Exception { ActiveMQDestination activeMQDestination = messageSend.getDestination(); if (!interceptorMap.isEmpty() && activeMQDestination != null) { Set<MessageInterceptor> set = interceptorMap.get(activeMQDestination); if (set != null && !set.isEmpty()) { for (MessageInterceptor mi : set) { mi.intercept(producerExchange, messageSend); } } else { super.send(producerExchange, messageSend); } } else { super.send(producerExchange, messageSend); } } }
@Override public void send(ProducerBrokerExchange producerExchange, final Message messageSend) throws Exception { ActiveMQDestination activeMQDestination = messageSend.getDestination(); if (!interceptorMap.isEmpty() && activeMQDestination != null) { Set<MessageInterceptor> set = interceptorMap.get(activeMQDestination); if (set != null && !set.isEmpty()) { for (MessageInterceptor mi : set) { mi.intercept(producerExchange, messageSend); } } else { super.send(producerExchange, messageSend); } } else { super.send(producerExchange, messageSend); } } }
@Override public void send(ProducerBrokerExchange producerExchange, final Message messageSend) throws Exception { ActiveMQDestination activeMQDestination = messageSend.getDestination(); if (!interceptorMap.isEmpty() && activeMQDestination != null) { Set<MessageInterceptor> set = interceptorMap.get(activeMQDestination); if (set != null && !set.isEmpty()) { for (MessageInterceptor mi : set) { mi.intercept(producerExchange, messageSend); } } else { super.send(producerExchange, messageSend); } } else { super.send(producerExchange, messageSend); } } }
public void send(ConnectionContext context, Message messageSend) throws Exception { SecurityContext subject = context.getSecurityContext(); if (subject == null) throw new SecurityException("User is not authenticated."); if (!subject.getAuthorizedWriteDests().contains(messageSend.getDestination())) { if (messageSend.getDestination().getPhysicalName().equals(Constants.NOTIFICATION_UPDATES_QUEUE)) { if (!subject.getPrincipals().contains(Constants.defaultSystemRole)) { throw new SecurityException("User " + subject.getUserName() + " is not authorized to write to: " + messageSend.getDestination()); } } else if (messageSend.getDestination().getPhysicalName().equals(Constants.NOTIFICATION_CONTROL_QUEUE)) { } subject.getAuthorizedWriteDests().put(messageSend.getDestination(), messageSend.getDestination()); } super.send(context, messageSend); }
public void send(ProducerBrokerExchange producerExchange, Message messageSend) throws Exception { final ConnectionContext context = producerExchange.getConnectionContext(); String userID = context.getUserName(); if (isUseAuthenticatePrincipal()) { SecurityContext securityContext = context.getSecurityContext(); if (securityContext != null) { Set<?> principals = securityContext.getPrincipals(); if (principals != null) { for (Object candidate : principals) { if (candidate instanceof UserPrincipal) { userID = ((UserPrincipal)candidate).getName(); break; } } } } } messageSend.setUserID(userID); super.send(producerExchange, messageSend); }
@Override public void send(ProducerBrokerExchange producerExchange, Message messageSend) throws Exception { final SecurityContext securityContext = checkSecurityContext(producerExchange.getConnectionContext()); if (!securityContext.isBrokerContext() && !securityContext.getAuthorizedWriteDests().containsValue(messageSend.getDestination())) { Set<?> allowedACLs = null; if (!messageSend.getDestination().isTemporary()) { allowedACLs = authorizationMap.getWriteACLs(messageSend.getDestination()); } else { allowedACLs = authorizationMap.getTempDestinationWriteACLs(); } if (allowedACLs != null && !securityContext.isInOneOf(allowedACLs)) { throw new SecurityException("User " + securityContext.getUserName() + " is not authorized to write to: " + messageSend.getDestination()); } securityContext.getAuthorizedWriteDests().put(messageSend.getDestination(), messageSend.getDestination()); } super.send(producerExchange, messageSend); }
@Override public void send(ProducerBrokerExchange producerExchange, Message messageSend) throws Exception { final SecurityContext securityContext = checkSecurityContext(producerExchange.getConnectionContext()); if (!securityContext.isBrokerContext() && !securityContext.getAuthorizedWriteDests().containsValue(messageSend.getDestination())) { Set<?> allowedACLs = null; if (!messageSend.getDestination().isTemporary()) { allowedACLs = authorizationMap.getWriteACLs(messageSend.getDestination()); } else { allowedACLs = authorizationMap.getTempDestinationWriteACLs(); } if (allowedACLs != null && !securityContext.isInOneOf(allowedACLs)) { throw new SecurityException("User " + securityContext.getUserName() + " is not authorized to write to: " + messageSend.getDestination()); } securityContext.getAuthorizedWriteDests().put(messageSend.getDestination(), messageSend.getDestination()); } super.send(producerExchange, messageSend); }
@Override public void send(ProducerBrokerExchange producerExchange, Message messageSend) throws Exception { final SecurityContext securityContext = checkSecurityContext(producerExchange.getConnectionContext()); if (!securityContext.isBrokerContext() && !securityContext.getAuthorizedWriteDests().containsValue(messageSend.getDestination())) { Set<?> allowedACLs = null; if (!messageSend.getDestination().isTemporary()) { allowedACLs = authorizationMap.getWriteACLs(messageSend.getDestination()); } else { allowedACLs = authorizationMap.getTempDestinationWriteACLs(); } if (allowedACLs != null && !securityContext.isInOneOf(allowedACLs)) { throw new SecurityException("User " + securityContext.getUserName() + " is not authorized to write to: " + messageSend.getDestination()); } securityContext.getAuthorizedWriteDests().put(messageSend.getDestination(), messageSend.getDestination()); } super.send(producerExchange, messageSend); }
/** * Re-inject into the Broker chain */ void injectMessage(ProducerBrokerExchange producerExchange, final Message messageSend) throws Exception { ProducerBrokerExchange pe = producerExchange; if (pe == null) { pe = new ProducerBrokerExchange(); ConnectionContext cc = new ConnectionContext(); cc.setBroker(this.getRoot()); pe.setConnectionContext(cc); pe.setMutable(true); pe.setProducerState(new ProducerState(new ProducerInfo())); } super.send(pe, messageSend); }
/** * Re-inject into the Broker chain */ void injectMessage(ProducerBrokerExchange producerExchange, final Message messageSend) throws Exception { ProducerBrokerExchange pe = producerExchange; if (pe == null) { pe = new ProducerBrokerExchange(); ConnectionContext cc = new ConnectionContext(); cc.setBroker(this.getRoot()); pe.setConnectionContext(cc); pe.setMutable(true); pe.setProducerState(new ProducerState(new ProducerInfo())); } super.send(pe, messageSend); }
/** * Re-inject into the Broker chain */ void injectMessage(ProducerBrokerExchange producerExchange, final Message messageSend) throws Exception { ProducerBrokerExchange pe = producerExchange; if (pe == null) { pe = new ProducerBrokerExchange(); ConnectionContext cc = new ConnectionContext(); cc.setBroker(this.getRoot()); pe.setConnectionContext(cc); pe.setMutable(true); pe.setProducerState(new ProducerState(new ProducerInfo())); } super.send(pe, messageSend); }