|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.refractions.udig.catalog.IGeoResource
public abstract class IGeoResource
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.
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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface net.refractions.udig.catalog.IResolve |
---|
IResolve.Status |
Constructor Summary | |
---|---|
IGeoResource()
|
Method Summary | ||
---|---|---|
|
canResolve(java.lang.Class<T> adaptee)
Harded coded to capture the IGeoResource contract. |
|
void |
dispose(IProgressMonitor monitor)
Disposes of any resources or listeners required. |
|
boolean |
equals(java.lang.Object arg0)
This should represent the identifier |
|
abstract java.net.URL |
getIdentifier()
The identifier of a IGeoResource is identified by parent().getIdentifer()#ResourceID |
|
abstract IGeoResourceInfo |
getInfo(IProgressMonitor monitor)
Blocking operation to describe this service. |
|
int |
hashCode()
This should represent the identified |
|
java.util.List<IResolve> |
members(IProgressMonitor monitor)
List of children, or EMPTY_LIST for a leaf. |
|
IResolve |
parent(IProgressMonitor monitor)
Returns parent for this GeoResource. |
|
|
resolve(java.lang.Class<T> adaptee,
IProgressMonitor monitor)
Blocking operation to resolve into the adaptee, if available. |
|
abstract IService |
service(IProgressMonitor monitor)
Returns the IService for this GeoResource. |
|
java.lang.String |
toString()
Indicate class and id. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface net.refractions.udig.catalog.IResolve |
---|
getMessage, getStatus |
Constructor Detail |
---|
public IGeoResource()
Method Detail |
---|
public <T> T resolve(java.lang.Class<T> adaptee, IProgressMonitor monitor) throws java.io.IOException
Required adaptions:
Example Use (no casting required!):
IGeoResourceInfo info = resolve(IGeoResourceInfo.class);
Recommendated adaptions:
resolve
in interface IResolve
adaptee
- monitor
-
java.io.IOException
- if result was unavailable due to a technical problemIGeoResourceInfo
,
IService
,
IResolve.resolve(Class, IProgressMonitor)
public <T> boolean canResolve(java.lang.Class<T> adaptee)
That is we *must* resolve the following:
Required adaptions:
Recommendated adaptions:
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));
}
canResolve
in interface IResolve
IResolve.resolve(Class, IProgressMonitor);
public abstract IGeoResourceInfo getInfo(IProgressMonitor monitor) throws java.io.IOException
As an example this method is used by LabelDecorators to acquire title, and icon.
java.io.IOException
resolve(Class, IProgressMonitor)
public abstract IService service(IProgressMonitor monitor) throws java.io.IOException
Method is useful in dealing with deeply nested GeoResource children (where parent may not always be an IService).
java.io.IOException
resolve(Class, IProgressMonitor)
public IResolve parent(IProgressMonitor monitor) throws java.io.IOException
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
in interface IResolve
monitor
- used to provide feedback during parent lookup
java.io.IOException
- in the event of a technical problemresolve(Class, IProgressMonitor)
public java.util.List<IResolve> members(IProgressMonitor monitor)
The provided implementation indicates that this IGeoResource is a leaf.
members
in interface IResolve
monitor
- Monitor used to provide feedback during member lookup
net.refractions.udig.catalog.IResolve#members(org.eclipse.core.runtime.IProgressMonitor)
public boolean equals(java.lang.Object arg0)
equals
in class java.lang.Object
arg0
-
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public java.lang.String toString()
toString
in class java.lang.Object
public abstract java.net.URL getIdentifier()
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
getIdentifier
in interface IResolve
IResolve.getIdentifier()
public void dispose(IProgressMonitor monitor)
dispose
in interface IResolve
monitor
- monitor to show progress
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |