gov.sns.tools.services
Class ServiceRef

java.lang.Object
  |
  +--gov.sns.tools.services.ServiceRef

public class ServiceRef
extends java.lang.Object

ServiceRef wraps the native Rendezvous ServiceInfo and provides a reference to the service that hides a direct reference to Rendezvous.


Method Summary
 boolean equals(java.lang.Object other)
          Override equals to compare the wrapped service info instances.
protected static java.lang.String getBaseName(java.lang.String fullName, java.lang.String fullType)
          Internally used to strip the type information from the name to get just the base name.
protected static java.lang.String getBaseType(java.lang.String fullType)
          Internally used to strip the communication protocol and DNS address from the full type name.
 java.lang.String getFullType()
          Get the fully qualified type
protected static java.lang.String getFullType(java.lang.String baseType)
          Internally used to construct the full rendezvous type from the simple base type.
 java.lang.String getRawName()
          Get the unique raw name of the service provider.
 java.lang.String getServiceName()
          Get the name of the service.
 java.lang.String getType()
          Get the type of service provided.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getServiceName

public java.lang.String getServiceName()
Get the name of the service.

Returns:
The name of the service provided.

getRawName

public java.lang.String getRawName()
Get the unique raw name of the service provider.

Returns:
The raw name of the service provider.

getType

public java.lang.String getType()
Get the type of service provided.

Returns:
The type of service provided.

getFullType

public java.lang.String getFullType()
Get the fully qualified type

Returns:
the fully qualified type

equals

public boolean equals(java.lang.Object other)
Override equals to compare the wrapped service info instances.

Overrides:
equals in class java.lang.Object
Parameters:
other - The other service reference against which to compare this one.
Returns:
true if the other service reference refers to the same service provider as the this instance and false otherwise.

getBaseType

protected static java.lang.String getBaseType(java.lang.String fullType)
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

protected static java.lang.String getBaseName(java.lang.String fullName,
                                              java.lang.String fullType)
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

protected static java.lang.String getFullType(java.lang.String baseType)
Internally used to construct the full rendezvous 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.")