|
Apache CXF API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cxf.transport.AbstractObservable org.apache.cxf.transport.AbstractConduit org.apache.cxf.transport.http.HTTPConduit
public abstract class HTTPConduit
This Conduit handles the "http" and "https" transport protocols. An instance is governed by policies either explicitly set or by configuration.
Nested Class Summary | |
---|---|
protected class |
HTTPConduit.InterposedMessageObserver
Used to set appropriate message properties, exchange etc. |
protected class |
HTTPConduit.WrappedOutputStream
Wrapper output stream responsible for flushing headers and handling the incoming HTTP-level response (not necessarily the MEP response). |
Field Summary | |
---|---|
protected AuthorizationPolicy |
authorizationPolicy
This field holds the password authorization configuration. |
protected HttpAuthSupplier |
authSupplier
Implements the authentication handling when talking to a server. |
protected Bus |
bus
This field holds a reference to the CXF bus associated this conduit. |
protected CertConstraints |
certConstraints
|
protected HTTPClientPolicy |
clientSidePolicy
This field holds the QoS configuration settings for this conduit. |
protected Cookies |
cookies
|
protected URI |
defaultEndpointURI
This field holds the "default" URI for this particular conduit, which is created on demand. |
protected String |
defaultEndpointURIString
|
protected EndpointInfo |
endpointInfo
This field is used for two reasons. |
protected boolean |
fromEndpointReferenceType
|
static String |
KEY_HTTP_CONNECTION
This constant is the Message(Map) key for the HttpURLConnection that is used to get the response. |
protected static Logger |
LOG
The Logger for this class. |
protected ProxyAuthorizationPolicy |
proxyAuthorizationPolicy
This field holds the password authorization configuration for the configured proxy. |
protected HttpAuthSupplier |
proxyAuthSupplier
Implements the proxy authentication handling. |
protected ProxyFactory |
proxyFactory
|
protected TLSClientParameters |
tlsClientParameters
This field holds the configuration TLS configuration which is programmatically configured. |
protected MessageTrustDecider |
trustDecider
This field contains the MessageTrustDecider. |
Fields inherited from class org.apache.cxf.transport.AbstractConduit |
---|
target |
Fields inherited from class org.apache.cxf.transport.AbstractObservable |
---|
incomingObserver |
Constructor Summary | |
---|---|
HTTPConduit(Bus b,
EndpointInfo ei)
Constructor |
|
HTTPConduit(Bus b,
EndpointInfo ei,
EndpointReferenceType t)
Constructor |
Method Summary | |
---|---|
void |
assertMessage(Message message)
|
boolean |
canAssert(QName type)
|
void |
close()
Close the conduit |
void |
close(Message msg)
Close the connections associated with the message |
protected abstract OutputStream |
createOutputStream(Message message,
boolean needToCacheRequest,
boolean isChunking,
int chunkThreshold)
|
protected static int |
determineConnectionTimeout(Message message,
HTTPClientPolicy csPolicy)
|
protected static int |
determineReceiveTimeout(Message message,
HTTPClientPolicy csPolicy)
|
protected String |
extractLocation(Map<String,List<String>> headers)
This method extracts the value of the "Location" Http Response header. |
void |
finalizeConfig()
This call gets called by the HTTPTransportFactory after it causes an injection of the Spring configuration properties of this Conduit. |
String |
getAddress()
|
AuthorizationPolicy |
getAuthorization()
This method gets the Authorization Policy that was configured or explicitly set for this HTTPConduit. |
HttpAuthSupplier |
getAuthSupplier()
This method gets the Auth Supplier that was set/configured for this HTTPConduit. |
String |
getBeanName()
This is part of the Configurable interface which retrieves the configuration from spring injection. |
HTTPClientPolicy |
getClient()
This method retrieves the Client Side Policy set/configured for this HTTPConduit. |
HTTPClientPolicy |
getClient(Message message)
|
String |
getConduitName()
This method returns the name of the conduit, which is based on the endpoint name plus the SC_HTTP_CONDUIT_SUFFIX. |
Map<String,Cookie> |
getCookies()
Allow access to the cookies that the conduit is maintaining |
AuthorizationPolicy |
getEffectiveAuthPolicy(Message message)
Determines effective auth policy from message, conduit and empty default with priority from first to last |
protected Logger |
getLogger()
This method returns the registered Logger for this conduit. |
ProxyAuthorizationPolicy |
getProxyAuthorization()
This method retrieves the Proxy Authorization Policy for a proxy that is set/configured for this HTTPConduit. |
HttpAuthSupplier |
getProxyAuthSupplier()
|
TLSClientParameters |
getTlsClientParameters()
This method returns the TLS Client Parameters that is set/configured for this HTTPConduit. |
MessageTrustDecider |
getTrustDecider()
This method gets the Trust Decider that was set/configured for this HTTPConduit. |
protected URI |
getURI()
|
protected URI |
getURI(boolean createOnDemand)
|
protected boolean |
isChunkingSupported(Message message,
String httpMethod)
|
void |
prepare(Message message)
Prepare to send an outbound HTTP message over this http conduit to a particular endpoint. |
void |
propertyChange(PropertyChangeEvent evt)
|
void |
setAuthorization(AuthorizationPolicy authorization)
This method is used to set the Authorization Policy for this conduit. |
void |
setAuthSupplier(HttpAuthSupplier supplier)
|
void |
setClient(HTTPClientPolicy client)
This method sets the Client Side Policy for this HTTPConduit. |
protected void |
setHeadersByAuthorizationPolicy(Message message,
URI currentURI)
This call places HTTP Header strings into the headers that are relevant to the Authorization policies that are set on this conduit by configuration. |
void |
setProxyAuthorization(ProxyAuthorizationPolicy proxyAuthorization)
This method sets the Proxy Authorization Policy for a specified proxy. |
void |
setProxyAuthSupplier(HttpAuthSupplier proxyAuthSupplier)
|
void |
setTlsClientParameters(TLSClientParameters params)
This method sets the TLS Client Parameters for this HTTPConduit. |
void |
setTrustDecider(MessageTrustDecider decider)
This method sets the Trust Decider for this HTTP Conduit. |
protected abstract void |
setupConnection(Message message,
URI url,
HTTPClientPolicy csPolicy)
|
Methods inherited from class org.apache.cxf.transport.AbstractConduit |
---|
getTarget, toString |
Methods inherited from class org.apache.cxf.transport.AbstractObservable |
---|
activate, deactivate, getMessageObserver, getTargetReference, getTargetReference, setMessageObserver |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.cxf.transport.Observable |
---|
getMessageObserver, setMessageObserver |
Field Detail |
---|
public static final String KEY_HTTP_CONNECTION
protected static final Logger LOG
protected final Bus bus
protected final EndpointInfo endpointInfo
protected URI defaultEndpointURI
protected String defaultEndpointURIString
protected boolean fromEndpointReferenceType
protected ProxyFactory proxyFactory
protected HTTPClientPolicy clientSidePolicy
protected AuthorizationPolicy authorizationPolicy
protected ProxyAuthorizationPolicy proxyAuthorizationPolicy
protected TLSClientParameters tlsClientParameters
protected MessageTrustDecider trustDecider
protected HttpAuthSupplier authSupplier
protected HttpAuthSupplier proxyAuthSupplier
protected Cookies cookies
protected CertConstraints certConstraints
Constructor Detail |
---|
public HTTPConduit(Bus b, EndpointInfo ei) throws IOException
b
- the associated Busei
- the endpoint info of the initiator
IOException
public HTTPConduit(Bus b, EndpointInfo ei, EndpointReferenceType t) throws IOException
b
- the associated Bus.endpoint
- the endpoint info of the initiator.t
- the endpoint reference of the target.
IOException
Method Detail |
---|
protected Logger getLogger()
getLogger
in class AbstractObservable
public final String getConduitName()
public void finalizeConfig()
public Map<String,Cookie> getCookies()
protected abstract void setupConnection(Message message, URI url, HTTPClientPolicy csPolicy) throws IOException
IOException
public void prepare(Message message) throws IOException
If the Message.PATH_INFO property is set it gets appended to the Conduit's endpoint URL. If the Message.QUERY_STRING property is set, it gets appended to the resultant URL following a "?".
If the Message.HTTP_REQUEST_METHOD property is NOT set, the Http request method defaults to "POST".
If the Message.PROTOCOL_HEADERS is not set on the message, it is initialized to an empty map.
This call creates the OutputStream for the content of the message. It also assigns the created Http(s)URLConnection to the Message Map.
prepare
in interface Conduit
message
- The message to be sent.
IOException
protected boolean isChunkingSupported(Message message, String httpMethod)
protected abstract OutputStream createOutputStream(Message message, boolean needToCacheRequest, boolean isChunking, int chunkThreshold) throws IOException
IOException
protected static int determineReceiveTimeout(Message message, HTTPClientPolicy csPolicy)
protected static int determineConnectionTimeout(Message message, HTTPClientPolicy csPolicy)
public void close(Message msg) throws IOException
Conduit
close
in interface Conduit
close
in class AbstractConduit
msg
- for which content should be closed.
IOException
public void close()
close
in interface Conduit
close
in class AbstractConduit
public String getAddress()
protected URI getURI() throws URISyntaxException
URISyntaxException
protected URI getURI(boolean createOnDemand) throws URISyntaxException
createOnDemand
- create URL on-demand if null
URISyntaxException
protected void setHeadersByAuthorizationPolicy(Message message, URI currentURI)
An AuthorizationPolicy may also be set on the message. If so, those policies are merged. A user name or password set on the messsage overrides settings in the AuthorizationPolicy is retrieved from the configuration.
The precedence is as follows: 1. AuthorizationPolicy that is set on the Message, if exists. 2. Authorization from AuthSupplier, if exists. 3. AuthorizationPolicy set/configured for conduit. REVISIT: Since the AuthorizationPolicy is set on the message by class, then how does one override the ProxyAuthorizationPolicy which is the same type?
message
- headers
- public String getBeanName()
getBeanName
in interface Configurable
public AuthorizationPolicy getEffectiveAuthPolicy(Message message)
message
-
public AuthorizationPolicy getAuthorization()
public void setAuthorization(AuthorizationPolicy authorization)
public HTTPClientPolicy getClient(Message message)
public HTTPClientPolicy getClient()
public void setClient(HTTPClientPolicy client)
public ProxyAuthorizationPolicy getProxyAuthorization()
public void setProxyAuthorization(ProxyAuthorizationPolicy proxyAuthorization)
public TLSClientParameters getTlsClientParameters()
public void setTlsClientParameters(TLSClientParameters params)
public MessageTrustDecider getTrustDecider()
public void setTrustDecider(MessageTrustDecider decider)
public HttpAuthSupplier getAuthSupplier()
public void setAuthSupplier(HttpAuthSupplier supplier)
public HttpAuthSupplier getProxyAuthSupplier()
public void setProxyAuthSupplier(HttpAuthSupplier proxyAuthSupplier)
protected String extractLocation(Map<String,List<String>> headers) throws MalformedURLException
headers
- The Http response headers.
MalformedURLException
public void assertMessage(Message message)
assertMessage
in interface Assertor
public boolean canAssert(QName type)
canAssert
in interface Assertor
public void propertyChange(PropertyChangeEvent evt)
propertyChange
in interface PropertyChangeListener
|
Apache CXF API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |