|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectanon.infoservice.ListenerInterface
anon.infoservice.ProxyInterface
public final class ProxyInterface
This class is used to store information about a proxy connection.
| Field Summary | |
|---|---|
private static long |
AUTH_PASS_CANCEL_WAIT_TIME
Authentication stuff |
private java.lang.String |
m_authenticationPassword
A password for http authentication. |
private java.lang.String |
m_authenticationUserID
A user id for http authentication. |
private long |
m_authPassLastCancelTime
|
private boolean |
m_bAuthPassDialogShown
|
private boolean |
m_bUseAuthentication
If the authentication strings are used. |
private boolean |
m_bUseInterface
If the proxy is used or not. |
private IPasswordReader |
m_passwordReader
The password reader instance. |
private static java.lang.String |
XML_AUTHENTICATION_USER_ID
The name of the xml node that stores the user id for authentication. |
private static java.lang.String |
XML_USE_AUTHENTICATION
The name of the xml node that describes if authentication is used. |
private static java.lang.String |
XML_USE_PROXY
The name of the xml node that describes if authentication is used. |
| Fields inherited from class anon.infoservice.ListenerInterface |
|---|
PORT_MAX_VALUE, PORT_MIN_VALUE, XML_ATTR_HIDDEN, XML_ATTR_VIRTUAL, XML_ELEM_FILE, XML_ELEM_HOST, XML_ELEM_PORT, XML_ELEMENT_CONTAINER_NAME, XML_ELEMENT_NAME |
| Fields inherited from interface anon.util.IXMLEncodable |
|---|
FIELD_XML_ELEMENT_CONTAINER_NAME, FIELD_XML_ELEMENT_NAME, XML_ATTR_ID, XML_ATTR_LANGUAGE, XML_ATTR_VERSION |
| Constructor Summary | |
|---|---|
ProxyInterface(org.w3c.dom.Element a_proxyInterfaceNode,
IPasswordReader a_passwordReader)
Creates a new ProxyInterface from XML description (ProxyInterface node). |
|
ProxyInterface(java.lang.String a_hostname,
int a_port,
int a_protocol,
IPasswordReader a_passwordReader)
Creates a new ListenerInterface from a hostname / IP address, a port and a protocol information. |
|
ProxyInterface(java.lang.String a_hostname,
int a_port,
int a_protocol,
java.lang.String a_authenticationUserID,
IPasswordReader a_passwordReader,
boolean a_bUseAuthentication,
boolean a_bIsValid)
Creates a new interface for a proxy that needs basic http authentication. |
|
ProxyInterface(java.lang.String a_hostname,
int a_port,
IPasswordReader a_passwordReader)
Creates a new interface from a hostname / IP address and a port. |
|
ProxyInterface(java.lang.String a_hostname,
int a_port,
java.lang.String a_protocol,
java.lang.String a_authenticationUserID,
IPasswordReader a_passwordReader,
boolean a_bUseAuthentication,
boolean a_bIsValid)
Creates a new interface for a proxy that needs basic http authentication. |
|
| Method Summary | |
|---|---|
void |
clearAuthenticationPassword()
|
boolean |
equals(ProxyInterface a_proxyInterface)
Tests if two interface instances are equal. |
java.lang.String |
getAuthenticationPassword()
Gets the authentication password of this interface. |
java.lang.String |
getAuthenticationUserID()
Gets the authentication user ID of this interface. |
HTTPClient.NVPair |
getProxyAuthorizationHeader()
Get the authorization header with the current user id and password. |
java.lang.String |
getProxyAuthorizationHeaderAsString()
Gets the authorization header with the current user id and password as a String. |
static java.lang.String |
getXMLElementName()
Gets the name of the corresponding xml element. |
boolean |
isAuthenticationUsed()
Gets if the authentication strings are used. |
boolean |
isValid()
Gets if the proxy is used or not. |
static boolean |
isValidUserID(java.lang.String a_authenticationUserID)
Gets if the given string is a valid user ID for authentication. |
void |
setAuthenticationUserID(java.lang.String a_authenticationUserID)
Sets the authentication user ID of this interface and resets the authentication password if the user id has changed. |
boolean |
setUseAuthentication(boolean a_bUseAuthentication)
Sets if the authentication strings are used and reads a password form the password reader if necessary. |
void |
setUseInterface(boolean a_bUseInterface)
Activates and deactivates the proxy. |
org.w3c.dom.Element |
toXmlElement(org.w3c.dom.Document a_doc)
Creates an XML node without signature and password for this ProxyInterface. |
| Methods inherited from class anon.infoservice.ListenerInterface |
|---|
blockInterface, equals, getHost, getPort, getProtocol, getProtocolAsString, isHidden, isValidHostname, isValidIP, isValidPort, isValidProtocol, isValidProtocol, isVirtual, recognizeProtocol, recognizeProtocol, setHostname, setPort, setProtocol, setProtocol, toString, toVector, toXmlElementInternal |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface anon.infoservice.ImmutableListenerInterface |
|---|
getHost, getPort, getProtocol |
| Field Detail |
|---|
private static java.lang.String XML_USE_AUTHENTICATION
private static java.lang.String XML_USE_PROXY
private static java.lang.String XML_AUTHENTICATION_USER_ID
private java.lang.String m_authenticationPassword
private java.lang.String m_authenticationUserID
private boolean m_bUseAuthentication
private boolean m_bUseInterface
private IPasswordReader m_passwordReader
private static final long AUTH_PASS_CANCEL_WAIT_TIME
private volatile long m_authPassLastCancelTime
private boolean m_bAuthPassDialogShown
| Constructor Detail |
|---|
public ProxyInterface(org.w3c.dom.Element a_proxyInterfaceNode,
IPasswordReader a_passwordReader)
throws XMLParseException
a_proxyInterfaceNode - The ProxyInterface node from an XML document.a_passwordReader - the password reader; this is allowed to be null,
but then you won`t be able to use proxy authentication
XMLParseException - if an error in the xml structure occurs
public ProxyInterface(java.lang.String a_hostname,
int a_port,
IPasswordReader a_passwordReader)
throws java.lang.IllegalArgumentException
a_hostname - The hostname or the IP address of this interface.a_port - The port of this interface.a_passwordReader - the password reader; this is allowed to be null,
but then you won`t be able to use proxy authentication
java.lang.IllegalArgumentException - if an illegal host name or port was given
public ProxyInterface(java.lang.String a_hostname,
int a_port,
int a_protocol,
IPasswordReader a_passwordReader)
throws java.lang.IllegalArgumentException
a_hostname - The hostname or the IP address of this interface.a_port - The port of this interface (1 <= port <= 65535).a_protocol - The protocol information. Invalid protocols are replaced by http.a_passwordReader - the password reader; this is allowed to be null,
but then you won`t be able to use proxy authentication
java.lang.IllegalArgumentException - if an illegal host name, port or protocol was given
public ProxyInterface(java.lang.String a_hostname,
int a_port,
java.lang.String a_protocol,
java.lang.String a_authenticationUserID,
IPasswordReader a_passwordReader,
boolean a_bUseAuthentication,
boolean a_bIsValid)
throws java.lang.IllegalArgumentException
a_hostname - The hostname or the IP address of this interface.a_port - The port of this interface (1 <= port <= 65535).a_protocol - The protocol information. Invalid protocols are replaced by http.a_authenticationUserID - a user ID for authenticationa_passwordReader - the password reader; this is allowed to be null,
but then you won`t be able to use proxy authenticationa_bUseAuthentication - true if the authentication strings are used; false otherwisea_bIsValid - if the proxy should be used by now (true) or later (false)
java.lang.IllegalArgumentException - if an illegal host name, port or protocol was given
or if authentication should be used without password reader
public ProxyInterface(java.lang.String a_hostname,
int a_port,
int a_protocol,
java.lang.String a_authenticationUserID,
IPasswordReader a_passwordReader,
boolean a_bUseAuthentication,
boolean a_bIsValid)
throws java.lang.IllegalArgumentException
a_hostname - The hostname or the IP address of this interface.a_port - The port of this interface (1 <= port <= 65535).a_protocol - The protocol information. Invalid protocols are replaced by http.a_authenticationUserID - a user ID for authenticationa_passwordReader - the password reader; this is allowed to be null,
but then you won`t be able to use proxy authenticationa_bUseAuthentication - true if the authentication strings are used; false otherwisea_bIsValid - if the proxy should be used by now (true) or later (false)
java.lang.IllegalArgumentException - if an illegal host name, port or protocol was given
or if authentication should be used without password reader| Method Detail |
|---|
public static java.lang.String getXMLElementName()
public static boolean isValidUserID(java.lang.String a_authenticationUserID)
a_authenticationUserID - a String
public boolean isAuthenticationUsed()
isAuthenticationUsed in interface ImmutableProxyInterface
public boolean setUseAuthentication(boolean a_bUseAuthentication)
throws java.lang.IllegalStateException
a_bUseAuthentication - true if the authentication strings should be used; false otherwise
java.lang.IllegalStateException - if authentication should be used, but it is not possible
public java.lang.String getAuthenticationPassword()
throws java.lang.IllegalStateException
getAuthenticationPassword in interface ImmutableProxyInterfacejava.lang.IllegalStateException - if no password reader is registeredpublic void clearAuthenticationPassword()
public java.lang.String getAuthenticationUserID()
getAuthenticationUserID in interface ImmutableProxyInterfacepublic void setAuthenticationUserID(java.lang.String a_authenticationUserID)
a_authenticationUserID - the authentication user ID of this interface
public java.lang.String getProxyAuthorizationHeaderAsString()
throws java.lang.IllegalStateException
getProxyAuthorizationHeaderAsString in interface ImmutableProxyInterfacejava.lang.IllegalStateException - if the authentication mode is not activated
public HTTPClient.NVPair getProxyAuthorizationHeader()
throws java.lang.IllegalStateException
getProxyAuthorizationHeader in interface ImmutableProxyInterfacejava.lang.IllegalStateException - if the authentication mode is not activatedpublic boolean equals(ProxyInterface a_proxyInterface)
a_proxyInterface - a ListenerInterface
public org.w3c.dom.Element toXmlElement(org.w3c.dom.Document a_doc)
toXmlElement in interface IXMLEncodabletoXmlElement in class ListenerInterfacea_doc - The XML document, which is the environment for the created XML node.
public boolean isValid()
isValid in interface ImmutableListenerInterfaceisValid in class ListenerInterfacepublic void setUseInterface(boolean a_bUseInterface)
setUseInterface in class ListenerInterfacea_bUseInterface - boolean
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||