org.geotools.catalog
Class AbstractFileService

Object
  extended by AbstractService
      extended by AbstractFileService
All Implemented Interfaces:
Resolve, Service
Direct Known Subclasses:
SLDService

public abstract class AbstractFileService
extends AbstractService

Abstract service implementation for file based services.

Author:
Justin Deoliveira, The Open Planning Project, jdeolive@openplans.org

Nested Class Summary
 
Nested classes/interfaces inherited from interface Resolve
Resolve.Status
 
Field Summary
 
Fields inherited from class AbstractService
logger
 
Constructor Summary
AbstractFileService(Catalog parent, File file)
           
AbstractFileService(Catalog parent, Map params, File file)
           
 
Method Summary
 boolean canResolve(Class adaptee)
          Supports default Service resolves with an additional resolve to a File.
protected abstract  List createMembers(ProgressListener monitor)
           
 File getFile()
           
 URI getIdentifier()
          Returns the file uri.
 List members(ProgressListener monitor)
          Returns a single element list which contains a single instance of AbstractFileGeoResource.
 Object resolve(Class adaptee, ProgressListener monitor)
          Supports default Service resolves with an additional resolve to a File.
 
Methods inherited from class AbstractService
addListener, equals, fire, getConnectionParams, getMembers, getMessage, getStatus, hashCode, parent, removeListener, setConnectionParams, setMembers, setMessage, toString
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface Service
getInfo
 

Constructor Detail

AbstractFileService

public AbstractFileService(Catalog parent,
                           File file)

AbstractFileService

public AbstractFileService(Catalog parent,
                           Map params,
                           File file)
Method Detail

getFile

public File getFile()
Returns:
the underlying file handle.

members

public List members(ProgressListener monitor)
             throws IOException
Returns a single element list which contains a single instance of AbstractFileGeoResource.

Parameters:
monitor - Progress monitor used to report status while blocking. May be null.
Returns:
A list of type GeoResource.
Throws:
IOException - in the result of an I/O error.

createMembers

protected abstract List createMembers(ProgressListener monitor)
                               throws IOException
Throws:
IOException

canResolve

public boolean canResolve(Class adaptee)
Supports default Service resolves with an additional resolve to a File.

Subclasses may wish to extend, or override this method.

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

resolve

public Object resolve(Class adaptee,
                      ProgressListener monitor)
               throws IOException
Supports default Service resolves with an additional resolve to a File.

Subclasses may wish to extend, or override this method.

Parameters:
adaptee - Class of object to resolve into.
monitor - Progress monitor used to report status while blocking. May be null.
Returns:
instance of adaptee, or null if unavailable (IServiceInfo and List must be supported)
Throws:
IOException - in the result of an I/O error.
See Also:
ServiceInfo, GeoResource, IResolve#resolve(Class, ProgressListener)

getIdentifier

public URI getIdentifier()
Returns the file uri.

Returns:
Id of the Resolve, should never be null.
See Also:
getFile()


Copyright © 1996-2008 Geotools. All Rights Reserved.