Class HTTPClientPolicy


  • public class HTTPClientPolicy
    extends Object
    Properties used to configure a client-side HTTP port

    Java class for HTTPClientPolicy complex type.

    The following schema fragment specifies the expected content contained within this class.

     <complexType name="HTTPClientPolicy">
       <complexContent>
         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
           <sequence>
           </sequence>
           <attribute name="ConnectionTimeout" type="{http://cxf.apache.org/configuration/parameterized-types}ParameterizedUInt" default="30000" />
           <attribute name="ReceiveTimeout" type="{http://cxf.apache.org/configuration/parameterized-types}ParameterizedUInt" default="60000" />
           <attribute name="ConnectionRequestTimeout" type="{http://cxf.apache.org/configuration/parameterized-types}ParameterizedUInt" default="60000" />
           <attribute name="AsyncExecuteTimeout" type="{http://cxf.apache.org/configuration/parameterized-types}ParameterizedUInt" default="5000" />
           <attribute name="AsyncExecuteTimeoutRejection" type="{http://cxf.apache.org/configuration/parameterized-types}ParameterizedBoolean" default="false" />
           <attribute name="AutoRedirect" type="{http://cxf.apache.org/configuration/parameterized-types}ParameterizedBoolean" default="false" />
           <attribute name="MaxRetransmits" type="{http://cxf.apache.org/configuration/parameterized-types}ParameterizedInt" default="-1" />
           <attribute name="AllowChunking" type="{http://cxf.apache.org/configuration/parameterized-types}ParameterizedBoolean" default="true" />
           <attribute name="ChunkingThreshold" type="{http://cxf.apache.org/configuration/parameterized-types}ParameterizedInt" default="4096" />
           <attribute name="ChunkLength" type="{http://cxf.apache.org/configuration/parameterized-types}ParameterizedInt" default="-1" />
           <attribute name="Accept" type="{http://www.w3.org/2001/XMLSchema}string" />
           <attribute name="AcceptLanguage" type="{http://www.w3.org/2001/XMLSchema}string" />
           <attribute name="AcceptEncoding" type="{http://www.w3.org/2001/XMLSchema}string" />
           <attribute name="ContentType" type="{http://www.w3.org/2001/XMLSchema}string" />
           <attribute name="Host" type="{http://www.w3.org/2001/XMLSchema}string" />
           <attribute name="Connection" type="{http://cxf.apache.org/transports/http/configuration}connectionType" default="Keep-Alive" />
           <attribute name="CacheControl" type="{http://www.w3.org/2001/XMLSchema}string" />
           <attribute name="Version" type="{http://www.w3.org/2001/XMLSchema}string" default="auto" />
           <attribute name="Cookie" type="{http://www.w3.org/2001/XMLSchema}string" />
           <attribute name="BrowserType" type="{http://www.w3.org/2001/XMLSchema}string" />
           <attribute name="Referer" type="{http://www.w3.org/2001/XMLSchema}string" />
           <attribute name="DecoupledEndpoint" type="{http://www.w3.org/2001/XMLSchema}string" />
           <attribute name="ProxyServer" type="{http://www.w3.org/2001/XMLSchema}string" />
           <attribute name="ProxyServerPort" type="{http://cxf.apache.org/configuration/parameterized-types}ParameterizedInt" />
           <attribute name="NonProxyHosts" type="{http://www.w3.org/2001/XMLSchema}string" />
           <attribute name="ProxyServerType" type="{http://cxf.apache.org/transports/http/configuration}proxyServerType" default="HTTP" />
           <anyAttribute namespace='http://schemas.xmlsoap.org/wsdl/'/>
         </restriction>
       </complexContent>
     </complexType>
     
    • Field Detail

      • connectionTimeout

        protected Long connectionTimeout
        Specifies the amount of time, in milliseconds, that the consumer will attempt to establish a connection before it times out. 0 is infinite.
      • receiveTimeout

        protected Long receiveTimeout
        Specifies the amount of time, in milliseconds, that the consumer will wait for a response before it times out. 0 is infinite.
      • connectionRequestTimeout

        protected Long connectionRequestTimeout
        Specifies the amount of time, in milliseconds, used when requesting a connection from the connection manager(if appliable). 0 is infinite.
      • asyncExecuteTimeout

        protected Long asyncExecuteTimeout
        Specifies the amount of time, in milliseconds, that a conduit will try and enqueue the response on the workqueue.
      • asyncExecuteTimeoutRejection

        protected Boolean asyncExecuteTimeoutRejection
        Specifies whether the conduit should throw and exception if it fails to enqueue the async response handling onto the workqueue. By default, if the conduit fails to enqueue the response handling on the workqueue, it will process the response on the current thread. Set this to true to raise and exception instead.
      • autoRedirect

        protected Boolean autoRedirect
        Specifies if the consumer will automatically follow a server issued redirection. (name is not part of standard)
      • maxRetransmits

        protected Integer maxRetransmits
        Specifies the maximum amount of retransmits that are allowed for redirects. Retransmits for authorization is included in the retransmit count. Each redirect may cause another retransmit for a UNAUTHORIZED response code, ie. 401. Any negative number indicates unlimited retransmits, although, loop protection is provided. The default is unlimited. (name is not part of standard)
      • allowChunking

        protected Boolean allowChunking
        If true, the client is free to use chunking streams if it wants, but it is not required to use chunking streams. If false, the client must use regular, non-chunked requests in all cases.
      • chunkingThreshold

        protected Integer chunkingThreshold
        If AllowChunking is true, this sets the threshold at which messages start getting chunked. Messages under this limit do not get chunked.
      • chunkLength

        protected Integer chunkLength
        Specifies the chunk length for a HttpURLConnection. This value is used in java.net.HttpURLConnection.setChunkedStreamingMode(int chunklen). chunklen indicates the number of bytes to write in each chunk. If chunklen is less than or equal to zero, a default value will be used.
      • accept

        protected String accept
        Specifies the MIME types the client is prepared to handle (e.g., HTML, JPEG, GIF, etc.)
      • acceptLanguage

        protected String acceptLanguage
        Specifies the language the client desires (e.g., English, French, etc.)
      • acceptEncoding

        protected String acceptEncoding
        Specifies the encoding the client is prepared to handle (e.g., gzip)
      • contentType

        protected String contentType
        Specifies the content type of the stream being sent in a post request. (this should be text/xml for web services, or can be set to application/x-www-form-urlencoded if the client is sending form data).
      • host

        protected String host
        Specifies the Internet host and port number of the resource on which the request is being invoked. This is sent by default based upon the URL. Certain DNS scenarios or application designs may request you to set this, but typically it is not required.
      • connection

        protected ConnectionType connection
        The connection disposition. If close the connection to the server is closed after each request/response dialog. If Keep-Alive the client requests the server to keep the connection open, and if the server honors the keep alive request, the connection is reused. Many servers and proxies do not honor keep-alive requests.
      • cacheControl

        protected String cacheControl
        Most commonly used to specify no-cache, however the standard supports a dozen or so caching related directives for requests
      • version

        protected String version
        HTTP Version used for the connection. The "auto" default will use whatever the default is for the HTTPConduit implementation.
      • cookie

        protected String cookie
        Specifies a cookie to send to the server. Some stateful session designs will use cookies to identify a session. If the cookie is static, you can supply it here. If it is dynamic, it will need to be set by the server on first access, and can be handled automatically by the runtime.
      • browserType

        protected String browserType
        aka User-Agent Specifies the type of browser is sending the request. This is usually only needed when sites have HTML customized to Netscape vs IE, etc, but can also be used to optimize for different SOAP stacks.
      • referer

        protected String referer
        Specifies the URL that referred us to this URL. This is sent automatically with auto redirect. May allow the server to optimize processing based upon previous task flow. However, typically not used in web services applications.
      • decoupledEndpoint

        protected String decoupledEndpoint
        Specifies the URL of a decoupled endpoint for the receipt of responses over a separate provider->consumer connection.
      • proxyServer

        protected String proxyServer
        Specifies the address of proxy server if one is used.
      • proxyServerPort

        protected Integer proxyServerPort
        Specifies the port number used by the proxy server.
      • nonProxyHosts

        protected String nonProxyHosts
        Specifies the list of hostnames that will not use the proxy configuration. Examples of value: * "localhost" -> A single hostname * "localhost|www.google.com" -> 2 hostnames that will not use the proxy configuration * "localhost|www.google.*|*.apache.org" -> It's also possible to use a pattern-like value
      • proxyServerType

        protected ProxyServerType proxyServerType
        Specifies the type of the proxy server. Can be either HTTP or SOCKS.
    • Constructor Detail

      • HTTPClientPolicy

        public HTTPClientPolicy()
    • Method Detail

      • getAccept

        public String getAccept()
        Gets the value of the accept property.

        Specifies the MIME types the client is prepared to handle (e.g., HTML, JPEG, GIF, etc.)

        Returns:
        possible object is String
      • setAccept

        public void setAccept​(String value)
        Sets the value of the accept property.
        Parameters:
        value - allowed object is String
        See Also:
        getAccept()
      • isSetAccept

        public boolean isSetAccept()
      • getAcceptLanguage

        public String getAcceptLanguage()
        Gets the value of the acceptLanguage property.

        Specifies the language the client desires (e.g., English, French, etc.)

        Returns:
        possible object is String
      • setAcceptLanguage

        public void setAcceptLanguage​(String value)
        Sets the value of the acceptLanguage property.
        Parameters:
        value - allowed object is String
        See Also:
        getAcceptLanguage()
      • isSetAcceptLanguage

        public boolean isSetAcceptLanguage()
      • getAcceptEncoding

        public String getAcceptEncoding()
        Gets the value of the acceptEncoding property.

        Specifies the encoding the client is prepared to handle (e.g., gzip)

        Returns:
        possible object is String
      • setAcceptEncoding

        public void setAcceptEncoding​(String value)
        Sets the value of the acceptEncoding property.
        Parameters:
        value - allowed object is String
        See Also:
        getAcceptEncoding()
      • isSetAcceptEncoding

        public boolean isSetAcceptEncoding()
      • getContentType

        public String getContentType()
        Gets the value of the contentType property.

        Specifies the content type of the stream being sent in a post request. (this should be text/xml for web services, or can be set to application/x-www-form-urlencoded if the client is sending form data).

        Returns:
        possible object is String
      • setContentType

        public void setContentType​(String value)
        Sets the value of the contentType property.
        Parameters:
        value - allowed object is String
        See Also:
        getContentType()
      • isSetContentType

        public boolean isSetContentType()
      • getHost

        public String getHost()
        Gets the value of the host property.

        Specifies the Internet host and port number of the resource on which the request is being invoked. This is sent by default based upon the URL. Certain DNS scenarios or application designs may request you to set this, but typically it is not required.

        Returns:
        possible object is String
      • setHost

        public void setHost​(String value)
        Sets the value of the host property.
        Parameters:
        value - allowed object is String
        See Also:
        getHost()
      • isSetHost

        public boolean isSetHost()
      • isSetConnection

        public boolean isSetConnection()
      • getCacheControl

        public String getCacheControl()
        Gets the value of the cacheControl property.

        Most commonly used to specify no-cache, however the standard supports a dozen or so caching related directives for requests

        Returns:
        possible object is String
      • setCacheControl

        public void setCacheControl​(String value)
        Sets the value of the cacheControl property.
        Parameters:
        value - allowed object is String
        See Also:
        getCacheControl()
      • isSetCacheControl

        public boolean isSetCacheControl()
      • getCookie

        public String getCookie()
        Gets the value of the cookie property.

        Specifies a cookie to send to the server. Some stateful session designs will use cookies to identify a session. If the cookie is static, you can supply it here. If it is dynamic, it will need to be set by the server on first access, and can be handled automatically by the runtime.

        Returns:
        possible object is String
      • setCookie

        public void setCookie​(String value)
        Sets the value of the cookie property.
        Parameters:
        value - allowed object is String
        See Also:
        getCookie()
      • isSetCookie

        public boolean isSetCookie()
      • getBrowserType

        public String getBrowserType()
        Gets the value of the browserType property.

        aka User-Agent Specifies the type of browser is sending the request. This is usually only needed when sites have HTML customized to Netscape vs IE, etc, but can also be used to optimize for different SOAP stacks.

        Returns:
        possible object is String
      • setBrowserType

        public void setBrowserType​(String value)
        Sets the value of the browserType property.
        Parameters:
        value - allowed object is String
        See Also:
        getBrowserType()
      • isSetBrowserType

        public boolean isSetBrowserType()
      • getReferer

        public String getReferer()
        Gets the value of the referer property.

        Specifies the URL that referred us to this URL. This is sent automatically with auto redirect. May allow the server to optimize processing based upon previous task flow. However, typically not used in web services applications.

        Returns:
        possible object is String
      • setReferer

        public void setReferer​(String value)
        Sets the value of the referer property.
        Parameters:
        value - allowed object is String
        See Also:
        getReferer()
      • isSetReferer

        public boolean isSetReferer()
      • getDecoupledEndpoint

        public String getDecoupledEndpoint()
        Gets the value of the decoupledEndpoint property.

        Specifies the URL of a decoupled endpoint for the receipt of responses over a separate provider->consumer connection.

        Returns:
        possible object is String
      • setDecoupledEndpoint

        public void setDecoupledEndpoint​(String value)
        Sets the value of the decoupledEndpoint property.
        Parameters:
        value - allowed object is String
        See Also:
        getDecoupledEndpoint()
      • isSetDecoupledEndpoint

        public boolean isSetDecoupledEndpoint()
      • getProxyServer

        public String getProxyServer()
        Gets the value of the proxyServer property.

        Specifies the address of proxy server if one is used.

        Returns:
        possible object is String
      • setProxyServer

        public void setProxyServer​(String value)
        Sets the value of the proxyServer property.
        Parameters:
        value - allowed object is String
        See Also:
        getProxyServer()
      • isSetProxyServer

        public boolean isSetProxyServer()
      • getProxyServerPort

        public Integer getProxyServerPort()
        Gets the value of the proxyServerPort property.

        Specifies the port number used by the proxy server.

        Returns:
        possible object is Integer
      • setProxyServerPort

        public void setProxyServerPort​(Integer value)
        Sets the value of the proxyServerPort property.
        Parameters:
        value - allowed object is Integer
        See Also:
        getProxyServerPort()
      • isSetProxyServerPort

        public boolean isSetProxyServerPort()
      • getNonProxyHosts

        public String getNonProxyHosts()
        Gets the value of the nonProxyHosts property.

        Specifies the list of hostnames that will not use the proxy configuration. Examples of value: * "localhost" -> A single hostname * "localhost|www.google.com" -> 2 hostnames that will not use the proxy configuration * "localhost|www.google.*|*.apache.org" -> It's also possible to use a pattern-like value

        Returns:
        possible object is String
      • setNonProxyHosts

        public void setNonProxyHosts​(String value)
        Sets the value of the nonProxyHosts property.
        Parameters:
        value - allowed object is String
        See Also:
        getNonProxyHosts()
      • isSetNonProxyHosts

        public boolean isSetNonProxyHosts()
      • isSetProxyServerType

        public boolean isSetProxyServerType()
      • getOtherAttributes

        public Map<QName,​String> getOtherAttributes()
        Gets a map that contains attributes that aren't bound to any typed property on this class.

        the map is keyed by the name of the attribute and the value is the string value of the attribute. the map returned by this method is live, and you can add new attribute by updating the map directly. Because of this design, there's no setter.

        Returns:
        always non-null
      • setConnectionTimeout

        public void setConnectionTimeout​(long value)
        Sets the value of the connectionTimeout property.
        See Also:
        getConnectionTimeout()
      • unsetConnectionTimeout

        public void unsetConnectionTimeout()
      • isSetConnectionTimeout

        public boolean isSetConnectionTimeout()
      • getConnectionTimeout

        public long getConnectionTimeout()
        Gets the value of the connectionTimeout property.

        Specifies the amount of time, in milliseconds, that the consumer will attempt to establish a connection before it times out. 0 is infinite.

      • setReceiveTimeout

        public void setReceiveTimeout​(long value)
        Sets the value of the receiveTimeout property.
        See Also:
        getReceiveTimeout()
      • unsetReceiveTimeout

        public void unsetReceiveTimeout()
      • isSetReceiveTimeout

        public boolean isSetReceiveTimeout()
      • getReceiveTimeout

        public long getReceiveTimeout()
        Gets the value of the receiveTimeout property.

        Specifies the amount of time, in milliseconds, that the consumer will wait for a response before it times out. 0 is infinite.

      • setConnectionRequestTimeout

        public void setConnectionRequestTimeout​(long value)
        Sets the value of the connectionRequestTimeout property.
        See Also:
        getConnectionRequestTimeout()
      • unsetConnectionRequestTimeout

        public void unsetConnectionRequestTimeout()
      • isSetConnectionRequestTimeout

        public boolean isSetConnectionRequestTimeout()
      • getConnectionRequestTimeout

        public long getConnectionRequestTimeout()
        Gets the value of the connectionRequestTimeout property.

        Specifies the amount of time, in milliseconds, used when requesting a connection from the connection manager(if appliable). 0 is infinite.

      • setAsyncExecuteTimeout

        public void setAsyncExecuteTimeout​(long value)
        Sets the value of the asyncExecuteTimeout property.
        See Also:
        getAsyncExecuteTimeout()
      • unsetAsyncExecuteTimeout

        public void unsetAsyncExecuteTimeout()
      • isSetAsyncExecuteTimeout

        public boolean isSetAsyncExecuteTimeout()
      • getAsyncExecuteTimeout

        public long getAsyncExecuteTimeout()
        Gets the value of the asyncExecuteTimeout property.

        Specifies the amount of time, in milliseconds, that a conduit will try and enqueue the response on the workqueue.

      • setAsyncExecuteTimeoutRejection

        public void setAsyncExecuteTimeoutRejection​(boolean value)
        Sets the value of the asyncExecuteTimeoutRejection property.
        See Also:
        isAsyncExecuteTimeoutRejection()
      • unsetAsyncExecuteTimeoutRejection

        public void unsetAsyncExecuteTimeoutRejection()
      • isSetAsyncExecuteTimeoutRejection

        public boolean isSetAsyncExecuteTimeoutRejection()
      • isAsyncExecuteTimeoutRejection

        public boolean isAsyncExecuteTimeoutRejection()
        Gets the value of the asyncExecuteTimeoutRejection property.

        Specifies whether the conduit should throw and exception if it fails to enqueue the async response handling onto the workqueue. By default, if the conduit fails to enqueue the response handling on the workqueue, it will process the response on the current thread. Set this to true to raise and exception instead.

      • setAutoRedirect

        public void setAutoRedirect​(boolean value)
        Sets the value of the autoRedirect property.
        See Also:
        isAutoRedirect()
      • unsetAutoRedirect

        public void unsetAutoRedirect()
      • isSetAutoRedirect

        public boolean isSetAutoRedirect()
      • isAutoRedirect

        public boolean isAutoRedirect()
        Gets the value of the autoRedirect property.

        Specifies if the consumer will automatically follow a server issued redirection. (name is not part of standard)

      • setMaxRetransmits

        public void setMaxRetransmits​(int value)
        Sets the value of the maxRetransmits property.
        See Also:
        getMaxRetransmits()
      • unsetMaxRetransmits

        public void unsetMaxRetransmits()
      • isSetMaxRetransmits

        public boolean isSetMaxRetransmits()
      • getMaxRetransmits

        public int getMaxRetransmits()
        Gets the value of the maxRetransmits property.

        Specifies the maximum amount of retransmits that are allowed for redirects. Retransmits for authorization is included in the retransmit count. Each redirect may cause another retransmit for a UNAUTHORIZED response code, ie. 401. Any negative number indicates unlimited retransmits, although, loop protection is provided. The default is unlimited. (name is not part of standard)

      • setAllowChunking

        public void setAllowChunking​(boolean value)
        Sets the value of the allowChunking property.
        See Also:
        isAllowChunking()
      • unsetAllowChunking

        public void unsetAllowChunking()
      • isSetAllowChunking

        public boolean isSetAllowChunking()
      • isAllowChunking

        public boolean isAllowChunking()
        Gets the value of the allowChunking property.

        If true, the client is free to use chunking streams if it wants, but it is not required to use chunking streams. If false, the client must use regular, non-chunked requests in all cases.

      • setChunkingThreshold

        public void setChunkingThreshold​(int value)
        Sets the value of the chunkingThreshold property.
        See Also:
        getChunkingThreshold()
      • unsetChunkingThreshold

        public void unsetChunkingThreshold()
      • isSetChunkingThreshold

        public boolean isSetChunkingThreshold()
      • getChunkingThreshold

        public int getChunkingThreshold()
        Gets the value of the chunkingThreshold property.

        If AllowChunking is true, this sets the threshold at which messages start getting chunked. Messages under this limit do not get chunked.

      • setChunkLength

        public void setChunkLength​(int value)
        Sets the value of the chunkLength property.
        See Also:
        getChunkLength()
      • unsetChunkLength

        public void unsetChunkLength()
      • isSetChunkLength

        public boolean isSetChunkLength()
      • getChunkLength

        public int getChunkLength()
        Gets the value of the chunkLength property.

        Specifies the chunk length for a HttpURLConnection. This value is used in java.net.HttpURLConnection.setChunkedStreamingMode(int chunklen). chunklen indicates the number of bytes to write in each chunk. If chunklen is less than or equal to zero, a default value will be used.

      • getConnection

        public ConnectionType getConnection()
        Gets the value of the connection property.

        The connection disposition. If close the connection to the server is closed after each request/response dialog. If Keep-Alive the client requests the server to keep the connection open, and if the server honors the keep alive request, the connection is reused. Many servers and proxies do not honor keep-alive requests.

      • setVersion

        public void setVersion​(String value)
        Sets the value of the version property.
        See Also:
        getVersion()
      • unsetVersion

        public void unsetVersion()
      • isSetVersion

        public boolean isSetVersion()
      • getVersion

        public String getVersion()
        Gets the value of the version property.

        HTTP Version used for the connection. The "auto" default will use whatever the default is for the HTTPConduit implementation.

      • getProxyServerType

        public ProxyServerType getProxyServerType()
        Gets the value of the proxyServerType property.

        Specifies the type of the proxy server. Can be either HTTP or SOCKS.

      • removePropertyChangeListener

        public void removePropertyChangeListener​(PropertyChangeListener listener)