|
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 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 HttpURLConnectionFactory |
connectionFactory
This field holds the connection factory, which primarily is used to factor out SSL specific code from this implementation. |
static String |
KEY_HTTP_CONNECTION
This constant is the Message(Map) key for the HttpURLConnection that is used to get the response. |
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 OutputStream |
createOutputStream(Message message,
HttpURLConnection connection,
boolean needToCacheRequest,
boolean isChunking,
int chunkThreshold)
|
protected void |
finalizeConfig()
This call gets called by the HTTPTransportFactory after it causes an injection of the Spring configuration properties of this Conduit. |
protected 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. |
protected HttpURLConnectionFactory |
getConnectionFactory(URL url)
|
Map<String,org.apache.cxf.transport.http.Cookie> |
getCookies()
Allow access to the cookies that the conduit is maintaining |
protected Logger |
getLogger()
This method returns the registered Logger for this conduit. |
protected static InputStream |
getPartialResponse(HttpURLConnection connection,
int responseCode)
Get an input stream containing the partial response if one is present. |
ProxyAuthorizationPolicy |
getProxyAuthorization()
This method retrieves the Proxy Authorization Policy for a proxy that is set/configured for this HTTPConduit. |
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 URL |
getURL()
|
protected URL |
getURL(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)
|
protected HttpURLConnectionFactory |
retrieveConnectionFactory(String url)
This method sets the connectionFactory field for this object. |
void |
setAuthorization(AuthorizationPolicy authorization)
This method is used to set the Authorization Policy for this conduit. |
void |
setAuthSupplier(HttpAuthSupplier supplier)
|
void |
setBasicAuthSupplier(HttpBasicAuthSupplier basicAuthSupplier)
Deprecated. |
void |
setClient(HTTPClientPolicy client)
This method sets the Client Side Policy for this HTTPConduit. |
void |
setProxyAuthorization(ProxyAuthorizationPolicy proxyAuthorization)
This method sets the Proxy Authorization Policy for a specified proxy. |
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. |
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 HttpURLConnectionFactory connectionFactory
This field is "protected" to facilitate some contrived UnitTesting so that an extended class may alter its value with an EasyMock URLConnection Factory.
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()
protected void finalizeConfig()
public Map<String,org.apache.cxf.transport.http.Cookie> getCookies()
protected HttpURLConnectionFactory retrieveConnectionFactory(String url)
This method is "protected" so that this class may be extended and override this method to put an EasyMock URL Connection factory for some contrived UnitTest that will of course break, should the calls to the URL Connection Factory get altered.
protected HttpURLConnectionFactory getConnectionFactory(URL url)
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 OutputStream createOutputStream(Message message, HttpURLConnection connection, boolean needToCacheRequest, boolean isChunking, int chunkThreshold)
public void close(Message msg) throws IOException
Conduit
close
in interface Conduit
close
in class AbstractConduit
IOException
public void close()
close
in interface Conduit
close
in class AbstractConduit
protected String getAddress()
protected URL getURL() throws MalformedURLException
MalformedURLException
protected URL getURL(boolean createOnDemand) throws MalformedURLException
createOnDemand
- create URL on-demand if null
MalformedURLException
protected static InputStream getPartialResponse(HttpURLConnection connection, int responseCode) throws IOException
connection
- the connection in questionresponseCode
- the response code
IOException
public String getBeanName()
getBeanName
in interface Configurable
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 void assertMessage(Message message)
assertMessage
in interface Assertor
public boolean canAssert(QName type)
canAssert
in interface Assertor
@Deprecated public void setBasicAuthSupplier(HttpBasicAuthSupplier basicAuthSupplier)
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 |