org.mule.transport.http
Class HttpConnector

java.lang.Object
  extended by org.mule.transport.AbstractConnector
      extended by org.mule.transport.tcp.TcpConnector
          extended by org.mule.transport.http.HttpConnector
All Implemented Interfaces:
EventListener, javax.resource.spi.work.WorkListener, org.mule.api.lifecycle.Disposable, org.mule.api.lifecycle.Initialisable, org.mule.api.lifecycle.Lifecycle, org.mule.api.lifecycle.LifecycleStateEnabled, org.mule.api.lifecycle.Startable, org.mule.api.lifecycle.Stoppable, org.mule.api.NameableObject, org.mule.api.NamedObject, org.mule.api.transport.Connectable, org.mule.api.transport.Connector
Direct Known Subclasses:
HttpPollingConnector, HttpsConnector

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 -


Field Summary
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 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
           
 
Fields inherited from class org.mule.transport.tcp.TcpConnector
CLIENT, DEFAULT_BACKLOG, DEFAULT_BUFFER_SIZE, DEFAULT_SO_LINGER, DEFAULT_SOCKET_TIMEOUT, DEFAULT_WAIT_TIMEOUT, KEEP_SEND_SOCKET_OPEN_PROPERTY, SERVER, TCP
 
Fields inherited from class org.mule.transport.AbstractConnector
createMultipleTransactedReceivers, 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
 
Fields inherited from interface org.mule.api.transport.Connector
INT_VALUE_NOT_SET
 
Fields inherited from interface org.mule.api.lifecycle.Disposable
PHASE_NAME
 
Constructor Summary
HttpConnector(org.mule.api.MuleContext context)
           
 
Method Summary
 void connect(org.mule.api.endpoint.EndpointURI endpointURI)
           
 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)
           
 org.apache.commons.httpclient.HttpConnectionManager getClientConnectionManager()
           
 String getCookieSpec()
           
 String getProtocol()
           
 String getProxyHostname()
           
 String getProxyPassword()
           
 int getProxyPort()
           
 String getProxyUsername()
           
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)
           
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)
           
 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)
           
 
Methods inherited from class org.mule.transport.tcp.TcpConnector
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, setTimeout
 
Methods inherited from class org.mule.transport.AbstractConnector
clearDispatchers, clearRequesters, configureDispatcherPool, connect, createDefaultRedeliveryPolicy, createDispatcherMessageProcessor, createMuleMessageFactory, createOperationResource, createReceiver, createScheduler, destroyReceiver, disconnect, dispose, disposeReceivers, disposeWorkManagers, doUnregisterListener, fireNotification, getConnectEventId, getConnectionDescription, getDefaultExchangePattern, getDefaultInboundTransformers, getDefaultOutboundTransformers, getDefaultResponseTransformers, getDispatcherFactory, getDispatcherPoolFactory, getDispatcherThreadingProfile, getDispatcherWorkManager, getInboundExchangePatterns, getLifecycleState, getMaxDispatchersActive, getMaxRequestersActive, getMaxTotalDispatchers, getMuleContext, getMuleMessageFactory, getName, getNumberOfConcurrentTransactedReceivers, getOperationResourceFactory, getOutboundExchangePatterns, getOutputStream, getReceiver, 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, lookupReceiver, 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, workStarted
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

HTTP

public static final String HTTP
See Also:
Constant Field Values

HTTP_PREFIX

public static final String HTTP_PREFIX
See Also:
Constant Field Values

HTTP_STATUS_PROPERTY

public static final String HTTP_STATUS_PROPERTY
MuleEvent property to pass back the status for the response

See Also:
Constant Field Values

HTTP_VERSION_PROPERTY

public static final String HTTP_VERSION_PROPERTY
See Also:
Constant Field Values

HTTP_CUSTOM_HEADERS_MAP_PROPERTY

@Deprecated
public static final 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.
See Also:
Constant Field Values

HTTP_HEADERS

public static final String HTTP_HEADERS
Encapsulates all the HTTP headers

See Also:
Constant Field Values

HTTP_QUERY_PARAMS

public static final String HTTP_QUERY_PARAMS
Stores the HTTP query parameters received, supports multiple values per key and both query parameter key and value are unescaped

See Also:
Constant Field Values

HTTP_QUERY_STRING

public static final String HTTP_QUERY_STRING
See Also:
Constant Field Values

HTTP_METHOD_PROPERTY

public static final String HTTP_METHOD_PROPERTY
See Also:
Constant Field Values

HTTP_REQUEST_PROPERTY

public static final String HTTP_REQUEST_PROPERTY
The path and query portions of the URL being accessed.

See Also:
Constant Field Values

HTTP_REQUEST_PATH_PROPERTY

public static final String HTTP_REQUEST_PATH_PROPERTY
The path portion of the URL being accessed. No query string is included.

See Also:
Constant Field Values

HTTP_CONTEXT_PATH_PROPERTY

public static final String HTTP_CONTEXT_PATH_PROPERTY
The context path of the endpoint being accessed. This is the path that the HTTP endpoint is listening on.

See Also:
Constant Field Values

HTTP_CONTEXT_URI_PROPERTY

public static final String HTTP_CONTEXT_URI_PROPERTY
The context URI of the endpoint being accessed. This is the address that the HTTP endpoint is listening on. It includes: [scheme]://[host]:[port][http.context.path]

See Also:
Constant Field Values

HTTP_RELATIVE_PATH_PROPERTY

public static final String HTTP_RELATIVE_PATH_PROPERTY
The relative path of the URI being accessed in relation to the context path

See Also:
Constant Field Values

HTTP_SERVLET_REQUEST_PROPERTY

public static final String HTTP_SERVLET_REQUEST_PROPERTY
See Also:
Constant Field Values

HTTP_SERVLET_RESPONSE_PROPERTY

public static final String HTTP_SERVLET_RESPONSE_PROPERTY
See Also:
Constant Field Values

HTTP_PARAMS_PROPERTY

public static final String HTTP_PARAMS_PROPERTY
Allows the user to set a HttpMethodParams object in the client request to be set on the HttpMethod request object

See Also:
Constant Field Values

HTTP_GET_BODY_PARAM_PROPERTY

public static final String HTTP_GET_BODY_PARAM_PROPERTY
See Also:
Constant Field Values

DEFAULT_HTTP_GET_BODY_PARAM_PROPERTY

public static final String DEFAULT_HTTP_GET_BODY_PARAM_PROPERTY
See Also:
Constant Field Values

HTTP_POST_BODY_PARAM_PROPERTY

public static final String HTTP_POST_BODY_PARAM_PROPERTY
See Also:
Constant Field Values

HTTP_DISABLE_STATUS_CODE_EXCEPTION_CHECK

public static final String HTTP_DISABLE_STATUS_CODE_EXCEPTION_CHECK
See Also:
Constant Field Values

HTTP_ENCODE_PARAMVALUE

public static final String HTTP_ENCODE_PARAMVALUE
See Also:
Constant Field Values

HTTP_INBOUND_PROPERTIES

public static final Set<String> HTTP_INBOUND_PROPERTIES

HTTP_COOKIE_SPEC_PROPERTY

public static final String HTTP_COOKIE_SPEC_PROPERTY
See Also:
Constant Field Values

HTTP_COOKIES_PROPERTY

public static final String HTTP_COOKIES_PROPERTY
See Also:
Constant Field Values

HTTP_ENABLE_COOKIES_PROPERTY

public static final String HTTP_ENABLE_COOKIES_PROPERTY
See Also:
Constant Field Values

COOKIE_SPEC_NETSCAPE

public static final String COOKIE_SPEC_NETSCAPE
See Also:
Constant Field Values

COOKIE_SPEC_RFC2109

public static final String COOKIE_SPEC_RFC2109
See Also:
Constant Field Values

ROOT_PATH

public static final String ROOT_PATH
See Also:
Constant Field Values

DEFAULT_CONNECTION_TIMEOUT

public static final int DEFAULT_CONNECTION_TIMEOUT
See Also:
Constant Field Values

clientConnectionManager

protected org.apache.commons.httpclient.HttpConnectionManager clientConnectionManager
Constructor Detail

HttpConnector

public HttpConnector(org.mule.api.MuleContext context)
Method Detail

doInitialise

protected void doInitialise()
                     throws org.mule.api.lifecycle.InitialisationException
Overrides:
doInitialise in class org.mule.transport.tcp.TcpConnector
Throws:
org.mule.api.lifecycle.InitialisationException

doDispose

protected void doDispose()
Overrides:
doDispose in class org.mule.transport.tcp.TcpConnector

doStop

protected void doStop()
               throws org.mule.api.MuleException
Overrides:
doStop in class org.mule.transport.tcp.TcpConnector
Throws:
org.mule.api.MuleException

doStart

protected void doStart()
                throws org.mule.api.MuleException
Overrides:
doStart in class org.mule.transport.tcp.TcpConnector
Throws:
org.mule.api.MuleException

registerListener

public void registerListener(org.mule.api.endpoint.InboundEndpoint endpoint,
                             org.mule.api.processor.MessageProcessor listener,
                             org.mule.api.construct.FlowConstruct flowConstruct)
                      throws Exception
Specified by:
registerListener in interface org.mule.api.transport.Connector
Overrides:
registerListener in class org.mule.transport.AbstractConnector
Throws:
Exception

getReceiverKey

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.

Overrides:
getReceiverKey in class org.mule.transport.AbstractConnector
Parameters:
endpoint - the endpoint being registered for the service
Returns:
the key to store the newly created receiver against

getProtocol

public String getProtocol()
Specified by:
getProtocol in interface org.mule.api.transport.Connector
Overrides:
getProtocol in class org.mule.transport.tcp.TcpConnector
See Also:
Connector.getProtocol()

getProxyHostname

public String getProxyHostname()

getProxyPassword

public String getProxyPassword()

getProxyPort

public int getProxyPort()

getProxyUsername

public String getProxyUsername()

setProxyHostname

public void setProxyHostname(String host)

setProxyPassword

public void setProxyPassword(String string)

setProxyPort

public void setProxyPort(int port)

setProxyUsername

public void setProxyUsername(String string)

getReceivers

public Map getReceivers()
Overrides:
getReceivers in class org.mule.transport.AbstractConnector

getCookieSpec

public String getCookieSpec()

setCookieSpec

public void setCookieSpec(String cookieSpec)

isEnableCookies

public boolean isEnableCookies()

setEnableCookies

public void setEnableCookies(boolean enableCookies)

getClientConnectionManager

public org.apache.commons.httpclient.HttpConnectionManager getClientConnectionManager()

setClientConnectionManager

public void setClientConnectionManager(org.apache.commons.httpclient.HttpConnectionManager clientConnectionManager)

doClientConnect

protected org.apache.commons.httpclient.HttpClient doClientConnect()
                                                            throws Exception
Throws:
Exception

setupClientAuthorization

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)
                                 throws UnsupportedEncodingException
Throws:
UnsupportedEncodingException

normalizeUrl

public static String normalizeUrl(String url)
Ensures that the supplied URL starts with a '/'.


isProxyNtlmAuthentication

public boolean isProxyNtlmAuthentication()

setProxyNtlmAuthentication

public void setProxyNtlmAuthentication(boolean proxyNtlmAuthentication)

connect

public void connect(org.mule.api.endpoint.EndpointURI endpointURI)

disconnect

public void disconnect(org.mule.api.endpoint.EndpointURI endpointURI)

lookupReceiver

public HttpMessageReceiver lookupReceiver(Socket socket,
                                          RequestLine requestLine)
                                   throws org.mule.api.transport.NoReceiverForEndpointException
Throws:
org.mule.api.transport.NoReceiverForEndpointException

lookupReceiver

@Deprecated
public HttpMessageReceiver lookupReceiver(Socket socket,
                                                     HttpRequest request)
Deprecated. 


findReceiverByStem

public static org.mule.api.transport.MessageReceiver findReceiverByStem(Map<Object,org.mule.api.transport.MessageReceiver> receivers,
                                                                        String uriStr)

getServerSocket

protected ServerSocket getServerSocket(URI uri)
                                throws IOException
Overrides:
getServerSocket in class org.mule.transport.tcp.TcpConnector
Throws:
IOException

isKeepSendSocketOpen

@Deprecated
public boolean isKeepSendSocketOpen()
Deprecated. Use keepAlive property in the outbound endpoint.

Overrides:
isKeepSendSocketOpen in class org.mule.transport.tcp.TcpConnector

setKeepSendSocketOpen

@Deprecated
public void setKeepSendSocketOpen(boolean keepSendSocketOpen)
Deprecated. Use keepAlive property in the outbound endpoint.

Overrides:
setKeepSendSocketOpen in class org.mule.transport.tcp.TcpConnector


Copyright © 2003–2014 MuleSoft, Inc.. All rights reserved.