Interface UserAgent.AgentControl

All Known Implementing Classes:
AbstractUserAgent, DefaultUserAgent, DOM4JUserAgent, DOMCSSStyleSheetFactory.WrapperUserAgent
Enclosing interface:
UserAgent

public static interface UserAgent.AgentControl
User agent configuration and control.
  • Method Details

    • getProperty

      String getProperty(String propertyName)
      Gets a control property.
      Parameters:
      propertyName - the property name.
      Returns:
      the string representation of the property value, or null if the property is not set.
    • setProperty

      boolean setProperty(String propertyName, String value)
      Sets a control property.

      If the property is wrong, the user agent should call the method UserAgentErrorHandler.onWrongPropertyValue(String, String).

      Parameters:
      propertyName - the name of the property to set.
      value - the string representation of the property value.
      Returns:
      true if the property was set successfully.
    • getCookieConfig

      @Deprecated(forRemoval=true) default CookieConfig getCookieConfig()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets the global, useragent-wide default cookie config.
      Returns:
      the default user-agent cookie config.
    • getAuthenticationCredentials

      AuthenticationCredentials getAuthenticationCredentials(URL url, String realm)
      Gets the authentication credentials for the given URL.
      Parameters:
      url - the url for which the credential is required.
      realm - the realm name, or null if there is no realm, in which case any valid credential will be returned.
      Returns:
      the authentication credentials, or null if there is none.
    • authenticationCredentials

      AuthenticationCredentials authenticationCredentials(String host, String realm)
      Gives the credentials for the given hostname and realm, creating a new one if there is none.
      Parameters:
      host - the host.
      realm - the realm. Cannot be null.
      Returns:
      the credentials.
    • setConnectionTimeout

      void setConnectionTimeout(int timeout)
      Sets the connection timeout.
      Parameters:
      timeout - the connection timeout, in milliseconds. A timeout of 0 means no timeout (the default).