- All Known Implementing Classes:
AbstractUserAgent,DefaultUserAgent,DOM4JUserAgent,DOMCSSStyleSheetFactory.WrapperUserAgent
- Enclosing interface:
UserAgent
public static interface UserAgent.AgentControl
User agent configuration and control.
-
Method Summary
Modifier and TypeMethodDescriptionauthenticationCredentials(String host, String realm) Gives the credentials for the given hostname and realm, creating a new one if there is none.getAuthenticationCredentials(URL url, String realm) Gets the authentication credentials for the given URL.getProperty(String propertyName) Gets a control property.voidsetConnectionTimeout(int timeout) Sets the connection timeout.booleansetProperty(String propertyName, String value) Sets a control property.
-
Method Details
-
getProperty
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
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:
trueif the property was set successfully.
-
getAuthenticationCredentials
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
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. Atimeoutof 0 means no timeout (the default).
-