Package xal.extension.service
Class ServiceRef
java.lang.Object
xal.extension.service.ServiceRef
ServiceRef wraps the native Rendezvous ServiceInfo and provides a reference
to the service that hides a direct reference to Rendezvous.
- Author:
- tap
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Override equals to compare the wrapped service info instances.protected static String
getBaseName
(String fullName, String fullType) Internally used to strip the type information from the name to get just the base name.protected static String
getBaseType
(String fullType) Internally used to strip the communication protocol and DNS address from the full type name.Get the fully qualified typeprotected static String
getFullType
(String baseType) Internally used to construct the full bonjour type from the simple base type.Get the address of the remote service.int
getPort()
Get the port for connecting to the remote service.Get the unique raw name of the service provider.Get the name of the service.getType()
Get the type of service provided.int
hashCode()
override hashCode as required for consistency with equals
-
Method Details
-
getServiceName
Get the name of the service.- Returns:
- The name of the service provided.
-
getRawName
Get the unique raw name of the service provider.- Returns:
- The raw name of the service provider.
-
getType
Get the type of service provided.- Returns:
- The type of service provided.
-
getFullType
Get the fully qualified type- Returns:
- the fully qualified type
-
getHostAddress
Get the address of the remote service.- Returns:
- the address of the remote service
-
getPort
public int getPort()Get the port for connecting to the remote service.- Returns:
- the port for connecting to the remote service
-
equals
Override equals to compare the wrapped service info instances. -
hashCode
public int hashCode()override hashCode as required for consistency with equals -
getBaseType
Internally used to strip the communication protocol and DNS address from the full type name.- Parameters:
fullType
- The full rendezvous type (e.g. "greeting._tcp._local.")- Returns:
- Just the simple base type (e.g. "greeting")
-
getBaseName
Internally used to strip the type information from the name to get just the base name.- Parameters:
fullName
- The full rendezvous name (e.g. "Mary.greeting._tcp._local.")fullType
- The full rendezvous type (e.g. "greeting._tcp._local.")- Returns:
- The simple base name (e.g. "Mary")
-
getFullType
Internally used to construct the full bonjour type from the simple base type.- Parameters:
baseType
- The simple base type (e.g. "greeting")- Returns:
- The full rendezvous type (e.g. "greeting._tcp.local.")
-