ch.ethz.iks.slp
Class ServiceType

java.lang.Object
  extended by ch.ethz.iks.slp.ServiceType
All Implemented Interfaces:
java.io.Serializable

public final class ServiceType
extends java.lang.Object
implements java.io.Serializable

Implementation of the SLP ServiceType class defined in RFC 2614.

Since:
0.1
Author:
Jan S. Rellermeyer, Systems Group, ETH Zurich, Patrick Callis, Solers Corp.
See Also:
Serialized Form

Constructor Summary
ServiceType(java.lang.String serviceType)
          creates a new ServiceType instance.
 
Method Summary
 boolean equals(java.lang.Object obj)
          check if two ServiceTypes are equal.
 java.lang.String getAbstractTypeName()
          get the name of the abstract type of this ServiceType instance.
 java.lang.String getConcreteTypeName()
          get the concrete type part of this ServiceType instance.
 java.lang.String getNamingAuthority()
          get the naming authority.
 java.lang.String getPrincipleTypeName()
          get the principle type part of this ServiceType instance.
 int hashCode()
          get the hashCode of this ServiceType instance.
 boolean isAbstractType()
          is the ServiceType instance an abstract type ?
 boolean isNADefault()
          is the naming authority default (IANA) ?
 boolean isServiceURL()
          is the ServiceType instance a ServiceURL ?
 boolean matches(java.lang.Object obj)
          check if a ServiceType matches a ServiceURL or another ServiceType.
 java.lang.String toString()
          get a String representation of this ServiceType instance.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ServiceType

public ServiceType(java.lang.String serviceType)
creates a new ServiceType instance.

Parameters:
serviceType - the string representation of a ServiceType, e.g.
      service:osgi:remote
 
Method Detail

isServiceURL

public boolean isServiceURL()
is the ServiceType instance a ServiceURL ?

Returns:
true if this is the case.

isAbstractType

public boolean isAbstractType()
is the ServiceType instance an abstract type ?

Returns:
true if thie is the case.

isNADefault

public boolean isNADefault()
is the naming authority default (IANA) ?

Returns:
true if this is the case.

getConcreteTypeName

public java.lang.String getConcreteTypeName()
get the concrete type part of this ServiceType instance.

Returns:
a String representing the concrete type.

getPrincipleTypeName

public java.lang.String getPrincipleTypeName()
get the principle type part of this ServiceType instance.

Returns:
a String representing the principle part.

getAbstractTypeName

public java.lang.String getAbstractTypeName()
get the name of the abstract type of this ServiceType instance.

Returns:
a String representing the abstract type.

getNamingAuthority

public java.lang.String getNamingAuthority()
get the naming authority.

Returns:
the naming authority.

equals

public boolean equals(java.lang.Object obj)
check if two ServiceTypes are equal.

Overrides:
equals in class java.lang.Object
Parameters:
obj - another ServiceType.
Returns:
true if they equal.

matches

public boolean matches(java.lang.Object obj)
check if a ServiceType matches a ServiceURL or another ServiceType.

Parameters:
obj - the object to be compared to.
Returns:
true if this type matches the other object.

toString

public java.lang.String toString()
get a String representation of this ServiceType instance.

Overrides:
toString in class java.lang.Object
Returns:
the String representation.

hashCode

public int hashCode()
get the hashCode of this ServiceType instance.

Overrides:
hashCode in class java.lang.Object
Returns:
the int value of the hashCode.


Copyright © 2008 Systems Group, ETH Zurich. All Rights Reserved.