public class HttpConnector
extends org.mule.transport.tcp.TcpConnector
HttpConnector provides a way of receiving and sending http requests
and responses. The Connector itself handles dispatching http requests. The
HttpMessageReceiver handles the receiving requests and processing
of headers This endpoint recognises the following properties -
| Modifier and Type | Field and Description |
|---|---|
static String |
BIND_TO_ALL_INTERFACES_IP |
protected org.apache.commons.httpclient.HttpConnectionManager |
clientConnectionManager |
static String |
COOKIE_SPEC_NETSCAPE |
static String |
COOKIE_SPEC_RFC2109 |
static int |
DEFAULT_CONNECTION_TIMEOUT |
static String |
DEFAULT_HTTP_GET_BODY_PARAM_PROPERTY |
static String |
DISABLE_STALE_CONNECTION_CHECK_SYSTEM_PROPERTY |
protected Map<org.mule.api.endpoint.OutboundEndpoint,org.mule.api.transport.MessageDispatcher> |
endpointDispatchers |
static String |
HTTP |
static String |
HTTP_CONTEXT_PATH_PROPERTY
The context path of the endpoint being accessed.
|
static String |
HTTP_CONTEXT_URI_PROPERTY
The context URI of the endpoint being accessed.
|
static String |
HTTP_COOKIE_SPEC_PROPERTY |
static String |
HTTP_COOKIES_PROPERTY |
static String |
HTTP_CUSTOM_HEADERS_MAP_PROPERTY
Deprecated.
Instead users can now add properties to the outgoing request using the OUTBOUND property scope on the message.
|
static String |
HTTP_DISABLE_STATUS_CODE_EXCEPTION_CHECK |
static String |
HTTP_ENABLE_COOKIES_PROPERTY |
static String |
HTTP_ENCODE_PARAMVALUE |
static String |
HTTP_GET_BODY_PARAM_PROPERTY |
static String |
HTTP_HEADERS
Encapsulates all the HTTP headers
|
static Set<String> |
HTTP_INBOUND_PROPERTIES |
static String |
HTTP_METHOD_PROPERTY |
static String |
HTTP_PARAMS_PROPERTY
Allows the user to set a
HttpMethodParams object in the client
request to be set on the HttpMethod request object |
static String |
HTTP_POST_BODY_PARAM_PROPERTY |
static String |
HTTP_PREFIX |
static String |
HTTP_QUERY_PARAMS
Stores the HTTP query parameters received, supports multiple values per key and both query parameter key and
value are unescaped
|
static String |
HTTP_QUERY_STRING |
static String |
HTTP_RELATIVE_PATH_PROPERTY
The relative path of the URI being accessed in relation to the context path
|
static String |
HTTP_REQUEST_PATH_PROPERTY
The path portion of the URL being accessed.
|
static String |
HTTP_REQUEST_PROPERTY
The path and query portions of the URL being accessed.
|
static String |
HTTP_SERVLET_REQUEST_PROPERTY |
static String |
HTTP_SERVLET_RESPONSE_PROPERTY |
static String |
HTTP_STATUS_PROPERTY
MuleEvent property to pass back the status for the response
|
static String |
HTTP_VERSION_PROPERTY |
static String |
ROOT_PATH |
static String |
SINGLE_DISPATCHER_PER_ENDPOINT_SYSTEM_PROPERTY |
CLIENT, DEFAULT_BACKLOG, DEFAULT_BUFFER_SIZE, DEFAULT_SO_LINGER, DEFAULT_SOCKET_TIMEOUT, DEFAULT_WAIT_TIMEOUT, KEEP_SEND_SOCKET_OPEN_PROPERTY, SEND_TCP_NO_DELAY_SYSTEM_PROPERTY, SERVER, TCPcreateMultipleTransactedReceivers, DEFAULT_NUM_CONCURRENT_TX_RECEIVERS, dispatcherFactory, dispatcherPoolFactory, dispatchers, initialStateStopped, lifecycleManager, logger, muleContext, muleMessageFactory, name, numberOfConcurrentTransactedReceivers, PROPERTY_POLLING_FREQUENCY, receivers, requesterFactory, requesters, serviceDescriptor, serviceOverrides, sessionHandler, startOnConnect| Constructor and Description |
|---|
HttpConnector(org.mule.api.MuleContext context) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
applyDispatcherLifecycle(org.mule.api.transport.MessageDispatcher dispatcher) |
protected org.mule.api.transport.MessageDispatcher |
borrowDispatcher(org.mule.api.endpoint.OutboundEndpoint endpoint) |
void |
connect(org.mule.api.endpoint.EndpointURI endpointURI) |
org.mule.api.processor.MessageProcessor |
createDispatcherMessageProcessor(org.mule.api.endpoint.OutboundEndpoint endpoint) |
void |
disconnect(org.mule.api.endpoint.EndpointURI endpointURI) |
protected org.apache.commons.httpclient.HttpClient |
doClientConnect() |
protected void |
doDispose() |
protected void |
doInitialise() |
protected void |
doStart() |
protected void |
doStop() |
static org.mule.api.transport.MessageReceiver |
findReceiverByStem(Map<Object,org.mule.api.transport.MessageReceiver> receivers,
String uriStr) |
static org.mule.api.transport.MessageReceiver |
findReceiverByStemConsideringMatchingHost(Map<Object,org.mule.api.transport.MessageReceiver> receivers,
String uri) |
org.apache.commons.httpclient.HttpConnectionManager |
getClientConnectionManager() |
String |
getCookieSpec() |
String |
getProtocol() |
String |
getProxyHostname() |
String |
getProxyPassword() |
int |
getProxyPort() |
String |
getProxyUsername() |
org.mule.api.transport.MessageReceiver |
getReceiver(org.mule.api.construct.FlowConstruct flowConstruct,
org.mule.api.endpoint.InboundEndpoint endpoint) |
protected Object |
getReceiverKey(org.mule.api.construct.FlowConstruct flowConstruct,
org.mule.api.endpoint.InboundEndpoint endpoint)
The method determines the key used to store the receiver against.
|
Map |
getReceivers() |
protected ServerSocket |
getServerSocket(URI uri) |
boolean |
isEnableCookies() |
boolean |
isKeepSendSocketOpen()
Deprecated.
Use keepAlive property in the outbound endpoint.
|
boolean |
isProxyNtlmAuthentication() |
HttpMessageReceiver |
lookupReceiver(Socket socket,
HttpRequest request)
Deprecated.
|
HttpMessageReceiver |
lookupReceiver(Socket socket,
RequestLine requestLine) |
org.mule.api.transport.MessageReceiver |
lookupReceiver(String key) |
static String |
normalizeUrl(String url)
Ensures that the supplied URL starts with a '/'.
|
void |
registerListener(org.mule.api.endpoint.InboundEndpoint endpoint,
org.mule.api.processor.MessageProcessor listener,
org.mule.api.construct.FlowConstruct flowConstruct) |
protected void |
returnDispatcher(org.mule.api.endpoint.OutboundEndpoint endpoint,
org.mule.api.transport.MessageDispatcher dispatcher) |
void |
setClientConnectionManager(org.apache.commons.httpclient.HttpConnectionManager clientConnectionManager) |
void |
setCookieSpec(String cookieSpec) |
void |
setEnableCookies(boolean enableCookies) |
void |
setKeepSendSocketOpen(boolean keepSendSocketOpen)
Deprecated.
Use keepAlive property in the outbound endpoint.
|
void |
setProxyHostname(String host) |
void |
setProxyNtlmAuthentication(boolean proxyNtlmAuthentication) |
void |
setProxyPassword(String string) |
void |
setProxyPort(int port) |
void |
setProxyUsername(String string) |
protected void |
setupClientAuthorization(org.mule.api.MuleEvent event,
org.apache.commons.httpclient.HttpMethod httpMethod,
org.apache.commons.httpclient.HttpClient client,
org.mule.api.endpoint.ImmutableEndpoint endpoint) |
static boolean |
uriMatchesReceiver(URI uri,
URI receiverUri) |
configureSocket, doConnect, doDisconnect, getBacklog, getBufferSize, getClientSoTimeout, getConnectionTimeout, getDispatchers, getKeepAliveMonitor, getKeepAliveTimeout, getOutputStream, getReceiveBacklog, getReceiveBufferSize, getSendBufferSize, getServerSocketFactory, getServerSoTimeout, getSocket, getSocketFactory, getSocketMaxWait, getSocketSoLinger, getSocketsPoolMaxActive, getSocketsPoolMaxIdle, getSocketsPoolMaxWait, getSocketsPoolNumActive, getTcpProtocol, isFailOnUnresolvedHost, isKeepAlive, isResponseEnabled, isReuseAddress, isSendTcpNoDelay, setBacklog, setBufferSize, setClientSoTimeout, setConnectionTimeout, setDispatcherFactory, setFailOnUnresolvedHost, setKeepAlive, setKeepAliveTimeout, setReceiveBacklog, setReceiveBufferSize, setReuseAddress, setSendBufferSize, setSendTcpNoDelay, setServerSocketFactory, setServerSoTimeout, setSocketFactory, setSocketMaxWait, setSocketSoLinger, setTcpProtocol, setTimeoutclearDispatchers, clearRequesters, configureDispatcherPool, connect, createDefaultRedeliveryPolicy, createMuleMessageFactory, createOperationResource, createReceiver, createScheduler, destroyReceiver, disconnect, dispose, disposeReceivers, disposeWorkManagers, doUnregisterListener, fireNotification, getCanonicalURI, getConnectEventId, getConnectionDescription, getDefaultExchangePattern, getDefaultInboundTransformers, getDefaultOutboundTransformers, getDefaultResponseTransformers, getDispatcherFactory, getDispatcherPoolFactory, getDispatcherThreadingProfile, getDispatcherWorkManager, getInboundExchangePatterns, getLifecycleState, getMaxDispatchersActive, getMaxRequestersActive, getMaxTotalDispatchers, getMuleContext, getMuleMessageFactory, getName, getNumberOfConcurrentTransactedReceivers, getOperationResourceFactory, getOutboundExchangePatterns, getOutputStream, getReceivers, getReceiverThreadingProfile, getReceiverWorkManager, getReplyToHandler, getRequesterFactory, getRequesterThreadingProfile, getRequesterWorkManager, getRetryPolicyTemplate, getScheduler, getServiceDescriptor, getServiceOverrides, getSessionHandler, getSupportedProtocols, getTransactionalResource, handleWorkException, initFromServiceDescriptor, initialise, initialiseFromUrl, initWorkManagers, isConnected, isConnecting, isCreateMultipleTransactedReceivers, isDisposed, isEnableMessageEvents, isInitialised, isInitialStateStopped, isStarted, isStarting, isStopped, isStopping, isValidateConnections, registerSupportedMetaProtocol, registerSupportedProtocol, registerSupportedProtocolWithoutPrefix, request, request, setConnected, setConnecting, setCreateMultipleTransactedReceivers, setDispatcherPoolFactory, setDispatcherPoolMaxWait, setDispatcherPoolWhenExhaustedAction, setDispatcherThreadingProfile, setDynamicNotification, setInitialStateStopped, setMaxDispatchersActive, setMaxRequestersActive, setName, setNumberOfConcurrentTransactedReceivers, setReceiverThreadingProfile, setRequesterFactory, setRequesterPoolMaxWait, setRequesterPoolWhenExhaustedAction, setRequesterThreadingProfile, setRetryPolicyTemplate, setServiceOverrides, setSessionHandler, setSupportedProtocols, setupDispatchReturn, setupRequestReturn, setValidateConnections, shutdownScheduler, start, startAfterConnect, stop, supportsProtocol, toString, unregisterListener, unregisterSupportedProtocol, updateCachedNotificationHandler, validateConnection, workAccepted, workCompleted, workRejected, workStartedpublic static final String HTTP
public static final String HTTP_PREFIX
public static final String DISABLE_STALE_CONNECTION_CHECK_SYSTEM_PROPERTY
public static final String SINGLE_DISPATCHER_PER_ENDPOINT_SYSTEM_PROPERTY
public static final String HTTP_STATUS_PROPERTY
public static final String HTTP_VERSION_PROPERTY
@Deprecated public static final String HTTP_CUSTOM_HEADERS_MAP_PROPERTY
public static final String HTTP_HEADERS
public static final String HTTP_QUERY_PARAMS
public static final String HTTP_QUERY_STRING
public static final String HTTP_METHOD_PROPERTY
public static final String HTTP_REQUEST_PROPERTY
public static final String HTTP_REQUEST_PATH_PROPERTY
public static final String HTTP_CONTEXT_PATH_PROPERTY
public static final String HTTP_CONTEXT_URI_PROPERTY
public static final String HTTP_RELATIVE_PATH_PROPERTY
public static final String HTTP_SERVLET_REQUEST_PROPERTY
public static final String HTTP_SERVLET_RESPONSE_PROPERTY
public static final String HTTP_PARAMS_PROPERTY
HttpMethodParams object in the client
request to be set on the HttpMethod request objectpublic static final String HTTP_GET_BODY_PARAM_PROPERTY
public static final String DEFAULT_HTTP_GET_BODY_PARAM_PROPERTY
public static final String HTTP_POST_BODY_PARAM_PROPERTY
public static final String HTTP_DISABLE_STATUS_CODE_EXCEPTION_CHECK
public static final String HTTP_ENCODE_PARAMVALUE
protected Map<org.mule.api.endpoint.OutboundEndpoint,org.mule.api.transport.MessageDispatcher> endpointDispatchers
public static final String HTTP_COOKIE_SPEC_PROPERTY
public static final String HTTP_COOKIES_PROPERTY
public static final String HTTP_ENABLE_COOKIES_PROPERTY
public static final String COOKIE_SPEC_NETSCAPE
public static final String COOKIE_SPEC_RFC2109
public static final String ROOT_PATH
public static final int DEFAULT_CONNECTION_TIMEOUT
public static final String BIND_TO_ALL_INTERFACES_IP
protected org.apache.commons.httpclient.HttpConnectionManager clientConnectionManager
protected void doInitialise()
throws org.mule.api.lifecycle.InitialisationException
doInitialise in class org.mule.transport.tcp.TcpConnectororg.mule.api.lifecycle.InitialisationExceptionprotected void doDispose()
doDispose in class org.mule.transport.tcp.TcpConnectorprotected void doStop()
throws org.mule.api.MuleException
doStop in class org.mule.transport.tcp.TcpConnectororg.mule.api.MuleExceptionprotected void doStart()
throws org.mule.api.MuleException
doStart in class org.mule.transport.tcp.TcpConnectororg.mule.api.MuleExceptionpublic void registerListener(org.mule.api.endpoint.InboundEndpoint endpoint,
org.mule.api.processor.MessageProcessor listener,
org.mule.api.construct.FlowConstruct flowConstruct)
throws Exception
registerListener in interface org.mule.api.transport.ConnectorregisterListener in class org.mule.transport.AbstractConnectorExceptionprotected Object getReceiverKey(org.mule.api.construct.FlowConstruct flowConstruct, org.mule.api.endpoint.InboundEndpoint endpoint)
getReceiverKey in class org.mule.transport.AbstractConnectorendpoint - the endpoint being registered for the servicepublic String getProtocol()
getProtocol in interface org.mule.api.transport.ConnectorgetProtocol in class org.mule.transport.tcp.TcpConnectorConnector.getProtocol()public String getProxyHostname()
public String getProxyPassword()
public int getProxyPort()
public String getProxyUsername()
public void setProxyHostname(String host)
public void setProxyPassword(String string)
public void setProxyPort(int port)
public void setProxyUsername(String string)
public Map getReceivers()
getReceivers in class org.mule.transport.AbstractConnectorpublic String getCookieSpec()
public void setCookieSpec(String cookieSpec)
public boolean isEnableCookies()
public void setEnableCookies(boolean enableCookies)
public org.apache.commons.httpclient.HttpConnectionManager getClientConnectionManager()
public void setClientConnectionManager(org.apache.commons.httpclient.HttpConnectionManager clientConnectionManager)
protected org.apache.commons.httpclient.HttpClient doClientConnect()
throws Exception
Exceptionprotected void setupClientAuthorization(org.mule.api.MuleEvent event,
org.apache.commons.httpclient.HttpMethod httpMethod,
org.apache.commons.httpclient.HttpClient client,
org.mule.api.endpoint.ImmutableEndpoint endpoint)
throws UnsupportedEncodingException
UnsupportedEncodingExceptionpublic static String normalizeUrl(String url)
public boolean isProxyNtlmAuthentication()
public void setProxyNtlmAuthentication(boolean proxyNtlmAuthentication)
public void connect(org.mule.api.endpoint.EndpointURI endpointURI)
public void disconnect(org.mule.api.endpoint.EndpointURI endpointURI)
public HttpMessageReceiver lookupReceiver(Socket socket, RequestLine requestLine) throws org.mule.api.transport.NoReceiverForEndpointException
org.mule.api.transport.NoReceiverForEndpointException@Deprecated public HttpMessageReceiver lookupReceiver(Socket socket, HttpRequest request)
public org.mule.api.transport.MessageReceiver lookupReceiver(String key)
lookupReceiver in class org.mule.transport.AbstractConnectorpublic static org.mule.api.transport.MessageReceiver findReceiverByStemConsideringMatchingHost(Map<Object,org.mule.api.transport.MessageReceiver> receivers, String uri)
public static org.mule.api.transport.MessageReceiver findReceiverByStem(Map<Object,org.mule.api.transport.MessageReceiver> receivers, String uriStr)
protected ServerSocket getServerSocket(URI uri) throws IOException
getServerSocket in class org.mule.transport.tcp.TcpConnectorIOException@Deprecated public boolean isKeepSendSocketOpen()
isKeepSendSocketOpen in class org.mule.transport.tcp.TcpConnector@Deprecated public void setKeepSendSocketOpen(boolean keepSendSocketOpen)
setKeepSendSocketOpen in class org.mule.transport.tcp.TcpConnectorpublic org.mule.api.processor.MessageProcessor createDispatcherMessageProcessor(org.mule.api.endpoint.OutboundEndpoint endpoint)
throws org.mule.api.MuleException
createDispatcherMessageProcessor in class org.mule.transport.AbstractConnectororg.mule.api.MuleExceptionprotected org.mule.api.transport.MessageDispatcher borrowDispatcher(org.mule.api.endpoint.OutboundEndpoint endpoint)
throws org.mule.api.MuleException
borrowDispatcher in class org.mule.transport.AbstractConnectororg.mule.api.MuleExceptionprotected void returnDispatcher(org.mule.api.endpoint.OutboundEndpoint endpoint,
org.mule.api.transport.MessageDispatcher dispatcher)
returnDispatcher in class org.mule.transport.AbstractConnectorpublic org.mule.api.transport.MessageReceiver getReceiver(org.mule.api.construct.FlowConstruct flowConstruct,
org.mule.api.endpoint.InboundEndpoint endpoint)
getReceiver in class org.mule.transport.AbstractConnectorprotected void applyDispatcherLifecycle(org.mule.api.transport.MessageDispatcher dispatcher)
throws org.mule.api.MuleException
org.mule.api.MuleExceptionCopyright © 2003–2015 MuleSoft, Inc.. All rights reserved.