|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectanon.infoservice.ListenerInterface
public class ListenerInterface
Saves the information about a network server.
| Field Summary | |
|---|---|
private boolean |
m_bUseInterface
This describes, whether we can reach this interface or not. |
private int |
m_iInetPort
This is the representation of the port of the ListenerInterface. |
private int |
m_iProtocolType
This describes the protocol type. |
private java.lang.String |
m_strHostname
This is the host of this interface (hostname or IP). |
static int |
PORT_MAX_VALUE
|
static int |
PORT_MIN_VALUE
|
| Fields inherited from interface anon.infoservice.ImmutableListenerInterface |
|---|
PROTOCOL_STR_TYPE_HTTP, PROTOCOL_STR_TYPE_HTTPS, PROTOCOL_STR_TYPE_RAW_TCP, PROTOCOL_STR_TYPE_SOCKS, PROTOCOL_STR_TYPE_UNKNOWN, PROTOCOL_TYPE_HTTP, PROTOCOL_TYPE_HTTPS, PROTOCOL_TYPE_RAW_TCP, PROTOCOL_TYPE_SOCKS, PROTOCOL_TYPE_UNKNOWN |
| Fields inherited from interface anon.util.IXMLEncodable |
|---|
FIELD_XML_ELEMENT_CONTAINER_NAME, FIELD_XML_ELEMENT_NAME, XML_ATTR_ID, XML_ATTR_VERSION |
| Constructor Summary | |
|---|---|
ListenerInterface(org.w3c.dom.Element listenerInterfaceNode)
Creates a new ListenerInterface from XML description (ListenerInterface node). |
|
ListenerInterface(java.lang.String a_hostname,
int a_port)
Creates a new ListenerInterface from a hostname / IP address and a port. |
|
ListenerInterface(java.lang.String a_hostname,
int a_port,
int a_protocol)
Creates a new ListenerInterface from a hostname / IP address, a port and a protocol information. |
|
| Method Summary | |
|---|---|
boolean |
equals(ListenerInterface a_listenerInterface)
Tests if two ListenerInterface instances are equal. |
java.lang.String |
getHost()
Get the host (hostname or IP) of this interface as a String. |
int |
getPort()
Get the port of this interface. |
int |
getProtocol()
Gets the protocol of this ListenerInterface. |
java.lang.String |
getProtocolAsString()
Gets the protocol of this ListenerInterface as String. |
static java.lang.String |
getXMLElementName()
Gets the name of the corresponding xml element. |
boolean |
isValid()
Get the validity of this interface. |
static boolean |
isValidHostname(java.lang.String a_hostname)
Returns if the given host name is valid. |
static boolean |
isValidIP(java.lang.String a_ipAddress)
Returns if the given IP address is valid. |
static boolean |
isValidPort(int a_port)
Returns if the given port is valid. |
static boolean |
isValidProtocol(int a_protocol)
Returns if the given protocol is valid web protocol and can be recognized by recognizeProtocol(). |
static boolean |
isValidProtocol(java.lang.String a_protocol)
Returns if the given protocol is valid web protocol and can be recognized by recognizeProtocol(). |
protected static int |
recognizeProtocol(int a_protocol)
Transforms a given protocol into a valid protocol if recognized. |
protected static int |
recognizeProtocol(java.lang.String a_protocol)
Transforms a given protocol into a valid protocol if recognized. |
void |
setHostname(java.lang.String a_strHostname)
Sets the host name. |
void |
setPort(int a_port)
Sets the port number. |
void |
setProtocol(int a_protocol)
Sets the protocol. |
void |
setProtocol(java.lang.String a_protocol)
Sets the protocol. |
void |
setUseInterface(boolean a_bUseInterface)
Sets if this interface is used or not. |
java.lang.String |
toString()
|
java.util.Vector |
toVector()
Creates a Vector of listeners with only the current listener. |
org.w3c.dom.Element |
toXmlElement(org.w3c.dom.Document a_doc)
Creates an XML node without signature for this ListenerInterface.. |
protected org.w3c.dom.Element |
toXmlElementInternal(org.w3c.dom.Document doc,
java.lang.String a_strXmlElementName)
Creates an XML node without signature for this ListenerInterface. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int PORT_MIN_VALUE
public static final int PORT_MAX_VALUE
private java.lang.String m_strHostname
private int m_iInetPort
private int m_iProtocolType
private boolean m_bUseInterface
| Constructor Detail |
|---|
public ListenerInterface(org.w3c.dom.Element listenerInterfaceNode)
throws XMLParseException
listenerInterfaceNode - The ListenerInterface node from an XML document.
XMLParseException - if an error in the xml structure occurs
public ListenerInterface(java.lang.String a_hostname,
int a_port)
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).
java.lang.IllegalArgumentException - if an illegal host name or port was given
public ListenerInterface(java.lang.String a_hostname,
int a_port,
int a_protocol)
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.
java.lang.IllegalArgumentException - if an illegal host name, port or protocol was given| Method Detail |
|---|
public static java.lang.String getXMLElementName()
public static boolean isValidPort(int a_port)
a_port - a port number
public static boolean isValidProtocol(java.lang.String a_protocol)
a_protocol - a web protocol
recognizeProtocol(String)public static boolean isValidProtocol(int a_protocol)
a_protocol - a web protocol
recognizeProtocol(String)public static boolean isValidHostname(java.lang.String a_hostname)
a_hostname - a host name
public static boolean isValidIP(java.lang.String a_ipAddress)
a_ipAddress - an IP address
public int getProtocol()
getProtocol in interface ImmutableListenerInterfacepublic java.lang.String getProtocolAsString()
public java.lang.String getHost()
getHost in interface ImmutableListenerInterfacepublic int getPort()
getPort in interface ImmutableListenerInterfacepublic boolean equals(ListenerInterface a_listenerInterface)
a_listenerInterface - a ListenerInterface
public org.w3c.dom.Element toXmlElement(org.w3c.dom.Document a_doc)
toXmlElement in interface IXMLEncodablea_doc - The XML document, which is the environment for the created XML node.
public void setUseInterface(boolean a_bUseInterface)
a_bUseInterface - true if this interface is used; false otherwisepublic boolean isValid()
isValid in interface ImmutableListenerInterfaceprotected static int recognizeProtocol(java.lang.String a_protocol)
a_protocol - a protocol
protected static int recognizeProtocol(int a_protocol)
a_protocol - a protocol
public void setProtocol(java.lang.String a_protocol)
a_protocol - a protocolpublic void setProtocol(int a_protocol)
a_protocol - a protocolpublic void setPort(int a_port)
a_port - a port numberpublic void setHostname(java.lang.String a_strHostname)
a_strHostname - a host namepublic java.util.Vector toVector()
protected org.w3c.dom.Element toXmlElementInternal(org.w3c.dom.Document doc,
java.lang.String a_strXmlElementName)
doc - The XML document, which is the environment for the created XML node.a_strXmlElementName - the name of the xml element to create
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||