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

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

      If the property is not known, the user agent may invoke the method UserAgentErrorHandler.onUnknownProperty(String, String). If the property is known but the value 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.
    • getCookieConfig

      CookieConfig getCookieConfig()
      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).