Package jmri.util.zeroconf
Class ZeroConfClient
- java.lang.Object
-
- jmri.util.zeroconf.ZeroConfClient
-
public class ZeroConfClient extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ZeroConfClient.NetworkServiceListener
-
Constructor Summary
Constructors Constructor Description ZeroConfClient()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String[]
getHostList(java.lang.String service)
javax.jmdns.ServiceInfo
getService(java.lang.String service)
Request the first service of a particular service.javax.jmdns.ServiceInfo
getServicebyAdName(java.lang.String service, java.lang.String adName)
Request the first service of a particular service with a particular service name.javax.jmdns.ServiceInfo
getServiceOnHost(java.lang.String service, java.lang.String hostname)
Request the first service of a particular service on a specified host.java.util.List<javax.jmdns.ServiceInfo>
getServices(java.lang.String service)
Get all servers providing the specified service.void
startServiceListener(java.lang.String service)
void
stopServiceListener(java.lang.String service)
-
-
-
Constructor Detail
-
ZeroConfClient
public ZeroConfClient()
-
-
Method Detail
-
startServiceListener
public void startServiceListener(@Nonnull java.lang.String service)
-
stopServiceListener
public void stopServiceListener(@Nonnull java.lang.String service)
-
getService
public javax.jmdns.ServiceInfo getService(@Nonnull java.lang.String service)
Request the first service of a particular service.- Parameters:
service
- string service getName- Returns:
- JmDNS service entry for the first service of a particular service.
-
getServices
@Nonnull public java.util.List<javax.jmdns.ServiceInfo> getServices(@Nonnull java.lang.String service)
Get all servers providing the specified service.- Parameters:
service
- the name of service as generated usingZeroConfServiceManager.key(java.lang.String, java.lang.String)
- Returns:
- A list of servers or an empty list.
-
getServiceOnHost
public javax.jmdns.ServiceInfo getServiceOnHost(@Nonnull java.lang.String service, @Nonnull java.lang.String hostname)
Request the first service of a particular service on a specified host.- Parameters:
service
- string service servicehostname
- string host name- Returns:
- JmDNS service entry for the first service of a particular service on the specified host..
-
getServicebyAdName
public javax.jmdns.ServiceInfo getServicebyAdName(@Nonnull java.lang.String service, @Nonnull java.lang.String adName)
Request the first service of a particular service with a particular service name.- Parameters:
service
- string service serviceadName
- string qualified service advertisement name- Returns:
- JmDNS service entry for the first service of a particular service on the specified host..
-
getHostList
@Nonnull public java.lang.String[] getHostList(@Nonnull java.lang.String service)
-
-