Class JmmDNSImpl

    • Constructor Detail

      • JmmDNSImpl

        public JmmDNSImpl()
    • Method Detail

      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException
      • getNames

        public java.lang.String[] getNames()
        Description copied from interface: JmmDNS
        Return the names of the JmDNS instances.
        Specified by:
        getNames in interface JmmDNS
        Returns:
        list of name of the JmDNS
        See Also:
        JmDNS.getName()
      • getHostNames

        public java.lang.String[] getHostNames()
        Description copied from interface: JmmDNS
        Return the list HostName associated with this JmmDNS instance.
        Specified by:
        getHostNames in interface JmmDNS
        Returns:
        list of host names
        See Also:
        JmDNS.getHostName()
      • getInetAddresses

        public java.net.InetAddress[] getInetAddresses()
                                                throws java.io.IOException
        Description copied from interface: JmmDNS
        Return the list of addresses of the interface to which this instance of JmmDNS is bound.
        Specified by:
        getInetAddresses in interface JmmDNS
        Returns:
        list of Internet Address
        Throws:
        java.io.IOException
        See Also:
        JmDNS.getInetAddress()
      • getDNS

        public JmDNS[] getDNS()
        Description copied from interface: JmmDNS
        Return a list of all the registered JmDNS instances
        Specified by:
        getDNS in interface JmmDNS
        Returns:
        list of JmDNS instances
      • getInterfaces

        @Deprecated
        public java.net.InetAddress[] getInterfaces()
                                             throws java.io.IOException
        Deprecated.
        Description copied from interface: JmmDNS
        Return the list of addresses of the interface to which this instance of JmmDNS is bound.
        Specified by:
        getInterfaces in interface JmmDNS
        Returns:
        list of Internet Address
        Throws:
        java.io.IOException
        See Also:
        JmDNS.getInterface()
      • getServiceInfos

        public ServiceInfo[] getServiceInfos​(java.lang.String type,
                                             java.lang.String name)
        Description copied from interface: JmmDNS
        Get service information. If the information is not cached, the method will block until updated information is received on all DNS.

        Usage note: Do not call this method from the AWT event dispatcher thread. You will make the user interface unresponsive.

        Specified by:
        getServiceInfos in interface JmmDNS
        Parameters:
        type - fully qualified service type, such as _http._tcp.local. .
        name - unqualified service name, such as foobar .
        Returns:
        list of service info. If no service info is found the list is empty.
        See Also:
        JmDNS.getServiceInfo(java.lang.String, java.lang.String)
      • getServiceInfos

        public ServiceInfo[] getServiceInfos​(java.lang.String type,
                                             java.lang.String name,
                                             long timeout)
        Description copied from interface: JmmDNS
        Get service information. If the information is not cached, the method will block until updated information is received on all DNS.

        Usage note: If you call this method from the AWT event dispatcher thread, use a small timeout, or you will make the user interface unresponsive.

        Specified by:
        getServiceInfos in interface JmmDNS
        Parameters:
        type - full qualified service type, such as _http._tcp.local. .
        name - unqualified service name, such as foobar .
        timeout - timeout in milliseconds. Typical timeout should be 5s.
        Returns:
        list of service info. If no service info is found the list is empty.
        See Also:
        JmDNS.getServiceInfo(java.lang.String, java.lang.String, long)
      • getServiceInfos

        public ServiceInfo[] getServiceInfos​(java.lang.String type,
                                             java.lang.String name,
                                             boolean persistent)
        Description copied from interface: JmmDNS
        Get service information. If the information is not cached, the method will block until updated information is received on all DNS.

        Usage note: If you call this method from the AWT event dispatcher thread, use a small timeout, or you will make the user interface unresponsive.

        Specified by:
        getServiceInfos in interface JmmDNS
        Parameters:
        type - full qualified service type, such as _http._tcp.local. .
        name - unqualified service name, such as foobar .
        persistent - if true ServiceListener.resolveService will be called whenever new new information is received.
        Returns:
        list of service info. If no service info is found the list is empty.
        See Also:
        JmDNS.getServiceInfo(java.lang.String, java.lang.String, boolean)
      • getServiceInfos

        public ServiceInfo[] getServiceInfos​(java.lang.String type,
                                             java.lang.String name,
                                             boolean persistent,
                                             long timeout)
        Description copied from interface: JmmDNS
        Get service information. If the information is not cached, the method will block until updated information is received on all DNS.

        Usage note: If you call this method from the AWT event dispatcher thread, use a small timeout, or you will make the user interface unresponsive.

        Specified by:
        getServiceInfos in interface JmmDNS
        Parameters:
        type - full qualified service type, such as _http._tcp.local. .
        name - unqualified service name, such as foobar .
        persistent - if true ServiceListener.resolveService will be called whenever new new information is received.
        timeout - timeout in milliseconds. Typical timeout should be 5s.
        Returns:
        list of service info. If no service info is found the list is empty.
        See Also:
        JmDNS.getServiceInfo(java.lang.String, java.lang.String, boolean, long)
      • requestServiceInfo

        public void requestServiceInfo​(java.lang.String type,
                                       java.lang.String name)
        Description copied from interface: JmmDNS
        Request service information. The information about the service is requested and the ServiceListener.resolveService method is called as soon as it is available.
        Specified by:
        requestServiceInfo in interface JmmDNS
        Parameters:
        type - full qualified service type, such as _http._tcp.local. .
        name - unqualified service name, such as foobar .
        See Also:
        JmDNS.requestServiceInfo(java.lang.String, java.lang.String)
      • requestServiceInfo

        public void requestServiceInfo​(java.lang.String type,
                                       java.lang.String name,
                                       boolean persistent)
        Description copied from interface: JmmDNS
        Request service information. The information about the service is requested and the ServiceListener.resolveService method is called as soon as it is available.
        Specified by:
        requestServiceInfo in interface JmmDNS
        Parameters:
        type - full qualified service type, such as _http._tcp.local. .
        name - unqualified service name, such as foobar .
        persistent - if true ServiceListener.resolveService will be called whenever new new information is received.
        See Also:
        JmDNS.requestServiceInfo(java.lang.String, java.lang.String, boolean)
      • requestServiceInfo

        public void requestServiceInfo​(java.lang.String type,
                                       java.lang.String name,
                                       long timeout)
        Description copied from interface: JmmDNS
        Request service information. The information about the service is requested and the ServiceListener.resolveService method is called as soon as it is available.
        Specified by:
        requestServiceInfo in interface JmmDNS
        Parameters:
        type - full qualified service type, such as _http._tcp.local. .
        name - unqualified service name, such as foobar .
        timeout - timeout in milliseconds
        See Also:
        JmDNS.requestServiceInfo(java.lang.String, java.lang.String, long)
      • requestServiceInfo

        public void requestServiceInfo​(java.lang.String type,
                                       java.lang.String name,
                                       boolean persistent,
                                       long timeout)
        Description copied from interface: JmmDNS
        Request service information. The information about the service is requested and the ServiceListener.resolveService method is called as soon as it is available.
        Specified by:
        requestServiceInfo in interface JmmDNS
        Parameters:
        type - full qualified service type, such as _http._tcp.local. .
        name - unqualified service name, such as foobar .
        persistent - if true ServiceListener.resolveService will be called whenever new new information is received.
        timeout - timeout in milliseconds
        See Also:
        JmDNS.requestServiceInfo(java.lang.String, java.lang.String, boolean, long)
      • registerService

        public void registerService​(ServiceInfo info)
                             throws java.io.IOException
        Description copied from interface: JmmDNS
        Register a service. The service is registered for access by other jmdns clients. The name of the service may be changed to make it unique.
        Note the Service info is cloned for each network interface.
        Specified by:
        registerService in interface JmmDNS
        Parameters:
        info - service info to register
        Throws:
        java.io.IOException
        See Also:
        JmDNS.registerService(javax.jmdns.ServiceInfo)
      • registerServiceType

        public void registerServiceType​(java.lang.String type)
        Description copied from interface: JmmDNS
        Register a service type. If this service type was not already known, all service listeners will be notified of the new service type. Service types are automatically registered as they are discovered.
        Specified by:
        registerServiceType in interface JmmDNS
        Parameters:
        type - full qualified service type, such as _http._tcp.local..
        See Also:
        JmDNS.registerServiceType(java.lang.String)
      • list

        public ServiceInfo[] list​(java.lang.String type)
        Description copied from interface: JmmDNS
        Returns a list of service infos of the specified type.
        Specified by:
        list in interface JmmDNS
        Parameters:
        type - Service type name, such as _http._tcp.local..
        Returns:
        An array of service instance.
        See Also:
        JmDNS.list(java.lang.String)
      • list

        public ServiceInfo[] list​(java.lang.String type,
                                  long timeout)
        Description copied from interface: JmmDNS
        Returns a list of service infos of the specified type.
        Specified by:
        list in interface JmmDNS
        Parameters:
        type - Service type name, such as _http._tcp.local..
        timeout - timeout in milliseconds. Typical timeout should be 6s.
        Returns:
        An array of service instance.
        See Also:
        JmDNS.list(java.lang.String, long)
      • listBySubtype

        public java.util.Map<java.lang.String,​ServiceInfo[]> listBySubtype​(java.lang.String type)
        Description copied from interface: JmmDNS
        Returns a list of service infos of the specified type sorted by subtype. Any service that do not register a subtype is listed in the empty subtype section.
        Specified by:
        listBySubtype in interface JmmDNS
        Parameters:
        type - Service type name, such as _http._tcp.local..
        Returns:
        A dictionary of service info by subtypes.
        See Also:
        JmDNS.listBySubtype(java.lang.String)
      • listBySubtype

        public java.util.Map<java.lang.String,​ServiceInfo[]> listBySubtype​(java.lang.String type,
                                                                                 long timeout)
        Description copied from interface: JmmDNS
        Returns a list of service infos of the specified type sorted by subtype. Any service that do not register a subtype is listed in the empty subtype section.
        Specified by:
        listBySubtype in interface JmmDNS
        Parameters:
        type - Service type name, such as _http._tcp.local..
        timeout - timeout in milliseconds. Typical timeout should be 6s.
        Returns:
        A dictionary of service info by subtypes.
        See Also:
        JmDNS.listBySubtype(java.lang.String, long)