thredds.catalog2.builder
Interface ServiceBuilder

All Superinterfaces:
ThreddsBuilder

public interface ServiceBuilder
extends ThreddsBuilder

Provide an interface for constructing Service objects.

Since:
4.0
Author:
edavis

Method Summary
 void addProperty(String name, String value)
          Add a Property object with the given name and value to this Service or replace an existing Property of the same name.
 ServiceBuilder addService(String name, ServiceType type, URI baseUri)
          Add a new Service object with the given name, type, and base uri to this Service returning a ServiceBuilder object to allow full construction and modification of the new Service.
 Service build()
          Return the finished Service.
 ServiceBuilder findServiceBuilderByNameGlobally(String name)
           
 URI getBaseUri()
           
 String getDescription()
           
 String getName()
           
 List<String> getPropertyNames()
           
 String getPropertyValue(String name)
           
 ServiceBuilder getServiceBuilderByName(String name)
           
 List<ServiceBuilder> getServiceBuilders()
           
 String getSuffix()
           
 ServiceType getType()
           
 boolean removeProperty(String name)
           
 boolean removeService(ServiceBuilder serviceBuilder)
           
 void setBaseUri(URI baseUri)
           
 void setDescription(String description)
           
 void setSuffix(String suffix)
           
 void setType(ServiceType type)
           
 
Methods inherited from interface thredds.catalog2.builder.ThreddsBuilder
getIssues, isBuilt
 

Method Detail

getName

String getName()

getDescription

String getDescription()

setDescription

void setDescription(String description)

getType

ServiceType getType()

setType

void setType(ServiceType type)

getBaseUri

URI getBaseUri()

setBaseUri

void setBaseUri(URI baseUri)

getSuffix

String getSuffix()

setSuffix

void setSuffix(String suffix)

addProperty

void addProperty(String name,
                 String value)
Add a Property object with the given name and value to this Service or replace an existing Property of the same name.

Parameters:
name - the name of the Property to be added.
value - the value of the property to be added.
Throws:
IllegalArgumentException - if the name or value are null.

removeProperty

boolean removeProperty(String name)

getPropertyNames

List<String> getPropertyNames()

getPropertyValue

String getPropertyValue(String name)

addService

ServiceBuilder addService(String name,
                          ServiceType type,
                          URI baseUri)
Add a new Service object with the given name, type, and base uri to this Service returning a ServiceBuilder object to allow full construction and modification of the new Service.

If this Service or an already added Service has the given name, an IllegalStateException is thrown. getServiceBuilderByName(String) can be used to check before calling this method.

Parameters:
name - the name of the new Service object.
type - the type of the new Service object.
baseUri - the base URI of the new Service object.
Returns:
a ServiceBuilder for further construction and modification of the new Service.
Throws:
IllegalArgumentException - if the name, type, or base URI are null.
IllegalStateException - this ServiceBuilder has already been finished or the top container of this ServiceBuilder already contains a ServiceBuilder with the given name.

removeService

boolean removeService(ServiceBuilder serviceBuilder)

getServiceBuilders

List<ServiceBuilder> getServiceBuilders()

getServiceBuilderByName

ServiceBuilder getServiceBuilderByName(String name)

findServiceBuilderByNameGlobally

ServiceBuilder findServiceBuilderByNameGlobally(String name)

build

Service build()
              throws BuilderException
Return the finished Service.

Specified by:
build in interface ThreddsBuilder
Returns:
the finished Service.
Throws:
BuilderException - if this ThreddsBuilder is not in a valid state.


Copyright © 1999-2011 UCAR/Unidata. All Rights Reserved.