Class QueryNetwork
java.lang.Object
org.libxmq.Query
org.libxmq.QueryNetwork
Implements network related queries, url:s, hostnames, ip-addresses etc.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringRetrieve a fully qualified domain name, such as mail.mydomain.com.static StringgetHostname(String xpath) Retrieve a host name, such as mail or gateway or mycomputer.static InetAddressgetInetAddress(String xpath) Retrieve an internet address ipv4 or ipv6.static URLRetrieve an URL, such as https://foo.bar.com?Methods inherited from class org.libxmq.Query
element, expect, forEach, getBoolean, getDouble, getFloat, getInt, getLong, getOptionalBoolean, getOptionalDouble, getOptionalFloat, getOptionalInt, getOptionalLong, getOptionalString, getString, getXPathExpression, node, optionalElement, query
-
Constructor Details
-
QueryNetwork
Build a new query from a DOM node.- Parameters:
node- The DOM node from which the paths start when querying.
-
-
Method Details
-
getInetAddress
public static InetAddress getInetAddress(String xpath) throws DecodingException, NotFoundException, TooManyException Retrieve an internet address ipv4 or ipv6.- Parameters:
xpath- Fetch the value found using this xpath.- Returns:
- The iternet address.
- Throws:
NotFoundException- if the expected xpath was not found.DecodingException- if the value was not an integer or if it failed the restriction.TooManyException- if more than one element matched the xpath.
-
getHostname
public static String getHostname(String xpath) throws NotFoundException, DecodingException, TooManyException Retrieve a host name, such as mail or gateway or mycomputer.- Parameters:
xpath- Use this xpath to find the host name.- Returns:
- The hostname.
- Throws:
NotFoundException- if the expected xpath was not found.DecodingException- if the value was not an integer or if it failed the restriction.TooManyException- if more than one element matched the xpath.
-
getFQDN
public static String getFQDN(String xpath) throws NotFoundException, DecodingException, TooManyException Retrieve a fully qualified domain name, such as mail.mydomain.com.- Parameters:
xpath- Use this xpath to find the host name.- Returns:
- The fqdn.
- Throws:
NotFoundException- if the expected xpath was not found.DecodingException- if the value was not an integer or if it failed the restriction.TooManyException- if more than one element matched the xpath.
-
getURL
public static URL getURL(String xpath) throws NotFoundException, DecodingException, TooManyException Retrieve an URL, such as https://foo.bar.com?a=123- Parameters:
xpath- Use this xpath to find the host name.- Returns:
- The url address.
- Throws:
NotFoundException- if the expected xpath was not found.DecodingException- if the value was not an integer or if it failed the restriction.TooManyException- if more than one element matched the xpath.
-