Package org.sblim.slp
Class ServiceType
- java.lang.Object
-
- org.sblim.slp.ServiceType
-
- All Implemented Interfaces:
java.io.Serializable
public class ServiceType extends java.lang.Object implements java.io.Serializable
The ServiceType object models the SLP service type. It parses a string based service type specifier into its various components, and contains property accessors to return the components. URL schemes, protocol service types, and abstract service types are all handled.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ServiceType(java.lang.String pType)
Constructs a service type object from the service type specifier.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
java.lang.String
getAbstractTypeName()
If the type is an abstract type, returns the fully formatted abstract type name including the "service:" and naming authority but without the concrete type name or intervening colon.java.lang.String
getConcreteTypeName()
Returns the concrete type name in an abstract type, or the empty string if the service type is not abstract.java.lang.String
getNamingAuthority()
Return the naming authority name, or the empty string if the naming authority is the default.java.lang.String
getPrincipleTypeName()
Returns the abstract type name for an abstract type, the protocol name in a protocol type, or the URL scheme for a generic URL.int
hashCode()
boolean
isAbstractType()
Returns true if the type name is for an abstract type.boolean
isNADefault()
Returns true if the naming authority is the default, i.e.boolean
isServiceURL()
Returns true if the type name contains the "service:" prefix.java.lang.String
toString()
-
-
-
Constructor Detail
-
ServiceType
public ServiceType(java.lang.String pType)
Constructs a service type object from the service type specifier. Throws IllegalArgumentException if the type name is syntactically incorrect.- Parameters:
pType
- The service type name as a String. If the service type is from a service: URL, the "service:" prefix must be intact.
-
-
Method Detail
-
isServiceURL
public boolean isServiceURL()
Returns true if the type name contains the "service:" prefix.- Returns:
true
if the type name contains the "service:" prefix
-
isAbstractType
public boolean isAbstractType()
Returns true if the type name is for an abstract type.- Returns:
true
if the type name is for an abstract type
-
isNADefault
public boolean isNADefault()
Returns true if the naming authority is the default, i.e. is the empty string.- Returns:
true
if the naming authority is the default, i.e. is the empty string
-
getConcreteTypeName
public java.lang.String getConcreteTypeName()
Returns the concrete type name in an abstract type, or the empty string if the service type is not abstract. For example, if the type name is "service:printing:ipp", the method returns "ipp". If the type name is "service:ftp", the method returns "".- Returns:
true
if the service type is not abstract
-
getPrincipleTypeName
public java.lang.String getPrincipleTypeName()
Returns the abstract type name for an abstract type, the protocol name in a protocol type, or the URL scheme for a generic URL. For example, in the abstract type name "service:printing:ipp", the method returns "printing". In the protocol type name "service:ftp", the method returns "ftp".- Returns:
- The principle type name
-
getAbstractTypeName
public java.lang.String getAbstractTypeName()
If the type is an abstract type, returns the fully formatted abstract type name including the "service:" and naming authority but without the concrete type name or intervening colon. If not an abstract type, returns the empty string. For example, in the abstract type name "service:printing:ipp", the method returns "service:printing".- Returns:
- The abstract type name
-
getNamingAuthority
public java.lang.String getNamingAuthority()
Return the naming authority name, or the empty string if the naming authority is the default.- Returns:
- The naming authority
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-