net.refractions.udig.catalog
Class ICatalog

java.lang.Object
  extended by net.refractions.udig.catalog.ICatalog
All Implemented Interfaces:
IResolve

public abstract class ICatalog
extends java.lang.Object
implements IResolve

Interface to capture both the Local Catalog resources and Web Registry Service.

Conceptually provides a searchable Catalog of "Spatial Data Sources". Metadata search is abitrary.

Since:
0.7.0
Author:
David Zwiers, Refractions Research
See Also:
IService

Nested Class Summary
 
Nested classes/interfaces inherited from interface net.refractions.udig.catalog.IResolve
IResolve.Status
 
Constructor Summary
ICatalog()
           
 
Method Summary
abstract  void add(IService service)
          Adds the specified entry to this catalog.
abstract  void addCatalogListener(IResolveChangeListener listener)
           
abstract  IGeoResource createTemporaryResource(java.lang.Object descriptor)
          Create an IGeoResource that is will be deleted after the session.
 void dispose(IProgressMonitor monitor)
          Clean up after aquired resources - the handle will not function after being disposed.
abstract  java.util.List<IResolve> find(java.net.URL resource, IProgressMonitor monitor)
          Find resources matching this id directly from this Catalog.
abstract  java.util.List<IService> findService(java.net.URL query)
          Deprecated. This method cannot be guarnteed to be non blocking for external catalogs, please use getById instead
abstract
<T extends IResolve>
T
getById(java.lang.Class<T> type, java.net.URL id, IProgressMonitor monitor)
          Look in catalog for exact match with provided id.
 ICatalogInfo getInfo(IProgressMonitor monitor)
          Aquire info on this Catalog.
abstract  java.lang.String[] getTemporaryDescriptorClasses()
          Returns The list of class names that this catalog can use to create Temporary Resources.
 IResolve parent(IProgressMonitor monitor)
          Catalogs do not have a parent so null is returned.
abstract  void remove(IService service)
          Removes the specified entry to this catalog.
abstract  void removeCatalogListener(IResolveChangeListener listener)
           
abstract  void replace(java.net.URL id, IService service)
          Replaces the specified entry in this catalog.
abstract
<T> T
resolve(java.lang.Class<T> adaptee, IProgressMonitor monitor)
          Will attempt to morph into the adaptee, and return that object.
abstract  java.util.List<IResolve> search(java.lang.String pattern, Envelope bbox, IProgressMonitor monitor)
          Performs a search on this catalog based on the specified inputs.
 java.lang.String toString()
          Indicate class and id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.refractions.udig.catalog.IResolve
canResolve, getIdentifier, getMessage, getStatus, members
 

Constructor Detail

ICatalog

public ICatalog()
Method Detail

parent

public IResolve parent(IProgressMonitor monitor)
Catalogs do not have a parent so null is returned.

We can consider adding a global 'root' parent - but we will wait until we find a need, or if users request.

Specified by:
parent in interface IResolve
Parameters:
monitor - used to provide feedback during parent lookup
Returns:
null as catalogs do not have a parent

add

public abstract void add(IService service)
                  throws java.lang.UnsupportedOperationException
Adds the specified entry to this catalog. In some cases the catalog will be backed onto a server, which may not allow for additions.

An IService may belong to more than one Catalog.

Parameters:
entry -
Throws:
java.lang.UnsupportedOperationException

remove

public abstract void remove(IService service)
                     throws java.lang.UnsupportedOperationException
Removes the specified entry to this catalog. In some cases the catalog will be backed onto a server, which may not allow for deletions.

Parameters:
service -
Throws:
java.lang.UnsupportedOperationException

replace

public abstract void replace(java.net.URL id,
                             IService service)
                      throws java.lang.UnsupportedOperationException
Replaces the specified entry in this catalog. In some cases the catalog will be backed onto a server, which may not allow for deletions.

Parameters:
id -
service -
Throws:
java.lang.UnsupportedOperationException

resolve

public abstract <T> T resolve(java.lang.Class<T> adaptee,
                              IProgressMonitor monitor)
                   throws java.io.IOException
Will attempt to morph into the adaptee, and return that object. Required adaptions: May Block.

Specified by:
resolve in interface IResolve
Parameters:
adaptee -
monitor - May Be Null
Returns:
Throws:
java.io.IOException - if result was unavailable due to a technical problem
See Also:
ICatalogInfo, IService

getInfo

public ICatalogInfo getInfo(IProgressMonitor monitor)
                     throws java.io.IOException
Aquire info on this Catalog.

This is functionally equivalent to: resolve(ICatalogInfo.class,monitor)

Returns:
ICatalogInfo resolve(ICatalogInfo.class,IProgressMonitor monitor);
Throws:
java.io.IOException
See Also:
resolve(Class, IProgressMonitor)

find

public abstract java.util.List<IResolve> find(java.net.URL resource,
                                              IProgressMonitor monitor)
Find resources matching this id directly from this Catalog.

Parameters:
resource - used to match resolves
monitor - used to show the progress of the find.
Returns:
List (possibly empty) of matching Resolves

findService

public abstract java.util.List<IService> findService(java.net.URL query)
Deprecated. This method cannot be guarnteed to be non blocking for external catalogs, please use getById instead

Find Service matching this id directly from this Catalog. This method is guaranteed to be non-blocking.

Parameters:
id - used to match resolves
monitor - TODO
Returns:
List (possibly empty) of matching Resolves

getById

public abstract <T extends IResolve> T getById(java.lang.Class<T> type,
                                               java.net.URL id,
                                               IProgressMonitor monitor)
Look in catalog for exact match with provided id.

Parameters:
type - Type of IResolve if known
id - id used for lookup
monitor -
Returns:
Resolve or null if not found

search

public abstract java.util.List<IResolve> search(java.lang.String pattern,
                                                Envelope bbox,
                                                IProgressMonitor monitor)
                                         throws java.io.IOException
Performs a search on this catalog based on the specified inputs.

The pattern uses the following conventions:

The bbox provided shall be in Lat - Long, or null if the search is not to be contained within a specified area.

Parameters:
pattern - Search pattern (see above)
bbox - The bbox in Lat-Long (ESPG 4269), or null
monitor - for progress, or null if monitoring is not desired
Returns:
List matching IResolve
Throws:
java.io.IOException

toString

public java.lang.String toString()
Indicate class and id.

Overrides:
toString in class java.lang.Object
Returns:
string representing this IResolve

addCatalogListener

public abstract void addCatalogListener(IResolveChangeListener listener)
Parameters:
listener -

removeCatalogListener

public abstract void removeCatalogListener(IResolveChangeListener listener)
Parameters:
listener -

createTemporaryResource

public abstract IGeoResource createTemporaryResource(java.lang.Object descriptor)
                                              throws java.lang.IllegalArgumentException
Create an IGeoResource that is will be deleted after the session. The descriptor object passed in is used to determine the type of resource that is created. For example if the descriptor object is a FeatureType then a IGeoResource that can resolve to a FeatureStore will be returned.

Parameters:
descriptor - An object whose type is in the getTemporaryDescriptorClasses() array.
Returns:
an IGeoResource that is will be deleted after the session.
Throws:
java.lang.IllegalArgumentException - if the descriptor type is not known.

getTemporaryDescriptorClasses

public abstract java.lang.String[] getTemporaryDescriptorClasses()
Returns The list of class names that this catalog can use to create Temporary Resources.

Returns:
The list of class names that this catalog can use to create Temporary Resources.

dispose

public void dispose(IProgressMonitor monitor)
Description copied from interface: IResolve
Clean up after aquired resources - the handle will not function after being disposed.

Specified by:
dispose in interface IResolve