thredds.catalog
Class InvService

java.lang.Object
  extended by thredds.catalog.InvService

public class InvService
extends java.lang.Object

A Service is an abstraction for an internet service, such as a data server, FTP, etc.

Author:
john caron

Constructor Summary
InvService(java.lang.String name, java.lang.String serviceTypeName, java.lang.String base, java.lang.String suffix, java.lang.String desc)
          Constructor, use when serviceTypeName alreaddy converted to ServiceType.
 
Method Summary
 void addDatasetRoot(InvProperty root)
          Deprecated. use InvCatalogImpl
 void addProperty(InvProperty p)
          Add a property
 void addService(InvService service)
          Add a nested service to a service of type COMPOUND.
 java.lang.String dump()
           
 boolean equals(java.lang.Object o)
          InvServices with same values are equal
 java.lang.String findProperty(java.lang.String name)
          Get named property.
 java.lang.String getBase()
          get the base URL for the service
 java.util.List<InvProperty> getDatasetRoots()
          Get dataset roots.
 java.lang.String getDescription()
          Get the "human readable" description; use ServiceType.toString() if not set
 java.lang.String getFullName()
          Deprecated. services should always be at top level.
 java.lang.String getName()
          Get the service name: referenced by dataset and access elements.
 java.util.List<InvProperty> getProperties()
          Get properties for this service.
 java.util.List<InvService> getServices()
          Get nested services; only if getServiceType() == ServiceType.COMPOUND.
 ServiceType getServiceType()
          get the Service Type
 java.lang.String getSuffix()
          Get the suffix; may be null
 int hashCode()
          Override Object.hashCode() to implement equals.
 boolean isRelativeBase()
          See if the service Base is reletive
 java.lang.String toString()
          string representation
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InvService

public InvService(java.lang.String name,
                  java.lang.String serviceTypeName,
                  java.lang.String base,
                  java.lang.String suffix,
                  java.lang.String desc)
Constructor, use when serviceTypeName alreaddy converted to ServiceType.

Parameters:
name - : name to show to the user
serviceTypeName - : ServiceType
base - : base for forming URL
suffix - : suffix for forming URL, may be null.
desc - : human readable description, may be null.
Method Detail

getName

public java.lang.String getName()
Get the service name: referenced by dataset and access elements.

Returns:
the service name

getBase

public java.lang.String getBase()
get the base URL for the service

Returns:
the base URL for the service

getServiceType

public ServiceType getServiceType()
get the Service Type

Returns:
the Service Type

getSuffix

public java.lang.String getSuffix()
Get the suffix; may be null

Returns:
the suffix; may be null

getDescription

public java.lang.String getDescription()
Get the "human readable" description; use ServiceType.toString() if not set

Returns:
the "human readable" description

getProperties

public java.util.List<InvProperty> getProperties()
Get properties for this service.

Returns:
List of type Property. May be empty, but not null.

getDatasetRoots

public java.util.List<InvProperty> getDatasetRoots()
Get dataset roots.

Returns:
List of InvProperty. May be empty, may not be null.

findProperty

public java.lang.String findProperty(java.lang.String name)
Get named property.

Parameters:
name - match this name
Returns:
String value of Property or null if not exist.

toString

public java.lang.String toString()
string representation

Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
InvServices with same values are equal

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Override Object.hashCode() to implement equals.

Overrides:
hashCode in class java.lang.Object

dump

public java.lang.String dump()
Returns:
debugging info

addService

public void addService(InvService service)
Add a nested service to a service of type COMPOUND.

Parameters:
service - add this

addProperty

public void addProperty(InvProperty p)
Add a property

Parameters:
p - add this

addDatasetRoot

public void addDatasetRoot(InvProperty root)
Deprecated. use InvCatalogImpl

Add Dataset Root (1.0), key = path, value = location.

Parameters:
root - add this

getServices

public java.util.List<InvService> getServices()
Get nested services; only if getServiceType() == ServiceType.COMPOUND.

Returns:
List of type InvService. May be empty, but not null.

getFullName

public java.lang.String getFullName()
Deprecated. services should always be at top level.

Get full name for this Service, which has all parent collection names.

Returns:
name

isRelativeBase

public boolean isRelativeBase()
See if the service Base is reletive

Returns:
true if the service Base is reletive