All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.las.ogdi.OGDIRemoteClient

java.lang.Object
   |
   +----com.las.ogdi.OGDIClient
           |
           +----com.las.ogdi.OGDIRemoteClient

public class OGDIRemoteClient
extends OGDIClient
The Remote client class defines a behaviour for a remote OGDI client.

Version:
1.0
Author:
Las Inc.

Constructor Index

 o OGDIRemoteClient(OGDIUrl)
Creates an instance of OGDI remote client and connects it to the requested URL.
 o OGDIRemoteClient(OGDIUrl, String)
Overloads the creation of an instance of OGDI remote client and connects it to the requested URL.

Method Index

 o addConnectionListener(ConnectionListener)
Adds a listener to the client.
 o calcDistance(OGDICoordinate, OGDICoordinate)
Calculates a distance between two coordinates.
 o convertCoordinates(OGDIProjectionDescriptor, OGDIProjectionDescriptor, OGDICoordinate[])
Converts a set of coordinates between two projections.
 o dispose()
Closes the connection.
 o finalize()
This function is called by the garbage collector.
 o getAttributesFormat()
Gets the list of attribute formats of the selected coverage.
 o getCurrentCoverage()
Gets the current coverage.
 o getCurrentCoverageRegion()
Gets the source region of the currently selected coverage.
 o getCurrentProjection()
Gets the current projection of the client.
 o getCurrentRegion()
Gets the current region previously set.
 o getDictionary()
Gets the dictionary of the datasource.
 o getFeature(String)
Gets the coordinates and attributes of the specified geometric object.
 o getFeatureIdFromCoord(OGDICoordinate)
Gets the object that is nearest to a set of coordinates in the current layer.
 o getNextFeature()
Gets the next geometric object in the current coverage.
 o getRasterInfo()
Gets the raster information of the selected coverage.
 o getSourceProjection()
Gets the projection of the datasource.
 o getSourceRegion()
Gets the global region of the datasource.
 o getUrl()
Gets the Uniform Resource Locator of the client.
 o isVerbose()
Gets the verbosity status of the client.
 o removeConnectionListener(ConnectionListener)
Removes a listener from the client.
 o setCurrentCoverage(OGDICoverage)
Defines the current coverage by an existing coverage.
 o setCurrentCoverage(OGDIFamily, String)
Defines the current coverage.
 o setCurrentProjection(OGDIProjectionDescriptor)
Sets the current projection of the client.
 o setCurrentRegion(OGDIRegion)
Selects the current geographic region.
 o setVerbose(boolean)
Sets the verbosity of the client.

Constructors

 o OGDIRemoteClient
 public OGDIRemoteClient(OGDIUrl url) throws OGDIException
Creates an instance of OGDI remote client and connects it to the requested URL.

Parameters:
url - the Uniform Resource Locator of the datasource
Returns:
no return
Throws: OGDIException
if there is a bad connection
Throws: IllegalArgumentException
if URL is badly formatted
See Also:
OGDIUrl
 o OGDIRemoteClient
 public OGDIRemoteClient(OGDIUrl url,
                         String setting) throws OGDIException
Overloads the creation of an instance of OGDI remote client and connects it to the requested URL. The protocol preference can be set.

Parameters:
url - the Uniform Resource Locator of the datasource (optionally add a port like :8080 if tunnel setting)
setting - "auto" for automatic switching between Intranet and Internet mode, "tunnel" for tunneling through firewalls, "tunnel=path" with the path of the server tunneling program for custom version
Returns:
no return
Throws: OGDIException
if there is a bad connection
Throws: IllegalArgumentException
if URL is badly formatted or setting is invalid
See Also:
OGDIUrl

Methods

 o getUrl
 public final OGDIUrl getUrl() throws OGDIException
Gets the Uniform Resource Locator of the client.

Parameters:
no - parameter
Returns:
the Url of the client
Throws: OGDIException
if unable to get a valid Url
Overrides:
getUrl in class OGDIClient
 o setCurrentCoverage
 public void setCurrentCoverage(OGDIFamily family,
                                String request) throws OGDIException
Defines the current coverage. The selected layer is considered the current coverage by all other coverage-oriented methods until this method is called again with a new request. When geographic objects are retrieved from this coverage, they are retrieved from the region previously selected by setCurrentRegion . If setCurrentRegion was not called, the source default region is used.

Parameters:
family - a family type of geometric objects
request - a request in the layer information structure
Returns:
no return
Throws: IllegalArgumentException
if the coverage is in the wrong format
Throws: OGDIException
if the coverage is irretrievable
Overrides:
setCurrentCoverage in class OGDIClient
See Also:
getNextFeature, getDictionary, setCurrentRegion
 o setCurrentCoverage
 public void setCurrentCoverage(OGDICoverage coverage) throws OGDIException
Defines the current coverage by an existing coverage. The selected layer is considered the current coverage by all other coverage-oriented methods until this method is called again with a new request. When geographic objects are retrieved from this coverage, they are retrieved from the region previously selected by setCurrentRegion . If setCurrentRegion was not called, the source default region is used.

Parameters:
coverage - a coverage in the layer information structure
Returns:
no return
Throws: IllegalArgumentException
if the coverage is in the wrong format
Throws: OGDIException
if the coverage is irretrievable
Overrides:
setCurrentCoverage in class OGDIClient
See Also:
getNextFeature, getDictionary, setCurrentRegion
 o getCurrentCoverage
 public final OGDICoverage getCurrentCoverage() throws OGDIException
Gets the current coverage.

Parameters:
no - parameter
Returns:
the current coverage of the client or null
Throws: OGDIException
if unable to get a valid coverage
Overrides:
getCurrentCoverage in class OGDIClient
 o getDictionary
 public OGDIDictionary getDictionary() throws OGDIException
Gets the dictionary of the datasource.

Parameters:
no - parameter
Returns:
an enumeration of OGDICoverageDescription
Throws: OGDIException
if unable to fetch a valid dictionary
Overrides:
getDictionary in class OGDIClient
 o setCurrentRegion
 public void setCurrentRegion(OGDIRegion region) throws OGDIException
Selects the current geographic region. Until the method is called again, all geographic objects retrieved are contained (partially or totally) within this region. The region is defined with the client's projection.

Parameters:
region - The current geographic region
Returns:
no return
Throws: IllegalArgumentException
if region is invalid
Throws: OGDIException
if unable to set a valid region
Overrides:
setCurrentRegion in class OGDIClient
 o getCurrentRegion
 public final OGDIRegion getCurrentRegion() throws OGDIException
Gets the current region previously set. All geographic objects retrieved are at least partially contained in it.

Parameters:
no - parameter
Returns:
the north, south, east, west bounding box and resolution
Throws: OGDIException
if unable to get a valid region
Overrides:
getCurrentRegion in class OGDIClient
 o getSourceRegion
 public OGDIRegion getSourceRegion() throws OGDIException
Gets the global region of the datasource.

Parameters:
no - parameter
Returns:
the north, south, east, west bounding box and resolution
Throws: OGDIException
if unable to get a valid region
Overrides:
getSourceRegion in class OGDIClient
 o getCurrentCoverageRegion
 public final OGDIRegion getCurrentCoverageRegion() throws OGDIException
Gets the source region of the currently selected coverage.

Parameters:
no - parameter
Returns:
the north, south, east, west bounding box and resolution or null
Throws: OGDIException
if unable to get a valid coverage
Overrides:
getCurrentCoverageRegion in class OGDIClient
 o setCurrentProjection
 public void setCurrentProjection(OGDIProjectionDescriptor projection) throws OGDIException
Sets the current projection of the client.

Parameters:
projection - a projection descriptor
Returns:
no return
Throws: IllegalArgumentException
if the projection is invalid
Throws: OGDIException
if unable to set a valid projection
Overrides:
setCurrentProjection in class OGDIClient
 o getCurrentProjection
 public OGDIProjectionDescriptor getCurrentProjection() throws OGDIException
Gets the current projection of the client.

Parameters:
no - parameter
Returns:
the projection descriptor
Throws: OGDIException
if unable to get a valid descriptor
Overrides:
getCurrentProjection in class OGDIClient
 o getSourceProjection
 public OGDIProjectionDescriptor getSourceProjection() throws OGDIException
Gets the projection of the datasource.

Parameters:
no - parameter
Returns:
a projection descriptor
Throws: OGDIException
if unable to get a valid descriptor
Overrides:
getSourceProjection in class OGDIClient
 o calcDistance
 public double calcDistance(OGDICoordinate begin,
                            OGDICoordinate end) throws OGDIException
Calculates a distance between two coordinates.

Parameters:
begin - a beginning coordinate
end - an ending coordinate
Returns:
a geographic earth distance in meters
Throws: IllegalArgumentException
if beginning/ending coordinate is illegal
Throws: OGDIException
if results are illegal
Overrides:
calcDistance in class OGDIClient
 o convertCoordinates
 public void convertCoordinates(OGDIProjectionDescriptor original,
                                OGDIProjectionDescriptor target,
                                OGDICoordinate coordinates[]) throws OGDIException
Converts a set of coordinates between two projections.

Parameters:
original - the projection of the coordinates to convert
target - the projection to which coordinates are converted
coordinates - a table of coordinates in the original projection
Returns:
no return: the coordinates referenced by coordinate are directly changed
Throws: IllegalArgumentException
if original/target projection or coordinates are illegal
Throws: OGDIException
if result coordinates are illegal
Overrides:
convertCoordinates in class OGDIClient
 o getFeature
 public OGDIFeature getFeature(String id) throws OGDIException
Gets the coordinates and attributes of the specified geometric object. Coordinates are expressed in the coordinate system of the current projection

Parameters:
id - the id of a point as coded in the coverage (generally a number > 0)
Returns:
a geometric object or null if object doesn't exist or no coverage selected
Throws: IllegalArgumentException
if id is null or empty
Throws: OGDIException
if unable to fetch a valid object from the server
Overrides:
getFeature in class OGDIClient
 o getNextFeature
 public OGDIFeature getNextFeature() throws OGDIException
Gets the next geometric object in the current coverage.

Parameters:
no - parameter
Returns:
a geometric object or null if no more objects or no coverage selected
Throws: OGDIException
if unable to fetch a valid object from the server
Overrides:
getNextFeature in class OGDIClient
 o getFeatureIdFromCoord
 public String getFeatureIdFromCoord(OGDICoordinate coord) throws OGDIException
Gets the object that is nearest to a set of coordinates in the current layer.

Parameters:
coord - a coordinate in the coordinate system of the current projection
Returns:
an id string or null if no object at coord or no coverage selected
Throws: IllegalArgumentException
if coord is null
Throws: OGDIException
if unable to fetch a valid object from the server
Overrides:
getFeatureIdFromCoord in class OGDIClient
 o setVerbose
 public void setVerbose(boolean verbose)
Sets the verbosity of the client. If set to true, objectInfo will be loaded

Parameters:
verbose - true if object information is needed, false otherwise
Returns:
no return
Throws: no
exception
Overrides:
setVerbose in class OGDIClient
 o isVerbose
 public final boolean isVerbose()
Gets the verbosity status of the client.

Parameters:
no - parameter
Returns:
true if the client loads the object information
Throws: no
exception
Overrides:
isVerbose in class OGDIClient
 o getAttributesFormat
 public Enumeration getAttributesFormat() throws OGDIException
Gets the list of attribute formats of the selected coverage. If there is no selected coverage, returns null.

Parameters:
no - parameter
Returns:
an Enumeration of zero or more OGDIAttributeFormat
Throws: OGDIException
if unable to fetch a valid format from the server
Overrides:
getAttributesFormat in class OGDIClient
 o getRasterInfo
 public OGDIRasterInfo getRasterInfo() throws OGDIException
Gets the raster information of the selected coverage. If the selected coverage is a raster, null otherwise.

Parameters:
no - parameter
Returns:
a RasterInfo structure
Throws: OGDIException
if unable to fetch a valid info from the server
Overrides:
getRasterInfo in class OGDIClient
 o addConnectionListener
 public void addConnectionListener(ConnectionListener listener) throws OGDIException
Adds a listener to the client. The listener will be notified when the connection is closed.

Parameters:
listener - the listener instance (for example a display window)
Returns:
no return
Throws: OGDIException
if client is already disposed of
Overrides:
addConnectionListener in class OGDIClient
 o removeConnectionListener
 public void removeConnectionListener(ConnectionListener listener) throws OGDIException
Removes a listener from the client.

Parameters:
listener - the listener instance (for example a display window)
Returns:
no return
Throws: OGDIException
if client is already disposed of
Overrides:
removeConnectionListener in class OGDIClient
 o dispose
 public synchronized void dispose() throws OGDIException
Closes the connection. All the listeners are notified of the event. After this function has been called, the object should not be used any more.

Parameters:
no - param
Returns:
no return
Throws: OGDIException
if unable to disconnect (server will timeout automatically)
Overrides:
dispose in class OGDIClient
See Also:
addListener, removeListener
 o finalize
 protected void finalize() throws Throwable
This function is called by the garbage collector. Users should not call this function. It calls the dispose function in order to close the connection and free the resources.

Parameters:
no - param
Returns:
no return
Throws: Throwable
if there is a problem with garbage collection
Overrides:
finalize in class OGDIClient
See Also:
dispose

All Packages  Class Hierarchy  This Package  Previous  Next  Index