org.geotools.catalog.wms
Class WMSService

java.lang.Object
  extended byorg.geotools.catalog.AbstractService
      extended byorg.geotools.catalog.wms.WMSService
All Implemented Interfaces:
Resolve, Service

public class WMSService
extends AbstractService

Connect to a WMS.

Since:
0.6

Nested Class Summary
 class WMSService.CustomWMS
           
 
Nested classes inherited from class org.geotools.catalog.Resolve
Resolve.Status
 
Field Summary
static java.lang.String WMS_URL_KEY
          WMS_URL_KEY field Magic param key for Catalog WMS persistence.
static java.lang.String WMS_WMS_KEY
           
 
Constructor Summary
WMSService(Catalog parent, java.net.URI uri, java.util.Map params)
          Construct WMSServiceImpl.
 
Method Summary
 boolean canResolve(java.lang.Class adaptee)
          Non blocking method which is used to determine if a resolve into an instance of a particular class is supported.
 java.util.Map getConnectionParams()
          Accessor to the set of params used to create this entry.
 java.net.URI getIdentifier()
          Returns a URI which uniqley identifies the Resolve.
 ServiceInfo getInfo(ProgressListener monitor)
           
 java.lang.Throwable getMessage()
          In the event that an error occurs during a resolve, that error can be reported back with this method.
 Resolve.Status getStatus()
          Status of the resolve.
protected  WebMapServer getWMS(ProgressListener theUserIsWatching)
          Aquire the actual geotools WebMapServer instance.
 java.util.List members(ProgressListener monitor)
          Return list of IGeoResources managed by this service.
 java.lang.Object resolve(java.lang.Class adaptee, ProgressListener monitor)
          Will attempt to morph into the adaptee, and return that object.
 
Methods inherited from class org.geotools.catalog.AbstractService
addListener, equals, fire, hashCode, parent, removeListener, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

WMS_URL_KEY

public static final java.lang.String WMS_URL_KEY
WMS_URL_KEY field Magic param key for Catalog WMS persistence.

See Also:
Constant Field Values

WMS_WMS_KEY

public static final java.lang.String WMS_WMS_KEY
See Also:
Constant Field Values
Constructor Detail

WMSService

public WMSService(Catalog parent,
                  java.net.URI uri,
                  java.util.Map params)
Construct WMSServiceImpl.

Parameters:
parent -
uri - DOCUMENT ME!
params -
Method Detail

getStatus

public Resolve.Status getStatus()
Description copied from interface: Resolve
Status of the resolve. Resolving into other types of objects often involves connecting to a remote service or resource. This method is provided to indicate the state of any connections.

Returns:
One of Resolve.Status.BROKEN,Resolve.Status.CONNECTED, or Resolve.Status.NOTCONNECTED.

getWMS

protected WebMapServer getWMS(ProgressListener theUserIsWatching)
                       throws java.io.IOException
Aquire the actual geotools WebMapServer instance.

Note this method is blocking and throws an IOException to indicate such.

Parameters:
theUserIsWatching -
Returns:
WebMapServer instance
Throws:
java.io.IOException

getInfo

public ServiceInfo getInfo(ProgressListener monitor)
                    throws java.io.IOException
Returns:
IServiceInfo resolve(IServiceInfo.class,ProgressListener monitor);
Throws:
java.io.IOException
See Also:
IService#resolve(Class, ProgressListener)

resolve

public java.lang.Object resolve(java.lang.Class adaptee,
                                ProgressListener monitor)
                         throws java.io.IOException
Description copied from interface: Service
Will attempt to morph into the adaptee, and return that object. Required adaptions: May Block.

Parameters:
adaptee -
monitor -
Returns:
instance of adaptee, or null if unavailable (IServiceInfo and List must be supported)
Throws:
java.io.IOException
See Also:
ServiceInfo, GeoResource, IResolve#resolve(Class, ProgressListener)

getConnectionParams

public java.util.Map getConnectionParams()
Description copied from interface: Service
Accessor to the set of params used to create this entry. There is no guarantee that these params created a usable service (@see getStatus() ). These params may have been modified within the factory during creation. This method is intended to be used for cloning (@see IServiceFactory) or for persistence between sessions.

Returns:
A map with key of type String, and value of type Serializable.
See Also:
net.refractions.udig.catalog.IService#getConnectionParams()

canResolve

public boolean canResolve(java.lang.Class adaptee)
Description copied from interface: Resolve
Non blocking method which is used to determine if a resolve into an instance of a particular class is supported.

Parameters:
adaptee - Class of object to resolve into.
Returns:
true if a resolution for adaptee is avaialble
See Also:
IResolve#resolve(Class,ProgressListener)

members

public java.util.List members(ProgressListener monitor)
                       throws java.io.IOException
Description copied from interface: Service
Return list of IGeoResources managed by this service. This method must return the same result as the following:
   
   (List)resolve(List.class,monitor);
   
 

Many file based serivces will just contain a single IGeoResource.

Returns:
A list of type GeoResource.
Throws:
java.io.IOException

getMessage

public java.lang.Throwable getMessage()
Description copied from interface: Resolve
In the event that an error occurs during a resolve, that error can be reported back with this method. This method returns a value when Resolve.getStatus() returns Resolve.Status.BROKEN, otherwise it return null.

Returns:
An exception that occured during a resolve, otherwise null.
See Also:
Resolve.Status

getIdentifier

public java.net.URI getIdentifier()
Description copied from interface: Resolve
Returns a URI which uniqley identifies the Resolve.

Returns:
Id of the Resolve, should never be null.


Copyright © GeoTools. All Rights Reserved.