Class HttpClientFactory

java.lang.Object
org.alfresco.httpclient.HttpClientFactory

public class HttpClientFactory extends Object
A factory to create HttpClients and AlfrescoHttpClients based on the setting of the 'secureCommsType' property.
Since:
4.0
  • Field Details

  • Constructor Details

  • Method Details

    • init

      public void init()
    • setHost

      public void setHost(String host)
    • getHost

      public String getHost()
    • setPort

      public void setPort(int port)
    • getPort

      public int getPort()
    • setSslPort

      public void setSslPort(int sslPort)
    • isSSL

      public boolean isSSL()
    • setSecureCommsType

      public void setSecureCommsType(String type)
    • setSSLEncryptionParameters

      public void setSSLEncryptionParameters(SSLEncryptionParameters sslEncryptionParameters)
    • setKeyStoreParameters

      public void setKeyStoreParameters(KeyStoreParameters keyStoreParameters)
    • setEncryptionParameters

      public void setEncryptionParameters(MD5EncryptionParameters encryptionParameters)
    • setKeyResourceLoader

      public void setKeyResourceLoader(KeyResourceLoader keyResourceLoader)
    • getMaxTotalConnections

      public int getMaxTotalConnections()
      Returns:
      the maxTotalConnections
    • setMaxTotalConnections

      public void setMaxTotalConnections(int maxTotalConnections)
      Parameters:
      maxTotalConnections - the maxTotalConnections to set
    • getMaxHostConnections

      public int getMaxHostConnections()
      Returns:
      the maxHostConnections
    • setMaxHostConnections

      public void setMaxHostConnections(int maxHostConnections)
      Parameters:
      maxHostConnections - the maxHostConnections to set
    • setSocketTimeout

      public void setSocketTimeout(Integer socketTimeout)
      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.
      Parameters:
      socketTimeout - Timeout in milliseconds
    • setConnectionTimeout

      public void setConnectionTimeout(int connectionTimeout)
      Attempts to connect to a server will timeout after this period (millis). Default is zero (the timeout is not used).
      Parameters:
      connectionTimeout - time in millis.
    • setSharedSecret

      public void setSharedSecret(String sharedSecret)
      Shared secret used for SECRET communication
      Parameters:
      secret - shared secret word
    • getSharedSecret

      public String getSharedSecret()
      Returns:
      Shared secret used for SECRET communication
    • setSharedSecretHeader

      public void setSharedSecretHeader(String sharedSecretHeader)
      HTTP Request header used for SECRET communication
      Parameters:
      sharedSecretHeader - HTTP Request header
    • getSharedSecretHeader

      public String getSharedSecretHeader()
      Returns:
      HTTP Request header used for SECRET communication
    • constructHttpClient

      protected RequestHeadersHttpClient constructHttpClient()
    • getHttpsClient

      protected RequestHeadersHttpClient getHttpsClient()
    • getHttpsClient

      protected RequestHeadersHttpClient getHttpsClient(String httpsHost, int httpsPort)
    • getDefaultHttpClient

      protected RequestHeadersHttpClient getDefaultHttpClient()
    • getDefaultHttpClient

      protected RequestHeadersHttpClient getDefaultHttpClient(String httpHost, int httpPort)
    • constructSharedSecretHttpClient

      protected RequestHeadersHttpClient constructSharedSecretHttpClient()
      Build HTTP Client using default headers
      Returns:
      RequestHeadersHttpClient including default header for shared secret method
    • getSharedSecretHttpClient

      protected RequestHeadersHttpClient getSharedSecretHttpClient()
    • getSharedSecretHttpClient

      protected RequestHeadersHttpClient getSharedSecretHttpClient(String httpHost, int httpPort)
    • getAlfrescoHttpsClient

      protected AlfrescoHttpClient getAlfrescoHttpsClient()
    • getAlfrescoHttpClient

      protected AlfrescoHttpClient getAlfrescoHttpClient()
    • getAlfrescoSharedSecretClient

      protected AlfrescoHttpClient getAlfrescoSharedSecretClient()
    • getMD5HttpClient

      protected org.apache.commons.httpclient.HttpClient getMD5HttpClient(String host, int port)
    • getRepoClient

      public AlfrescoHttpClient getRepoClient(String host, int port)
    • getHttpClient

      public RequestHeadersHttpClient getHttpClient()
    • getHttpClient

      public RequestHeadersHttpClient getHttpClient(String host, int port)