public URI getEndpointURI() { return event.getMessageSourceURI(); }
public String getScheme() { return event.getMessageSourceURI().getScheme(); }
public NotPermittedException(MuleEvent event, SecurityContext context,SecurityFilter filter) { super(constructMessage(context, event.getMessageSourceURI(), filter), event); }
public UnauthorisedException(MuleEvent event, SecurityContext context, SecurityFilter filter) { super(constructMessage(context, event.getMessageSourceURI(), filter), event); }
public static String getScheme(MuleEvent event) { String scheme = event.getMessageSourceURI().getScheme(); if (scheme == null) { scheme = event.getMessage().getInboundProperty(HttpConstants.RequestProperties.HTTP_SCHEME); } return scheme; }
public MuleEvent process(MuleEvent event) throws MuleException { if (event.getExchangePattern().hasResponse()) { if (logger.isDebugEnabled()) { logger.debug("Service: " + service.getName() + " has received synchronous event on: " + event.getMessageSourceURI()); } } else { if (logger.isDebugEnabled()) { logger.debug("Service: " + service.getName() + " has received asynchronous event on: " + event.getMessageSourceURI()); } } return event; } }
/** * Resolves the scheme the URL in the request (http or https), supporting properties from both the HTTP transport * (by reading the message source URI in the endpoint) and the HTTP module (an inbound property with the scheme). */ private String resolveScheme(MuleEvent event) { String scheme = event.getMessageSourceURI().getScheme(); if (scheme == null) { scheme = event.getMessage().getInboundProperty(org.mule.module.http.api.HttpConstants.RequestProperties.HTTP_SCHEME); } if ("servlet".equals(scheme)) { scheme = org.mule.module.http.api.HttpConstants.Protocols.HTTP.getScheme(); } return scheme; }
@Override public MuleEvent process(MuleEvent event) throws MuleException { MuleEvent result = super.process(event); if (result != null && !VoidMuleEvent.getInstance().equals(result)) { result.getMessage().setProperty(CHANNEL.CALL_URI_PROPERTY, result.getMessageSourceURI().toString(), PropertyScope.OUTBOUND); } return result; } }
private String modifyServiceAddress(String wsdlContents, MuleEvent event) throws UnknownHostException String inboundAddress = event.getMessageSourceURI().toASCIIString(); try
protected void fireNotification(MuleEvent event, int action) { try { if (event == null || VoidMuleEvent.getInstance().equals(event)) { // Null result only happens when there's a filter in the chain. // Unfortunately a filter causes the whole chain to return null // and there's no other way to retrieve the last event but using the RequestContext. // see https://www.mulesoft.org/jira/browse/MULE-8670 event = RequestContext.getEvent(); if (event == null || VoidMuleEvent.getInstance().equals(event)) { return; } } getNotificationHelper(muleContext.getNotificationManager()).fireNotification( event, event.getMessageSourceURI() != null ? event.getMessageSourceURI().toString() : null, event.getFlowConstruct(), action); } catch (Exception e) { logger.warn("Could not fire notification. Action: " + action, e); } }
public WebServiceSecurityException(MuleEvent event, Throwable cause, MessageProcessor failingMessageProcessor) { super(MessageFactory.createStaticMessage( "Security exception occurred invoking web service\nEndpoint = " + event.getMessageSourceURI() + "\nSecurity provider(s) = " + event.getMuleContext().getSecurityManager().getProviders() + "\nEvent = " + event), event, cause, failingMessageProcessor); } }
private ContainerRequest buildRequest(MuleEvent event) throws URISyntaxException { MuleMessage message = event.getMessage(); String path = resolvePath(message); String contextPath = resolveContextPath(message); String query = null; int queryIdx = path.indexOf('?'); if (queryIdx != -1) { query = path.substring(queryIdx + 1); path = path.substring(0, queryIdx); } String host = message.getInboundProperty("Host", event.getMessageSourceURI().getHost()); String method = message.getInboundProperty(HttpConnector.HTTP_METHOD_PROPERTY); String scheme = resolveScheme(event); URI baseUri = getBaseUri(scheme, host, contextPath); URI completeUri = getCompleteUri(scheme, host, path, query); if (logger.isDebugEnabled()) { logger.debug("Base URI: " + baseUri); logger.debug("Complete URI: " + completeUri); } return new ContainerRequest(baseUri, completeUri, method, null, new MapPropertiesDelegate()); }
protected boolean isNewMessage(MuleEvent event) { try { String id = this.getIdForEvent(event); if (store == null) { synchronized (this) { initialise(); } } return !store.contains(id); } catch (MuleException e) { logger.error("Exception attempting to determine idempotency of incoming message for " + event.getFlowConstruct().getName() + " from the endpoint " + event.getMessageSourceURI(), e); return false; } }
new RoutingNotification(event.getMessage(), event.getMessageSourceURI().toString(), RoutingNotification.MISSED_ASYNC_REPLY));
String authScopeHost = msg.getOutboundProperty(HTTP_PREFIX + "auth.scope.host", event.getMessageSourceURI().getHost()); int authScopePort = msg.getOutboundProperty(HTTP_PREFIX + "auth.scope.port", event.getMessageSourceURI().getPort()); String authScopeRealm = msg.getOutboundProperty(HTTP_PREFIX + "auth.scope.realm", AuthScope.ANY_REALM); String authScopeScheme = msg.getOutboundProperty(HTTP_PREFIX + "auth.scope.scheme", AuthScope.ANY_SCHEME);
URI endpointUri = event.getMessageSourceURI();
String eventRequestUri = event.getMessageSourceURI().toString(); if (eventRequestUri.startsWith(JMS_TRANSPORT) || SoapJMSConstants.SOAP_JMS_NAMESPACE.equals(((MuleUniversalDestination) d).getEndpointInfo().getTransportId()))
event.getMessageSourceURI().toString(), RoutingNotification.MISSED_AGGREGATION_GROUP_EVENT)); return null;
this.exchangePattern = messageExchangePattern; this.messageSourceName = rewriteEvent.getMessageSourceName(); this.messageSourceURI = rewriteEvent.getMessageSourceURI(); this.outputStream = rewriteEvent.getOutputStream(); if (rewriteEvent instanceof DefaultMuleEvent)