org.apache.servicemix.http.endpoints
Class HttpProviderEndpoint

java.lang.Object
  extended by org.apache.servicemix.common.endpoints.AbstractEndpoint
      extended by org.apache.servicemix.common.endpoints.SimpleEndpoint
          extended by org.apache.servicemix.common.endpoints.ProviderEndpoint
              extended by org.apache.servicemix.http.endpoints.HttpProviderEndpoint
All Implemented Interfaces:
Endpoint, HttpEndpointType
Direct Known Subclasses:
HttpSoapProviderEndpoint

public class HttpProviderEndpoint
extends ProviderEndpoint
implements HttpEndpointType

A plain HTTP provider. This type of endpoint can be used to send non-SOAP requests to HTTP endpoints.

Since:
3.2
Author:
gnodet

Nested Class Summary
protected  class HttpProviderEndpoint.Exchange
           
protected  class HttpProviderEndpoint.SSLManagedHttpClient
           
 
Field Summary
 
Fields inherited from class org.apache.servicemix.common.endpoints.SimpleEndpoint
logger
 
Fields inherited from class org.apache.servicemix.common.endpoints.AbstractEndpoint
definition, description, endpoint, interfaceName, service, serviceUnit
 
Constructor Summary
HttpProviderEndpoint()
           
HttpProviderEndpoint(DefaultComponent component, javax.jbi.servicedesc.ServiceEndpoint endpoint)
           
HttpProviderEndpoint(ServiceUnit serviceUnit, javax.xml.namespace.QName service, java.lang.String endpoint)
           
 
Method Summary
 int getClientSoTimeout()
           
protected  org.mortbay.jetty.client.HttpClient getConnectionPool()
           
 java.lang.String getCredentials()
           
 java.lang.String getLocationURI()
          Returns the URI to which the endpoint sends requests.
 HttpProviderMarshaler getMarshaler()
           
 int getMaxConnectionsPerAddress()
           
 java.lang.String getPrincipal()
           
 int getProviderExpirationTime()
           
 java.lang.String getProxyHost()
           
 java.lang.String getProxyPassword()
           
 int getProxyPort()
           
 java.lang.String getProxyUsername()
           
 SslParameters getSsl()
           
protected  void handle(SmxHttpExchange httpExchange, javax.jbi.messaging.MessageExchange exchange)
           
protected  void handleException(SmxHttpExchange httpExchange, javax.jbi.messaging.MessageExchange exchange, java.lang.Throwable ex)
           
 boolean isExpectGzippedResponse()
           
 boolean isGzipRequest()
           
 void process(javax.jbi.messaging.MessageExchange exchange)
           
 void setClientSoTimeout(int clientTimeout)
          Sets the number of milliseconds the endpoint will block while attempting to read a request.
 void setCredentials(java.lang.String credentials)
           Credentials used by authentication realm.
 void setExpectGzippedResponse(boolean expectGzippedResponse)
          If true, the accept-encoding http header will be set to gzip and the response will be un-gzipped.
 void setGzipRequest(boolean gzipRequest)
          If true, the request content will be gzipped and sent over the wire.
 void setLocationURI(java.lang.String locationURI)
          Sets the URI to which an endpoint sends requests.
 void setMarshaler(HttpProviderMarshaler marshaler)
          Sets the class used to marshal messages.
 void setMaxConnectionsPerAddress(int maxConnectionsPerAddress)
          Sets the number of the maximum connections per address that JettyClient creates for each destination.
 void setPrincipal(java.lang.String principal)
           Principal used by authentication realm.
 void setProviderExpirationTime(int providerExpirationTime)
          Sets the number of milliseconds the endpoint will wait to read the response.
 void setProxyHost(java.lang.String proxyHost)
          Sets the host name of the HTTP proxy used
 void setProxyPassword(java.lang.String proxyPassword)
          Sets the password for the HTTP proxy authentication
 void setProxyPort(int proxyPort)
          Sets the host port of the HTTP proxy used (defaults to 80)
 void setProxyUsername(java.lang.String proxyUsername)
          Sets the user name for the HTTP proxy authentication
 void setSsl(SslParameters ssl)
          Sets the SSL parameters
 void start()
           
 void stop()
           
 void validate()
           
 
Methods inherited from class org.apache.servicemix.common.endpoints.ProviderEndpoint
activate, deactivate, getRole, processInOnly, processInOut
 
Methods inherited from class org.apache.servicemix.common.endpoints.SimpleEndpoint
done, fail, getChannel, getContext, getExchangeFactory, send, sendSync
 
Methods inherited from class org.apache.servicemix.common.endpoints.AbstractEndpoint
getDefinition, getDescription, getEndpoint, getInterfaceName, getKey, getService, getServiceUnit, isExchangeOkay, prepareExchange, setDefinition, setDescription, setEndpoint, setInterfaceName, setService, setServiceUnit, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HttpProviderEndpoint

public HttpProviderEndpoint()

HttpProviderEndpoint

public HttpProviderEndpoint(DefaultComponent component,
                            javax.jbi.servicedesc.ServiceEndpoint endpoint)

HttpProviderEndpoint

public HttpProviderEndpoint(ServiceUnit serviceUnit,
                            javax.xml.namespace.QName service,
                            java.lang.String endpoint)
Method Detail

getLocationURI

public java.lang.String getLocationURI()
Returns the URI to which the endpoint sends requests.

Returns:
a string representing the URI to which requests are sent

setLocationURI

public void setLocationURI(java.lang.String locationURI)
Sets the URI to which an endpoint sends requests.

Parameters:
locationURI - a string representing the URI

getMarshaler

public HttpProviderMarshaler getMarshaler()
Returns:
the marshaler

setMarshaler

public void setMarshaler(HttpProviderMarshaler marshaler)
Sets the class used to marshal messages.

Parameters:
marshaler - the marshaler to set

getProxyHost

public java.lang.String getProxyHost()

setProxyHost

public void setProxyHost(java.lang.String proxyHost)
Sets the host name of the HTTP proxy used

Parameters:
proxyHost - the host name of the HTTP proxy

getProxyPort

public int getProxyPort()

setProxyPort

public void setProxyPort(int proxyPort)
Sets the host port of the HTTP proxy used (defaults to 80)

Parameters:
proxyPort - the host name of the HTTP proxy

getProxyUsername

public java.lang.String getProxyUsername()

setProxyUsername

public void setProxyUsername(java.lang.String proxyUsername)
Sets the user name for the HTTP proxy authentication

Parameters:
proxyUsername - the user name for the HTTP proxy authentication

getProxyPassword

public java.lang.String getProxyPassword()

setProxyPassword

public void setProxyPassword(java.lang.String proxyPassword)
Sets the password for the HTTP proxy authentication

Parameters:
proxyPassword - the password for the HTTP proxy authentication

getSsl

public SslParameters getSsl()

setSsl

public void setSsl(SslParameters ssl)
Sets the SSL parameters

Parameters:
ssl - the SSL parameters

isExpectGzippedResponse

public boolean isExpectGzippedResponse()

setExpectGzippedResponse

public void setExpectGzippedResponse(boolean expectGzippedResponse)
If true, the accept-encoding http header will be set to gzip and the response will be un-gzipped.

Parameters:
expectGzippedResponse - if the response should be unzipped

isGzipRequest

public boolean isGzipRequest()

setGzipRequest

public void setGzipRequest(boolean gzipRequest)
If true, the request content will be gzipped and sent over the wire. The content-encoding http header will also be set to gzip.

Parameters:
gzipRequest - if the request should be compressed using gzip

getPrincipal

public java.lang.String getPrincipal()

setPrincipal

public void setPrincipal(java.lang.String principal)

Principal used by authentication realm.

Parameters:
principal - the principal used by authentication realm.

getCredentials

public java.lang.String getCredentials()

setCredentials

public void setCredentials(java.lang.String credentials)

Credentials used by authentication realm.

Parameters:
credentials - the credentials used by authentication realm.

process

public void process(javax.jbi.messaging.MessageExchange exchange)
             throws java.lang.Exception
Specified by:
process in interface Endpoint
Overrides:
process in class ProviderEndpoint
Throws:
java.lang.Exception

start

public void start()
           throws java.lang.Exception
Specified by:
start in interface Endpoint
Overrides:
start in class SimpleEndpoint
Throws:
java.lang.Exception

stop

public void stop()
          throws java.lang.Exception
Specified by:
stop in interface Endpoint
Overrides:
stop in class SimpleEndpoint
Throws:
java.lang.Exception

handle

protected void handle(SmxHttpExchange httpExchange,
                      javax.jbi.messaging.MessageExchange exchange)
               throws java.io.IOException
Throws:
java.io.IOException

handleException

protected void handleException(SmxHttpExchange httpExchange,
                               javax.jbi.messaging.MessageExchange exchange,
                               java.lang.Throwable ex)

getConnectionPool

protected org.mortbay.jetty.client.HttpClient getConnectionPool()
                                                         throws java.lang.Exception
Throws:
java.lang.Exception

getClientSoTimeout

public int getClientSoTimeout()

setClientSoTimeout

public void setClientSoTimeout(int clientTimeout)
Sets the number of milliseconds the endpoint will block while attempting to read a request. The default value is 60000. Setting this to 0 specifies that the endpoint will never timeout.

Parameters:
clientTimeout - an int specifying the number of milliseconds the socket will block while attempting to read a request

getProviderExpirationTime

public int getProviderExpirationTime()

setProviderExpirationTime

public void setProviderExpirationTime(int providerExpirationTime)
Sets the number of milliseconds the endpoint will wait to read the response. The default value is 300000.

Parameters:
providerExpirationTime - an int specifying the number of milliseconds to wait for a response before expiring.

getMaxConnectionsPerAddress

public int getMaxConnectionsPerAddress()

setMaxConnectionsPerAddress

public void setMaxConnectionsPerAddress(int maxConnectionsPerAddress)
Sets the number of the maximum connections per address that JettyClient creates for each destination. The default default value for Jetty is 32.

Parameters:
maxConnectionsPerAddress - the maxConnectionsPerAddress to set

validate

public void validate()
              throws javax.jbi.management.DeploymentException
Specified by:
validate in interface Endpoint
Overrides:
validate in class AbstractEndpoint
Throws:
javax.jbi.management.DeploymentException


Copyright © 2005-2012 FuseSource. All Rights Reserved.