| java.lang.Object net.refractions.udig.catalog.IGeoResource
All known Subclasses: net.refractions.udig.catalog.internal.shp.ShpGeoResourceImpl, net.refractions.udig.catalog.memory.internal.MemoryGeoResourceImpl, net.refractions.udig.mapgraphic.internal.MapGraphicResource, net.refractions.udig.catalog.internal.postgis.PostGISGeoResource, net.refractions.udig.catalog.internal.wfs.WFSGeoResourceImpl, net.refractions.udig.project.internal.impl.NullGeoResource, net.refractions.udig.project.internal.impl.LayerResource, net.refractions.udig.catalog.internal.wms.WMSGeoResourceImpl, net.refractions.udig.catalog.internal.db2.DB2GeoResource, net.refractions.udig.catalog.internal.arcsde.ArcGeoResource, net.refractions.udig.catalog.rasterings.AbstractRasterGeoResource, net.refractions.udig.catalog.hsql.internal.HsqlGeoResource, net.refractions.udig.catalog.internal.gml.GMLGeoResourceImpl, net.refractions.udig.catalog.google.GoogleResource, net.refractions.udig.catalog.internal.oracle.OracleGeoResource,
IGeoResource | abstract public class IGeoResource implements IResolve(Code) | | Represents a handle to a spatial resource.
The resource is not guaranteed to exist, nor do we guarantee that we can connect with the
resource. Some/All potions of this handle may be loaded as required. This resource handle may
also be the result a metadata service query.
Implementing an IService
Implement the abstract methods and you are good to go.
Please consider implementing support for resolve( ImageDescriptor.class, null ) as it
will allow your IGeoResource to show up with a unqiue representation in the catalog.
author: David Zwiers, Refractions Research since: 0.6 |
Method Summary | |
public boolean | canResolve(Class<T> adaptee) Harded coded to capture the IGeoResource contract. | public void | dispose(IProgressMonitor monitor) Disposes of any resources or listeners required. | public boolean | equals(Object arg0) | abstract public URL | getIdentifier() | abstract public IGeoResourceInfo | getInfo(IProgressMonitor monitor) Blocking operation to describe this service. | public int | hashCode() | public List<IResolve> | members(IProgressMonitor monitor) List of children, or EMPTY_LIST for a leaf. | public IResolve | parent(IProgressMonitor monitor) Returns parent for this GeoResource. | public T | resolve(Class<T> adaptee, IProgressMonitor monitor) Blocking operation to resolve into the adaptee, if available. | abstract public IService | service(IProgressMonitor monitor) Returns the IService for this GeoResource. | public String | toString() Indicate class and id. |
canResolve | public boolean canResolve(Class<T> adaptee)(Code) | | Harded coded to capture the IGeoResource contract.
That is we *must* resolve the following:
Required adaptions:
- GeoResource.class - this
- IGeoResourceInfo.class - getInfo (ie about this handles contents)
- IService.class - service (ie that is responsible for this GeoResource)
Recommendated adaptions:
- ImageDescriptor.class (for icon provided by external service)
- List.class - members (ie children of this georesource as in the wms layer case)
Here is an implementation example (for something that can adapt to ImageDescriptor and
FeatureSource):
public <T> boolean canResolve( Class<T> adaptee ) {
return adaptee != null
&& (adaptee.isAssignableFrom(ImageDescriptor.class)
|| adaptee.isAssignableFrom(FeatureSource.class) || super.canResolve(adaptee));
}
|
dispose | public void dispose(IProgressMonitor monitor)(Code) | | Disposes of any resources or listeners required. Default implementation does nothing.
Parameters: monitor - monitor to show progress |
getIdentifier | abstract public URL getIdentifier()(Code) | | The identifier of a IGeoResource is identified by parent().getIdentifer()#ResourceID
For example: A WMS (IService) with an id of http://www.something.com/wms?Service=WMS would
have georesources with ids similar to: http://www.something.com/wms?Service=WMS#layer1
See Also: IResolve.getIdentifier |
parent | public IResolve parent(IProgressMonitor monitor) throws IOException(Code) | | Returns parent for this GeoResource.
Most implementations will use the following code example:
public IService parent( IProgressMonitor monitor ) throws IOException {
return service(monitor);
}
This code example preserves backwords compatibility with uDig 1.0 via type narrowing IResolve
to IService.
You will need to provide a different implementation when working with nested content (like
database schema or wms layers).
parent IResolve for this GeoResource See Also: IGeoResource.resolve(ClassIProgressMonitor) |
resolve | public T resolve(Class<T> adaptee, IProgressMonitor monitor) throws IOException(Code) | | Blocking operation to resolve into the adaptee, if available.
Required adaptions:
- GeoResource.class - this
- IGeoResourceInfo.class - getInfo( monitor ) ie about this handles contents
- IService.class - service( monitor ) ie that is responsible for this GeoResource
Example Use (no casting required!):
IGeoResourceInfo info = resolve(IGeoResourceInfo.class);
Recommendated adaptions:
- ImageDescriptor.class (for icon provided by external service)
- List.class - members( monitor ) ie children of this georesource as in the wms layer case
Parameters: adaptee - Parameters: monitor - instance of adaptee, or null if unavailable (IGeoResourceInfo and IService must besupported) See Also: IGeoResourceInfo See Also: IService See Also: IResolve.resolve(ClassIProgressMonitor) |
toString | public String toString()(Code) | | Indicate class and id.
string representing this IResolve |
|
|