13742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman// Copyright 2003-2005 Arthur van Hoff, Rick Blair
23742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman// Licensed under Apache License version 2.0
33742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman// Original license LGPL
43742d9db8b6edb10627b0f89336cca5249f1d15aManuel Romanpackage javax.jmdns;
53742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
63742d9db8b6edb10627b0f89336cca5249f1d15aManuel Romanimport java.net.Inet4Address;
73742d9db8b6edb10627b0f89336cca5249f1d15aManuel Romanimport java.net.Inet6Address;
83742d9db8b6edb10627b0f89336cca5249f1d15aManuel Romanimport java.net.InetAddress;
93742d9db8b6edb10627b0f89336cca5249f1d15aManuel Romanimport java.util.Enumeration;
103742d9db8b6edb10627b0f89336cca5249f1d15aManuel Romanimport java.util.Map;
113742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
123742d9db8b6edb10627b0f89336cca5249f1d15aManuel Romanimport javax.jmdns.impl.ServiceInfoImpl;
133742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
143742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman/**
153742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * <p>
163742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * The fully qualified service name is build using up to 5 components with the following structure:
173742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman *
183742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * <pre>
193742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman *            &lt;app&gt;.&lt;protocol&gt;.&lt;servicedomain&gt;.&lt;parentdomain&gt;.<br/>
203742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * &lt;Instance&gt;.&lt;app&gt;.&lt;protocol&gt;.&lt;servicedomain&gt;.&lt;parentdomain&gt;.<br/>
213742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * &lt;sub&gt;._sub.&lt;app&gt;.&lt;protocol&gt;.&lt;servicedomain&gt;.&lt;parentdomain&gt;.
223742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * </pre>
233742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman *
243742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * <ol>
253742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * <li>&lt;servicedomain&gt;.&lt;parentdomain&gt;: This is the domain scope of the service typically "local.", but this can also be something similar to "in-addr.arpa." or "ip6.arpa."</li>
263742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * <li>&lt;protocol&gt;: This is either "_tcp" or "_udp"</li>
273742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * <li>&lt;app&gt;: This define the application protocol. Typical example are "_http", "_ftp", etc.</li>
283742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * <li>&lt;Instance&gt;: This is the service name</li>
293742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * <li>&lt;sub&gt;: This is the subtype for the application protocol</li>
303742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * </ol>
313742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * </p>
323742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman */
333742d9db8b6edb10627b0f89336cca5249f1d15aManuel Romanpublic abstract class ServiceInfo implements Cloneable {
343742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
353742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
363742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * This is the no value text byte. According top the specification it is one byte with 0 value.
373742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
383742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public static final byte[] NO_VALUE = new byte[0];
393742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
403742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
413742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Fields for the fully qualified map.
423742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
433742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public enum Fields {
443742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman        /**
453742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman         * Domain Field.
463742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman         */
473742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman        Domain,
483742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman        /**
493742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman         * Protocol Field.
503742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman         */
513742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman        Protocol,
523742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman        /**
533742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman         * Application Field.
543742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman         */
553742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman        Application,
563742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman        /**
573742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman         * Instance Field.
583742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman         */
593742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman        Instance,
603742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman        /**
613742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman         * Subtype Field.
623742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman         */
633742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman        Subtype
643742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    }
653742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
663742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
673742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Construct a service description for registering with JmDNS.
683742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
693742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param type
703742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            fully qualified service type name, such as <code>_http._tcp.local.</code>.
713742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param name
723742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            unqualified service instance name, such as <code>foobar</code>
733742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param port
743742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            the local port on which the service runs
753742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param text
763742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            string describing the service
773742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return new service info
783742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
793742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public static ServiceInfo create(final String type, final String name, final int port, final String text) {
803742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman        return new ServiceInfoImpl(type, name, "", port, 0, 0, false, text);
813742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    }
823742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
833742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
843742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Construct a service description for registering with JmDNS.
853742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
863742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param type
873742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            fully qualified service type name, such as <code>_http._tcp.local.</code>.
883742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param name
893742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            unqualified service instance name, such as <code>foobar</code>
903742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param subtype
913742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            service subtype see draft-cheshire-dnsext-dns-sd-06.txt chapter 7.1 Selective Instance Enumeration
923742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param port
933742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            the local port on which the service runs
943742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param text
953742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            string describing the service
963742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return new service info
973742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
983742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public static ServiceInfo create(final String type, final String name, final String subtype, final int port, final String text) {
993742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman        return new ServiceInfoImpl(type, name, subtype, port, 0, 0, false, text);
1003742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    }
1013742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
1023742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
1033742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Construct a service description for registering with JmDNS.
1043742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
1053742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param type
1063742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            fully qualified service type name, such as <code>_http._tcp.local.</code>.
1073742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param name
1083742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            unqualified service instance name, such as <code>foobar</code>
1093742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param port
1103742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            the local port on which the service runs
1113742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param weight
1123742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            weight of the service
1133742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param priority
1143742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            priority of the service
1153742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param text
1163742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            string describing the service
1173742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return new service info
1183742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
1193742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public static ServiceInfo create(final String type, final String name, final int port, final int weight, final int priority, final String text) {
1203742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman        return new ServiceInfoImpl(type, name, "", port, weight, priority, false, text);
1213742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    }
1223742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
1233742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
1243742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Construct a service description for registering with JmDNS.
1253742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
1263742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param type
1273742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            fully qualified service type name, such as <code>_http._tcp.local.</code>.
1283742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param name
1293742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            unqualified service instance name, such as <code>foobar</code>
1303742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param subtype
1313742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            service subtype see draft-cheshire-dnsext-dns-sd-06.txt chapter 7.1 Selective Instance Enumeration
1323742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param port
1333742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            the local port on which the service runs
1343742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param weight
1353742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            weight of the service
1363742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param priority
1373742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            priority of the service
1383742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param text
1393742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            string describing the service
1403742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return new service info
1413742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
1423742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public static ServiceInfo create(final String type, final String name, final String subtype, final int port, final int weight, final int priority, final String text) {
1433742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman        return new ServiceInfoImpl(type, name, subtype, port, weight, priority, false, text);
1443742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    }
1453742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
1463742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
1473742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Construct a service description for registering with JmDNS. The properties hashtable must map property names to either Strings or byte arrays describing the property values.
1483742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
1493742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param type
1503742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            fully qualified service type name, such as <code>_http._tcp.local.</code>.
1513742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param name
1523742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            unqualified service instance name, such as <code>foobar</code>
1533742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param port
1543742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            the local port on which the service runs
1553742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param weight
1563742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            weight of the service
1573742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param priority
1583742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            priority of the service
1593742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param props
1603742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            properties describing the service
1613742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return new service info
1623742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
1633742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public static ServiceInfo create(final String type, final String name, final int port, final int weight, final int priority, final Map<String, ?> props) {
1643742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman        return new ServiceInfoImpl(type, name, "", port, weight, priority, false, props);
1653742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    }
1663742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
1673742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
1683742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Construct a service description for registering with JmDNS. The properties hashtable must map property names to either Strings or byte arrays describing the property values.
1693742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
1703742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param type
1713742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            fully qualified service type name, such as <code>_http._tcp.local.</code>.
1723742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param name
1733742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            unqualified service instance name, such as <code>foobar</code>
1743742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param subtype
1753742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            service subtype see draft-cheshire-dnsext-dns-sd-06.txt chapter 7.1 Selective Instance Enumeration
1763742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param port
1773742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            the local port on which the service runs
1783742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param weight
1793742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            weight of the service
1803742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param priority
1813742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            priority of the service
1823742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param props
1833742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            properties describing the service
1843742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return new service info
1853742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
1863742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public static ServiceInfo create(final String type, final String name, final String subtype, final int port, final int weight, final int priority, final Map<String, ?> props) {
1873742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman        return new ServiceInfoImpl(type, name, subtype, port, weight, priority, false, props);
1883742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    }
1893742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
1903742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
1913742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Construct a service description for registering with JmDNS.
1923742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
1933742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param type
1943742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            fully qualified service type name, such as <code>_http._tcp.local.</code>.
1953742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param name
1963742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            unqualified service instance name, such as <code>foobar</code>
1973742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param port
1983742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            the local port on which the service runs
1993742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param weight
2003742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            weight of the service
2013742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param priority
2023742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            priority of the service
2033742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param text
2043742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            bytes describing the service
2053742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return new service info
2063742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
2073742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public static ServiceInfo create(final String type, final String name, final int port, final int weight, final int priority, final byte[] text) {
2083742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman        return new ServiceInfoImpl(type, name, "", port, weight, priority, false, text);
2093742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    }
2103742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
2113742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
2123742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Construct a service description for registering with JmDNS.
2133742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
2143742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param type
2153742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            fully qualified service type name, such as <code>_http._tcp.local.</code>.
2163742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param name
2173742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            unqualified service instance name, such as <code>foobar</code>
2183742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param subtype
2193742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            service subtype see draft-cheshire-dnsext-dns-sd-06.txt chapter 7.1 Selective Instance Enumeration
2203742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param port
2213742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            the local port on which the service runs
2223742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param weight
2233742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            weight of the service
2243742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param priority
2253742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            priority of the service
2263742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param text
2273742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            bytes describing the service
2283742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return new service info
2293742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
2303742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public static ServiceInfo create(final String type, final String name, final String subtype, final int port, final int weight, final int priority, final byte[] text) {
2313742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman        return new ServiceInfoImpl(type, name, subtype, port, weight, priority, false, text);
2323742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    }
2333742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
2343742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
2353742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Construct a service description for registering with JmDNS.
2363742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
2373742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param type
2383742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            fully qualified service type name, such as <code>_http._tcp.local.</code>.
2393742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param name
2403742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            unqualified service instance name, such as <code>foobar</code>
2413742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param port
2423742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            the local port on which the service runs
2433742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param weight
2443742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            weight of the service
2453742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param priority
2463742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            priority of the service
2473742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param persistent
2483742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            if <code>true</code> ServiceListener.resolveService will be called whenever new new information is received.
2493742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param text
2503742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            string describing the service
2513742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return new service info
2523742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
2533742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public static ServiceInfo create(final String type, final String name, final int port, final int weight, final int priority, final boolean persistent, final String text) {
2543742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman        return new ServiceInfoImpl(type, name, "", port, weight, priority, persistent, text);
2553742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    }
2563742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
2573742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
2583742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Construct a service description for registering with JmDNS.
2593742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
2603742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param type
2613742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            fully qualified service type name, such as <code>_http._tcp.local.</code>.
2623742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param name
2633742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            unqualified service instance name, such as <code>foobar</code>
2643742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param subtype
2653742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            service subtype see draft-cheshire-dnsext-dns-sd-06.txt chapter 7.1 Selective Instance Enumeration
2663742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param port
2673742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            the local port on which the service runs
2683742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param weight
2693742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            weight of the service
2703742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param priority
2713742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            priority of the service
2723742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param persistent
2733742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            if <code>true</code> ServiceListener.resolveService will be called whenever new new information is received.
2743742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param text
2753742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            string describing the service
2763742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return new service info
2773742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
2783742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public static ServiceInfo create(final String type, final String name, final String subtype, final int port, final int weight, final int priority, final boolean persistent, final String text) {
2793742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman        return new ServiceInfoImpl(type, name, subtype, port, weight, priority, persistent, text);
2803742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    }
2813742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
2823742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
2833742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Construct a service description for registering with JmDNS. The properties hashtable must map property names to either Strings or byte arrays describing the property values.
2843742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
2853742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param type
2863742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            fully qualified service type name, such as <code>_http._tcp.local.</code>.
2873742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param name
2883742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            unqualified service instance name, such as <code>foobar</code>
2893742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param port
2903742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            the local port on which the service runs
2913742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param weight
2923742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            weight of the service
2933742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param priority
2943742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            priority of the service
2953742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param persistent
2963742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            if <code>true</code> ServiceListener.resolveService will be called whenever new new information is received.
2973742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param props
2983742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            properties describing the service
2993742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return new service info
3003742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
3013742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public static ServiceInfo create(final String type, final String name, final int port, final int weight, final int priority, final boolean persistent, final Map<String, ?> props) {
3023742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman        return new ServiceInfoImpl(type, name, "", port, weight, priority, persistent, props);
3033742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    }
3043742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
3053742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
3063742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Construct a service description for registering with JmDNS. The properties hashtable must map property names to either Strings or byte arrays describing the property values.
3073742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
3083742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param type
3093742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            fully qualified service type name, such as <code>_http._tcp.local.</code>.
3103742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param name
3113742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            unqualified service instance name, such as <code>foobar</code>
3123742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param subtype
3133742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            service subtype see draft-cheshire-dnsext-dns-sd-06.txt chapter 7.1 Selective Instance Enumeration
3143742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param port
3153742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            the local port on which the service runs
3163742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param weight
3173742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            weight of the service
3183742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param priority
3193742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            priority of the service
3203742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param persistent
3213742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            if <code>true</code> ServiceListener.resolveService will be called whenever new new information is received.
3223742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param props
3233742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            properties describing the service
3243742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return new service info
3253742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
3263742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public static ServiceInfo create(final String type, final String name, final String subtype, final int port, final int weight, final int priority, final boolean persistent, final Map<String, ?> props) {
3273742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman        return new ServiceInfoImpl(type, name, subtype, port, weight, priority, persistent, props);
3283742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    }
3293742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
3303742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
3313742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Construct a service description for registering with JmDNS.
3323742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
3333742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param type
3343742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            fully qualified service type name, such as <code>_http._tcp.local.</code>.
3353742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param name
3363742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            unqualified service instance name, such as <code>foobar</code>
3373742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param port
3383742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            the local port on which the service runs
3393742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param weight
3403742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            weight of the service
3413742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param priority
3423742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            priority of the service
3433742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param persistent
3443742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            if <code>true</code> ServiceListener.resolveService will be called whenever new new information is received.
3453742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param text
3463742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            bytes describing the service
3473742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return new service info
3483742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
3493742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public static ServiceInfo create(final String type, final String name, final int port, final int weight, final int priority, final boolean persistent, final byte[] text) {
3503742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman        return new ServiceInfoImpl(type, name, "", port, weight, priority, persistent, text);
3513742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    }
3523742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
3533742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
3543742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Construct a service description for registering with JmDNS.
3553742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
3563742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param type
3573742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            fully qualified service type name, such as <code>_http._tcp.local.</code>.
3583742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param name
3593742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            unqualified service instance name, such as <code>foobar</code>
3603742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param subtype
3613742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            service subtype see draft-cheshire-dnsext-dns-sd-06.txt chapter 7.1 Selective Instance Enumeration
3623742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param port
3633742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            the local port on which the service runs
3643742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param weight
3653742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            weight of the service
3663742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param priority
3673742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            priority of the service
3683742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param persistent
3693742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            if <code>true</code> ServiceListener.resolveService will be called whenever new new information is received.
3703742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param text
3713742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            bytes describing the service
3723742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return new service info
3733742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
3743742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public static ServiceInfo create(final String type, final String name, final String subtype, final int port, final int weight, final int priority, final boolean persistent, final byte[] text) {
3753742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman        return new ServiceInfoImpl(type, name, subtype, port, weight, priority, persistent, text);
3763742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    }
3773742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
3783742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
3793742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Construct a service description for registering with JmDNS. The properties hashtable must map property names to either Strings or byte arrays describing the property values.
3803742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
3813742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param qualifiedNameMap
3823742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            dictionary of values to build the fully qualified service name. Mandatory keys are Application and Instance. The Domain default is local, the Protocol default is tcp and the subtype default is none.
3833742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param port
3843742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            the local port on which the service runs
3853742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param weight
3863742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            weight of the service
3873742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param priority
3883742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            priority of the service
3893742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param persistent
3903742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            if <code>true</code> ServiceListener.resolveService will be called whenever new new information is received.
3913742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param props
3923742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            properties describing the service
3933742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return new service info
3943742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
3953742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public static ServiceInfo create(final Map<Fields, String> qualifiedNameMap, final int port, final int weight, final int priority, final boolean persistent, final Map<String, ?> props) {
3963742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman        return new ServiceInfoImpl(qualifiedNameMap, port, weight, priority, persistent, props);
3973742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    }
3983742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
3993742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
4003742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Returns true if the service info is filled with data.
4013742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
4023742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return <code>true</code> if the service info has data, <code>false</code> otherwise.
4033742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
4043742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public abstract boolean hasData();
4053742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
4063742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
4073742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Fully qualified service type name, such as <code>_http._tcp.local.</code>
4083742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
4093742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return service type name
4103742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
4113742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public abstract String getType();
4123742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
4133742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
4143742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Fully qualified service type name with the subtype if appropriate, such as <code>_printer._sub._http._tcp.local.</code>
4153742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
4163742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return service type name
4173742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
4183742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public abstract String getTypeWithSubtype();
4193742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
4203742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
4213742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Unqualified service instance name, such as <code>foobar</code> .
4223742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
4233742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return service name
4243742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
4253742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public abstract String getName();
4263742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
4273742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
4283742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * The key is used to retrieve service info in hash tables.<br/>
4293742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * The key is the lower case qualified name.
4303742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
4313742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return the key
4323742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
4333742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public abstract String getKey();
4343742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
4353742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
4363742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Fully qualified service name, such as <code>foobar._http._tcp.local.</code> .
4373742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
4383742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return qualified service name
4393742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
4403742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public abstract String getQualifiedName();
4413742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
4423742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
4433742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Get the name of the server.
4443742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
4453742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return server name
4463742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
4473742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public abstract String getServer();
4483742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
4493742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
4503742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Returns the host IP address string in textual presentation.<br/>
4513742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * <b>Note:</b> This can be either an IPv4 or an IPv6 representation.
4523742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
4533742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return the host raw IP address in a string format.
4543742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @deprecated since 3.2.3
4553742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @see #getHostAddresses()
4563742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
4573742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    @Deprecated
4583742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public abstract String getHostAddress();
4593742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
4603742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
4613742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Returns the host IP addresses string in textual presentation.
4623742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
4633742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return list of host raw IP address in a string format.
4643742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
4653742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public abstract String[] getHostAddresses();
4663742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
4673742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
4683742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Get the host address of the service.<br/>
4693742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
4703742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return host Internet address
4713742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @deprecated since 3.1.8
4723742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @see #getInetAddresses()
4733742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
4743742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    @Deprecated
4753742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public abstract InetAddress getAddress();
4763742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
4773742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
4783742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Get the InetAddress of the service. This will return the IPv4 if it exist, otherwise it return the IPv6 if set.<br/>
4793742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * <b>Note:</b> This return null if the service IP address cannot be resolved.
4803742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
4813742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return Internet address
4823742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @deprecated since 3.2.3
4833742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @see #getInetAddresses()
4843742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
4853742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    @Deprecated
4863742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public abstract InetAddress getInetAddress();
4873742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
4883742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
4893742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Get the IPv4 InetAddress of the service.<br/>
4903742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * <b>Note:</b> This return null if the service IPv4 address cannot be resolved.
4913742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
4923742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return Internet address
4933742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @deprecated since 3.2.3
4943742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @see #getInet4Addresses()
4953742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
4963742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    @Deprecated
4973742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public abstract Inet4Address getInet4Address();
4983742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
4993742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
5003742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Get the IPv6 InetAddress of the service.<br/>
5013742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * <b>Note:</b> This return null if the service IPv6 address cannot be resolved.
5023742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
5033742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return Internet address
5043742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @deprecated since 3.2.3
5053742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @see #getInet6Addresses()
5063742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
5073742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    @Deprecated
5083742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public abstract Inet6Address getInet6Address();
5093742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
5103742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
5113742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Returns a list of all InetAddresses that can be used for this service.
5123742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * <p>
5133742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * In a multi-homed environment service info can be associated with more than one address.
5143742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * </p>
5153742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
5163742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return list of InetAddress objects
5173742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
5183742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public abstract InetAddress[] getInetAddresses();
5193742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
5203742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
5213742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Returns a list of all IPv4 InetAddresses that can be used for this service.
5223742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * <p>
5233742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * In a multi-homed environment service info can be associated with more than one address.
5243742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * </p>
5253742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
5263742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return list of InetAddress objects
5273742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
5283742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public abstract Inet4Address[] getInet4Addresses();
5293742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
5303742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
5313742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Returns a list of all IPv6 InetAddresses that can be used for this service.
5323742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * <p>
5333742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * In a multi-homed environment service info can be associated with more than one address.
5343742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * </p>
5353742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
5363742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return list of InetAddress objects
5373742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
5383742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public abstract Inet6Address[] getInet6Addresses();
5393742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
5403742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
5413742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Get the port for the service.
5423742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
5433742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return service port
5443742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
5453742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public abstract int getPort();
5463742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
5473742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
5483742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Get the priority of the service.
5493742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
5503742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return service priority
5513742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
5523742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public abstract int getPriority();
5533742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
5543742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
5553742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Get the weight of the service.
5563742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
5573742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return service weight
5583742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
5593742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public abstract int getWeight();
5603742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
5613742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
5623742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Get the text for the service as raw bytes.
5633742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
5643742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return raw service text
5653742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
5663742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public abstract byte[] getTextBytes();
5673742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
5683742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
5693742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Get the text for the service. This will interpret the text bytes as a UTF8 encoded string. Will return null if the bytes are not a valid UTF8 encoded string.<br/>
5703742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * <b>Note:</b> Do not use. This method make the assumption that the TXT record is one string. This is false. The TXT record is a series of key value pairs.
5713742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
5723742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return service text
5733742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @see #getPropertyNames()
5743742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @see #getPropertyBytes(String)
5753742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @see #getPropertyString(String)
5763742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @deprecated since 3.1.7
5773742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
5783742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    @Deprecated
5793742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public abstract String getTextString();
5803742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
5813742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
5823742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Get the URL for this service. An http URL is created by combining the address, port, and path properties.
5833742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
5843742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return service URL
5853742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @deprecated since 3.2.3
5863742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @see #getURLs()
5873742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
5883742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    @Deprecated
5893742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public abstract String getURL();
5903742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
5913742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
5923742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Get the list of URL for this service. An http URL is created by combining the address, port, and path properties.
5933742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
5943742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return list of service URL
5953742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
5963742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public abstract String[] getURLs();
5973742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
5983742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
5993742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Get the URL for this service. An URL is created by combining the protocol, address, port, and path properties.
6003742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
6013742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param protocol
6023742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            requested protocol
6033742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return service URL
6043742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @deprecated since 3.2.3
6053742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @see #getURLs()
6063742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
6073742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    @Deprecated
6083742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public abstract String getURL(String protocol);
6093742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
6103742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
6113742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Get the list of URL for this service. An URL is created by combining the protocol, address, port, and path properties.
6123742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
6133742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param protocol
6143742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            requested protocol
6153742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return list of service URL
6163742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
6173742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public abstract String[] getURLs(String protocol);
6183742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
6193742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
6203742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Get a property of the service. This involves decoding the text bytes into a property list. Returns null if the property is not found or the text data could not be decoded correctly.
6213742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
6223742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param name
6233742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            property name
6243742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return raw property text
6253742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
6263742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public abstract byte[] getPropertyBytes(final String name);
6273742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
6283742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
6293742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Get a property of the service. This involves decoding the text bytes into a property list. Returns null if the property is not found, the text data could not be decoded correctly, or the resulting bytes are not a valid UTF8 string.
6303742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
6313742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param name
6323742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            property name
6333742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return property text
6343742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
6353742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public abstract String getPropertyString(final String name);
6363742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
6373742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
6383742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Enumeration of the property names.
6393742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
6403742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return property name enumeration
6413742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
6423742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public abstract Enumeration<String> getPropertyNames();
6433742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
6443742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
6453742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Returns a description of the service info suitable for printing.
6463742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
6473742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return service info description
6483742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
6493742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public abstract String getNiceTextString();
6503742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
6513742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
6523742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Set the text for the service. Setting the text will fore a re-announce of the service.
6533742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
6543742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param text
6553742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            the raw byte representation of the text field.
6563742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @exception IllegalStateException
6573742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *                if attempting to set the text for a non persistent service info.
6583742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
6593742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public abstract void setText(final byte[] text) throws IllegalStateException;
6603742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
6613742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
6623742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Set the text for the service. Setting the text will fore a re-announce of the service.
6633742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
6643742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @param props
6653742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *            a key=value map that will be encoded into raw bytes.
6663742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @exception IllegalStateException
6673742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *                if attempting to set the text for a non persistent service info.
6683742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
6693742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public abstract void setText(final Map<String, ?> props) throws IllegalStateException;
6703742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
6713742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
6723742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Returns <code>true</code> if ServiceListener.resolveService will be called whenever new new information is received.
6733742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
6743742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return the persistent
6753742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
6763742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public abstract boolean isPersistent();
6773742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
6783742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
6793742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Returns the domain of the service info suitable for printing.
6803742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
6813742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return service domain
6823742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
6833742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public abstract String getDomain();
6843742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
6853742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
6863742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Returns the protocol of the service info suitable for printing.
6873742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
6883742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return service protocol
6893742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
6903742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public abstract String getProtocol();
6913742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
6923742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
6933742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Returns the application of the service info suitable for printing.
6943742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
6953742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return service application
6963742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
6973742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public abstract String getApplication();
6983742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
6993742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
7003742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Returns the sub type of the service info suitable for printing.
7013742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
7023742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return service sub type
7033742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
7043742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public abstract String getSubtype();
7053742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
7063742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /**
7073742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * Returns a dictionary of the fully qualified name component of this service.
7083742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     *
7093742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @return dictionary of the fully qualified name components
7103742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
7113742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public abstract Map<Fields, String> getQualifiedNameMap();
7123742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
7133742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    /*
7143742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * (non-Javadoc)
7153742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     * @see java.lang.Object#clone()
7163742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman     */
7173742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    @Override
7183742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    public ServiceInfo clone() {
7193742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman        try {
7203742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman            return (ServiceInfo) super.clone();
7213742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman        } catch (CloneNotSupportedException exception) {
7223742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman            // clone is supported
7233742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman            return null;
7243742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman        }
7253742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman    }
7263742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman
7273742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman}
728