Class AbderaClient


  • @Deprecated
    public class AbderaClient
    extends Object
    Deprecated.
    Legacy AEM 6.x API.
    An Atom Publishing Protocol client.
    • Field Detail

      • DEFAULT_MAX_REDIRECTS

        public static int DEFAULT_MAX_REDIRECTS
        Deprecated.
    • Constructor Detail

      • AbderaClient

        public AbderaClient()
        Deprecated.
      • AbderaClient

        public AbderaClient​(String useragent)
        Deprecated.
        Create an AbderaClient instance using the specified useragent name
        Parameters:
        useragent -
      • AbderaClient

        public AbderaClient​(org.apache.abdera.Abdera abdera,
                            String useragent)
        Deprecated.
        Create an AbderaClient instance using the specified Abdera instance and useragent name
        Parameters:
        abdera -
        useragent -
      • AbderaClient

        public AbderaClient​(org.apache.abdera.Abdera abdera,
                            String useragent,
                            Cache cache)
        Deprecated.
        Create an AbderaClient instance using the specified Abdera instance and useragent name
        Parameters:
        abdera -
        useragent -
      • AbderaClient

        public AbderaClient​(org.apache.commons.httpclient.HttpClient client)
        Deprecated.
        Create an Abdera using a preconfigured HttpClient object
        Parameters:
        client - An Apache HttpClient object
      • AbderaClient

        public AbderaClient​(org.apache.abdera.Abdera abdera,
                            org.apache.commons.httpclient.HttpClient client)
        Deprecated.
        Create an Abdera using a preconfigured HttpClient object
        Parameters:
        abdera -
        client - An Apache HttpClient object
      • AbderaClient

        public AbderaClient​(org.apache.abdera.Abdera abdera,
                            org.apache.commons.httpclient.HttpClient client,
                            Cache cache)
        Deprecated.
        Create an Abdera using a preconfigured HttpClient object
        Parameters:
        abdera -
        client - An Apache HttpClient object
      • AbderaClient

        public AbderaClient​(org.apache.abdera.Abdera abdera)
        Deprecated.
        Create an AbderaClient instance using the specified Abdera instance
        Parameters:
        abdera -
      • AbderaClient

        public AbderaClient​(org.apache.abdera.Abdera abdera,
                            Cache cache)
        Deprecated.
        Create an AbderaClient instance using the specified Abdera instance
        Parameters:
        abdera -
    • Method Detail

      • getCache

        public Cache getCache()
        Deprecated.
        Returns the client HTTP cache instance
      • initCache

        public Cache initCache​(CacheFactory factory)
        Deprecated.
        The CacheFactory interface is no longer used.
      • initCache

        public static Cache initCache​(org.apache.abdera.Abdera abdera)
        Deprecated.
        Initializes the client HTTP cache
      • head

        public ClientResponse head​(String uri,
                                   RequestOptions options)
        Deprecated.
        Sends an HTTP HEAD request to the specified URI.
        Parameters:
        uri - The request URI
        options - The request options
      • get

        public ClientResponse get​(String uri,
                                  RequestOptions options)
        Deprecated.
        Sends an HTTP GET request to the specified URI.
        Parameters:
        uri - The request URI
        options - The request options
      • post

        public ClientResponse post​(String uri,
                                   EntityProvider provider,
                                   RequestOptions options)
        Deprecated.
        Sends an HTTP POST request to the specified URI.
        Parameters:
        uri - The request URI
        provider - An EntityProvider implementation providing the payload of the request
        options - The request options
      • post

        public ClientResponse post​(String uri,
                                   org.apache.commons.httpclient.methods.RequestEntity entity,
                                   RequestOptions options)
        Deprecated.
        Sends an HTTP POST request to the specified URI.
        Parameters:
        uri - The request URI
        entity - A RequestEntity object providing the payload of the request
        options - The request options
      • post

        public ClientResponse post​(String uri,
                                   InputStream in,
                                   RequestOptions options)
        Deprecated.
        Sends an HTTP POST request to the specified URI.
        Parameters:
        uri - The request URI
        in - An InputStream providing the payload of the request
        options - The request options
      • post

        public ClientResponse post​(String uri,
                                   org.apache.abdera.model.Base base,
                                   RequestOptions options)
        Deprecated.
        Sends an HTTP POST request to the specified URI.
        Parameters:
        uri - The request URI
        base - An Abdera FOM Document or Element object providing the payload of the request
        options - The request options
      • post

        public ClientResponse post​(String uri,
                                   org.apache.abdera.model.Entry entry,
                                   InputStream media)
        Deprecated.
        Sends an HTTP POST request to the specified URI. It uses the media and entry parameters to create a multipart/related object. If the contentType is not provided this method tries to get it from the type attribute of the entry content.
        Parameters:
        uri - The request URI
        entry - The entry that will be sent as the first element of the multipart/related object
        media - The media object that will be sent as the second element of the multipart/related object
      • post

        public ClientResponse post​(String uri,
                                   org.apache.abdera.model.Entry entry,
                                   InputStream media,
                                   RequestOptions options)
        Deprecated.
        Sends an HTTP POST request to the specified URI. It uses the media and entry parameters to create a multipart/related object. If the contentType is not provided this method tries to get it from the type attribute of the entry content.
        Parameters:
        uri - The request URI
        entry - The entry that will be sent as the first element of the multipart/related object
        media - The media object that will be sent as the second element of the multipart/related object
        options - The request options
      • post

        public ClientResponse post​(String uri,
                                   org.apache.abdera.model.Entry entry,
                                   InputStream media,
                                   String contentType,
                                   RequestOptions options)
        Deprecated.
        Sends an HTTP POST request to the specified URI. It uses the media and entry parameters to create a multipart/related object.
        Parameters:
        uri - The request URI
        entry - The entry that will be sent as the first element of the multipart/related object
        media - The media object that will be sent as the second element of the multipart/related object
        contentType - the content type of the media object
        options - The request options
      • put

        public ClientResponse put​(String uri,
                                  EntityProvider provider,
                                  RequestOptions options)
        Deprecated.
        Sends an HTTP PUT request to the specified URI.
        Parameters:
        uri - The request URI
        provider - An EntityProvider implementation providing the payload of the request
        options - The request options
      • put

        public ClientResponse put​(String uri,
                                  org.apache.commons.httpclient.methods.RequestEntity entity,
                                  RequestOptions options)
        Deprecated.
        Sends an HTTP PUT request to the specified URI.
        Parameters:
        uri - The request URI
        entity - A RequestEntity object providing the payload of the request
        options - The request options
      • put

        public ClientResponse put​(String uri,
                                  InputStream in,
                                  RequestOptions options)
        Deprecated.
        Sends an HTTP PUT request to the specified URI.
        Parameters:
        uri - The request URI
        in - An InputStream providing the payload of the request
        options - The request options
      • put

        public ClientResponse put​(String uri,
                                  org.apache.abdera.model.Base base,
                                  RequestOptions options)
        Deprecated.
        Sends an HTTP PUT request to the specified URI.
        Parameters:
        uri - The request URI
        base - A FOM Document or Element providing the payload of the request
        options - The request options
      • delete

        public ClientResponse delete​(String uri,
                                     RequestOptions options)
        Deprecated.
        Sends an HTTP DELETE request to the specified URI.
        Parameters:
        uri - The request URI
        options - The request options
      • head

        public ClientResponse head​(String uri)
        Deprecated.
        Sends an HTTP HEAD request to the specified URI using the default options
        Parameters:
        uri - The request URI
      • get

        public ClientResponse get​(String uri)
        Deprecated.
        Sends an HTTP GET request to the specified URI using the default options
        Parameters:
        uri - The request URI
      • post

        public ClientResponse post​(String uri,
                                   EntityProvider provider)
        Deprecated.
        Sends an HTTP POST request to the specified URI using the default options
        Parameters:
        uri - The request URI
        provider - An EntityProvider implementation providing the payload the request
      • post

        public ClientResponse post​(String uri,
                                   org.apache.commons.httpclient.methods.RequestEntity entity)
        Deprecated.
        Sends an HTTP POST request to the specified URI using the default options
        Parameters:
        uri - The request URI
        entity - A RequestEntity object providing the payload of the request
      • post

        public ClientResponse post​(String uri,
                                   InputStream in)
        Deprecated.
        Sends an HTTP POST request to the specified URI using the default options
        Parameters:
        uri - The request URI
        in - An InputStream providing the payload of the request
      • post

        public ClientResponse post​(String uri,
                                   org.apache.abdera.model.Base base)
        Deprecated.
        Sends an HTTP POST request to the specified URI using the default options
        Parameters:
        uri - The request URI
        base - A FOM Document or Element providing the payload of the request
      • put

        public ClientResponse put​(String uri,
                                  EntityProvider provider)
        Deprecated.
        Sends an HTTP PUT request to the specified URI using the default options
        Parameters:
        uri - The request URI
        provider - An EntityProvider implementation providing the payload of the request
      • put

        public ClientResponse put​(String uri,
                                  org.apache.commons.httpclient.methods.RequestEntity entity)
        Deprecated.
        Sends an HTTP PUT request to the specified URI using the default options
        Parameters:
        uri - The request URI
        entity - A RequestEntity object providing the payload of the request
      • put

        public ClientResponse put​(String uri,
                                  InputStream in)
        Deprecated.
        Sends an HTTP PUT request to the specified URI using the default options
        Parameters:
        uri - The request URI
        in - An InputStream providing the payload of the request
      • put

        public ClientResponse put​(String uri,
                                  org.apache.abdera.model.Base base)
        Deprecated.
        Sends an HTTP PUT request to the specified URI using the default options
        Parameters:
        uri - The request URI
        base - A FOM Document or Element providing the payload of the request
      • delete

        public ClientResponse delete​(String uri)
        Deprecated.
        Sends an HTTP DELETE request to the specified URI using the default options
        Parameters:
        uri - The request URI
      • registerScheme

        public static void registerScheme​(String name,
                                          Class<? extends org.apache.commons.httpclient.auth.AuthScheme> scheme)
        Deprecated.
        Register a new authentication scheme.
        Parameters:
        name -
        scheme -
      • unregisterScheme

        public static void unregisterScheme​(String name)
        Deprecated.
        Unregister a specific authentication scheme
        Parameters:
        name - The name of the authentication scheme (e.g. "basic", "digest", etc)
      • unregisterScheme

        public static void unregisterScheme​(String... names)
        Deprecated.
        Unregister multiple HTTP authentication schemes
      • registerTrustManager

        public static void registerTrustManager​(TrustManager trustManager)
        Deprecated.
        Register the specified TrustManager for SSL support on the default port (443)
        Parameters:
        trustManager - The TrustManager implementation
      • registerTrustManager

        public static void registerTrustManager()
        Deprecated.
        Register the default TrustManager for SSL support on the default port (443)
      • registerTrustManager

        public static void registerTrustManager​(TrustManager trustManager,
                                                int port)
        Deprecated.
        Register the specified TrustManager for SSL support on the specified port
        Parameters:
        trustManager - The TrustManager implementation
        port - The port
      • registerTrustManager

        public static void registerTrustManager​(int port)
        Deprecated.
        Register the default trust manager on the specified port
        Parameters:
        port - The port
      • registerFactory

        public static void registerFactory​(org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory factory,
                                           int port)
        Deprecated.
        Register the specified secure socket factory on the specified port
      • usePreemptiveAuthentication

        public AbderaClient usePreemptiveAuthentication​(boolean val)
        Deprecated.
        Configure the client to use preemptive authentication (HTTP Basic Authentication only)
      • execute

        public ClientResponse execute​(String method,
                                      String uri,
                                      org.apache.abdera.model.Base base,
                                      RequestOptions options)
        Deprecated.
        Sends the specified method request to the specified URI. This can be used to send extension HTTP methods to a server (e.g. PATCH, LOCK, etc)
        Parameters:
        method - The HTTP method
        uri - The request URI
        base - A FOM Document and Element providing the payload for the request
        options - The Request Options
      • execute

        public ClientResponse execute​(String method,
                                      String uri,
                                      EntityProvider provider,
                                      RequestOptions options)
        Deprecated.
        Sends the specified method request to the specified URI. This can be used to send extension HTTP methods to a server (e.g. PATCH, LOCK, etc)
        Parameters:
        method - The HTTP method
        uri - The request URI
        provider - An EntityProvider implementation providing the payload of the request
        options - The Request Options
      • execute

        public ClientResponse execute​(String method,
                                      String uri,
                                      InputStream in,
                                      RequestOptions options)
        Deprecated.
        Sends the specified method request to the specified URI. This can be used to send extension HTTP methods to a server (e.g. PATCH, LOCK, etc)
        Parameters:
        method - The HTTP method
        uri - The request URI
        in - An InputStream providing the payload of the request
        options - The Request Options
      • execute

        public ClientResponse execute​(String method,
                                      String uri,
                                      org.apache.commons.httpclient.methods.RequestEntity entity,
                                      RequestOptions options)
        Deprecated.
        Sends the specified method request to the specified URI. This can be used to send extension HTTP methods to a server (e.g. PATCH, LOCK, etc)
        Parameters:
        method - The HTTP method
        uri - The request URI
        entity - A RequestEntity object providing the payload for the request
        options - The Request Options
      • getDefaultRequestOptions

        public RequestOptions getDefaultRequestOptions()
        Deprecated.
        Get a copy of the default request options
      • setAuthenticationSchemeDefaults

        public AbderaClient setAuthenticationSchemeDefaults()
        Deprecated.
        Configure the client to use the default authentication scheme settings
      • setAuthenticationSchemePriority

        public AbderaClient setAuthenticationSchemePriority​(String... scheme)
        Deprecated.
        When multiple authentication schemes are supported by a server, the client will automatically select a scheme based on the configured priority. For instance, to tell the client to prefer "digest" over "basic", set the priority by calling setAuthenticationSchemePriority("digest","basic")
      • teardown

        public AbderaClient teardown()
        Deprecated.

        Per http://jakarta.apache.org/commons/httpclient/performance.html

        Generally it is recommended to have a single instance of HttpClient per communication component or even per application. However, if the application makes use of HttpClient only very infrequently, and keeping an idle instance of HttpClient in memory is not warranted, it is highly recommended to explicitly shut down the multithreaded connection manager prior to disposing the HttpClient instance. This will ensure proper closure of all HTTP connections in the connection pool.
      • setMaxConnectionsPerHost

        public AbderaClient setMaxConnectionsPerHost​(int max)
        Deprecated.
        Set the maximum number of connections allowed for a single host
      • getMaxConnectionsPerHost

        public int getMaxConnectionsPerHost()
        Deprecated.
        Return the maximum number of connections allowed for a single host
      • setMaxConnectionsTotal

        public AbderaClient setMaxConnectionsTotal​(int max)
        Deprecated.
        Return the maximum number of connections allowed for the client
      • getMaxConnectionsTotal

        public int getMaxConnectionsTotal()
        Deprecated.
        Return the maximum number of connections allowed for the client
      • setProxy

        public AbderaClient setProxy​(String host,
                                     int port)
        Deprecated.
        Configure the client to use the specified proxy
      • setProxyCredentials

        public AbderaClient setProxyCredentials​(String host,
                                                int port,
                                                org.apache.commons.httpclient.Credentials credentials)
        Deprecated.
        Specify the auth credentials for the proxy server
      • setProxyCredentials

        public AbderaClient setProxyCredentials​(String host,
                                                int port,
                                                String realm,
                                                String scheme,
                                                org.apache.commons.httpclient.Credentials credentials)
        Deprecated.
        Specify the auth credentials for the proxy server
      • addCookies

        public AbderaClient addCookies​(org.apache.commons.httpclient.Cookie cookie)
        Deprecated.
        Manually add cookies
      • addCookies

        public AbderaClient addCookies​(org.apache.commons.httpclient.Cookie... cookies)
        Deprecated.
        Manually add cookies
      • getCookies

        public org.apache.commons.httpclient.Cookie[] getCookies()
        Deprecated.
        Get all the cookies
      • getCookies

        public org.apache.commons.httpclient.Cookie[] getCookies​(String domain,
                                                                 String path)
        Deprecated.
        Get the cookies for a specific domain and path
      • getCookies

        public org.apache.commons.httpclient.Cookie[] getCookies​(String domain)
        Deprecated.
        Get the cookies for a specific domain
      • clearCookies

        public AbderaClient clearCookies()
        Deprecated.
        Clear the cookies
      • setConnectionTimeout

        public AbderaClient setConnectionTimeout​(int timeout)
        Deprecated.
        Sets the timeout until a connection is etablished. A value of zero means the timeout is not used. The default value is zero.
      • setSocketTimeout

        public AbderaClient setSocketTimeout​(int timeout)
        Deprecated.
        Sets the default socket timeout (SO_TIMEOUT) in milliseconds which is the timeout for waiting for data. A timeout value of zero is interpreted as an infinite timeout.
      • setConnectionManagerTimeout

        public void setConnectionManagerTimeout​(long timeout)
        Deprecated.
        Sets the timeout in milliseconds used when retrieving an HTTP connection from the HTTP connection manager.
      • getConnectionTimeout

        public int getConnectionTimeout()
        Deprecated.
        Return the timeout until a connection is etablished, in milliseconds. A value of zero means the timeout is not used. The default value is zero.
      • getSocketTimeout

        public int getSocketTimeout()
        Deprecated.
        Return the socket timeout for the connection in milliseconds A timeout value of zero is interpreted as an infinite timeout.
      • getConnectionManagerTimeout

        public long getConnectionManagerTimeout()
        Deprecated.
        Returns the timeout in milliseconds used when retrieving an HTTP connection from the HTTP connection manager.
      • setTcpNoDelay

        public void setTcpNoDelay​(boolean enable)
        Deprecated.
        Determines whether Nagle's algorithm is to be used. The Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. When applications wish to decrease network latency and increase performance, they can disable Nagle's algorithm (that is enable TCP_NODELAY). Data will be sent earlier, at the cost of an increase in bandwidth consumption.
      • getTcpNoDelay

        public boolean getTcpNoDelay()
        Deprecated.
        Tests if Nagle's algorithm is to be used.
      • getHttpConnectionManagerParams

        public org.apache.commons.httpclient.params.HttpConnectionManagerParams getHttpConnectionManagerParams()
        Deprecated.
        Return the HttpConnectionManagerParams object of the underlying HttpClient. This enables you to configure options not explicitly exposed by the AbderaClient
      • getHttpClientParams

        public org.apache.commons.httpclient.params.HttpClientParams getHttpClientParams()
        Deprecated.
        Return the HttpClientParams object of the underlying HttpClient. This enables you to configure options not explicitly exposed by the AbderaClient
      • setMaximumRedirects

        public AbderaClient setMaximumRedirects​(int redirects)
        Deprecated.
        Set the maximum number of redirects
      • getMaximumRedirects

        public int getMaximumRedirects()
        Deprecated.
        Get the maximum number of redirects
      • clearCredentials

        public AbderaClient clearCredentials()
        Deprecated.
        Clear all credentials (including proxy credentials)
      • clearProxyCredentials

        public AbderaClient clearProxyCredentials()
        Deprecated.
        Clear proxy credentials
      • clearState

        public AbderaClient clearState()
        Deprecated.
        Clear all state (cookies, credentials, etc)