|
|||||||||
| 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_bHidden
|
private boolean |
m_bUseInterface
This describes, whether we can reach this interface or not. |
private boolean |
m_bVirtual
|
private long |
m_endOfBlocking
|
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
|
static java.lang.String |
XML_ATTR_HIDDEN
|
static java.lang.String |
XML_ATTR_VIRTUAL
|
static java.lang.String |
XML_ELEM_FILE
|
static java.lang.String |
XML_ELEM_HOST
|
static java.lang.String |
XML_ELEM_PORT
|
static java.lang.String |
XML_ELEMENT_CONTAINER_NAME
|
static java.lang.String |
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 | |
|---|---|
ListenerInterface(org.w3c.dom.Element listenerInterfaceNode)
Creates a new ListenerInterface from XML description (ListenerInterface node). |
|
ListenerInterface(java.lang.String a_strValue)
Creates a new ListenerInterface from a String which is of the form hostname:port. |
|
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 | |
|---|---|
void |
blockInterface(long a_blockingTime)
Blocks this interface for a specified time. |
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. |
boolean |
isHidden()
|
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(). |
boolean |
isVirtual()
|
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
public static final java.lang.String XML_ELEMENT_NAME
public static final java.lang.String XML_ELEMENT_CONTAINER_NAME
public static final java.lang.String XML_ATTR_HIDDEN
public static final java.lang.String XML_ATTR_VIRTUAL
public static final java.lang.String XML_ELEM_HOST
public static final java.lang.String XML_ELEM_PORT
public static final java.lang.String XML_ELEM_FILE
private long m_endOfBlocking
private java.lang.String m_strHostname
private int m_iInetPort
private int m_iProtocolType
private boolean m_bUseInterface
private boolean m_bVirtual
private boolean m_bHidden
| 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_strValue)
throws java.lang.IllegalArgumentException
a_strValue - The string containing hostname and port.
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 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 void blockInterface(long a_blockingTime)
a_blockingTime - longpublic boolean isValid()
isValid in interface ImmutableListenerInterfacepublic boolean isVirtual()
public boolean isHidden()
protected 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 | ||||||||