public class TLcdWCSClient extends Object
TLcdWCSClient
class represents a client interface to an OpenGIS WCS server.
The supported WCS version is 1.0.0.
A new TLcdWCSClient
instance can be created by invoking
one of the static factory methods, given a URI of the server or an
TLcdWCSCapabilities
object representing the server's capabilities.
To customize the communication between client and server, an ILcdOWSTransport
can optionally be provided. This interface represents the transport layer, and can be used
to choose the communication protocol (HTTP GET, HTTP POST, ...), add authentication,
or configure any other parameter that relates to the communication channel. By default,
an instance of TLcdOWSHttpTransport
is used.
Once a TLcdWCSClient
instance is initialized, the following requests can be created:
createGetCapabilitiesRequest()
createGetCoverageRequest()
createDescribeCoverageRequest()
To send requests to the server and receive the response, the following methods can be used:
getCachedCapabilities()
or getCapabilities(TLcdWCSGetCapabilitiesRequest)
getCoverage(TLcdWCSGetCoverageRequest)
describeCoverage(TLcdWCSDescribeCoverageRequest)
TLcdOWSHttpTransport
,
TLcdWCSGetCapabilitiesRequest
,
TLcdWCSGetCoverageRequest
,
TLcdWCSDescribeCoverageRequest
Modifier | Constructor and Description |
---|---|
protected |
TLcdWCSClient(TLcdWCSCapabilities aCapabilities,
ILcdOWSTransport aTransport)
Creates a new
TLcdWCSClient with the given parameters. |
protected |
TLcdWCSClient(URI aURI,
ILcdOWSTransport aTransport,
Object aTransportData)
Creates a new
TLcdWCSClient with the given parameters. |
Modifier and Type | Method and Description |
---|---|
TLcdWCSDescribeCoverageRequest |
createDescribeCoverageRequest()
Creates a new 'DescribeCoverage' request object which is compatible with the WCS version implemented by the WCS
server this client communicates with.
|
TLcdWCSGetCapabilitiesRequest |
createGetCapabilitiesRequest()
Creates a new 'GetCapabilities' request object which is compatible with the WCS version implemented by the WCS
server this client communicates with.
|
TLcdWCSGetCoverageRequest |
createGetCoverageRequest()
Creates a new 'GetCoverage' request object which is compatible with the WCS version implemented by the WCS server
this client communicates with.
|
static TLcdWCSClient |
createWCSClient(TLcdWCSCapabilities aCapabilities,
ILcdOWSTransport aTransport)
Creates a new WCS client using the specified capabilities.
|
static TLcdWCSClient |
createWCSClient(URI aURI)
Creates a new WCS client using the specified URI.
|
static TLcdWCSClient |
createWCSClient(URI aURI,
ILcdOWSTransport aTransport,
Object aTransportData)
Creates a new WCS client using the specified URI.
|
protected List |
decodeOperations(TLcdWCSCapabilities aCapabilities)
Returns a list of TLcdOWSOperation instances based on the contents of the provided TLcdWCSCapabilities instance.
|
TLcdWCSCoverageDescription |
describeCoverage(TLcdWCSDescribeCoverageRequest aRequest)
Performs the 'DescribeCoverage' request.
|
TLcdWCSCapabilities |
getCachedCapabilities()
Returns the most recent capabilities object that was requested by this client.
|
TLcdWCSCapabilities |
getCapabilities(TLcdWCSGetCapabilitiesRequest aRequest)
Performs the 'GetCapabilities' request.
|
TLcdOWSInputStream |
getCoverage(TLcdWCSGetCoverageRequest aRequest)
Performs the 'GetCoverage' request.
|
protected TLcdOWSOperation |
getOperation(String aOperationName)
Retrieves an operation based on the operation name.
|
URI |
getURI()
Returns the URI of the WCS server.
|
protected TLcdOWSInputStream |
performRequest(String aOperationName,
ILcdOWSRequest aRequest)
Performs a WCS request.
|
String |
toString() |
protected TLcdWCSClient(TLcdWCSCapabilities aCapabilities, ILcdOWSTransport aTransport) throws TLcdOWSDecodingException, TLcdOWSTransportException, TLcdOWSServerException, TLcdOWSUnsupportedVersionException
TLcdWCSClient
with the given parameters.aCapabilities
- the capabilities of the WCS serveraTransport
- the transport to useTLcdOWSDecodingException
- if an error occurs while decoding the intial WCS responseTLcdOWSServerException
- if an exception report is received from the serverTLcdOWSTransportException
- if an error occurs in the transport layer while negotiation the versionTLcdOWSUnsupportedVersionException
- if the specified WCS server does not support any of the WCS versions
implemented by this clientprotected TLcdWCSClient(URI aURI, ILcdOWSTransport aTransport, Object aTransportData) throws TLcdOWSDecodingException, TLcdOWSTransportException, TLcdOWSServerException, TLcdOWSUnsupportedVersionException
TLcdWCSClient
with the given parameters.aURI
- the URI of the WCS serveraTransport
- the transport to useaTransportData
- the transport data to use for the initial capabilities requests (may be null)IllegalArgumentException
- if the specified URI is not compatible with the specified transportTLcdOWSDecodingException
- if an error occurs while decoding the initial WCS responseTLcdOWSServerException
- if an exception report is received from the serverTLcdOWSTransportException
- if an error occurs in the transport layer while negotiation the versionTLcdOWSUnsupportedVersionException
- if the specified WCS server does not support any of the WCS versions
implemented by this clientpublic static TLcdWCSClient createWCSClient(URI aURI) throws TLcdOWSTransportException, TLcdOWSServerException, TLcdOWSDecodingException, TLcdOWSUnsupportedVersionException
aURI
- the URI of the WCS serverNullPointerException
- if the URI is nullIllegalArgumentException
- if the specified URI is not compatible with the default transportTLcdOWSDecodingException
- if an error occurs while decoding the intial WCS responseTLcdOWSServerException
- if an exception report is received from the serverTLcdOWSTransportException
- if an error occurs in the transport layer while negotiation the versionTLcdOWSUnsupportedVersionException
- if the specified WCS server does not support any of the WCS versions
implemented by this clientcreateWCSClient(java.net.URI, ILcdOWSTransport, Object)
public static TLcdWCSClient createWCSClient(TLcdWCSCapabilities aCapabilities, ILcdOWSTransport aTransport) throws TLcdOWSUnsupportedVersionException, TLcdOWSDecodingException, TLcdOWSServerException, TLcdOWSTransportException
aCapabilities
- the capabilities of the WCS serveraTransport
- the transport to useNullPointerException
- if either the URI or the transport is nullIllegalArgumentException
- if the specified URI is not compatible with the specified transportTLcdOWSDecodingException
- if an error occurs while decoding the intial WCS responseTLcdOWSServerException
- if an exception report is received from the serverTLcdOWSTransportException
- if an error occurs in the transport layer while negotiation the versionTLcdOWSUnsupportedVersionException
- if the specified WCS server does not support any of the WCS versions
implemented by this clientpublic static TLcdWCSClient createWCSClient(URI aURI, ILcdOWSTransport aTransport, Object aTransportData) throws TLcdOWSUnsupportedVersionException, TLcdOWSDecodingException, TLcdOWSServerException, TLcdOWSTransportException
aURI
- the URI of the WCS serveraTransport
- the transport to useaTransportData
- the transport data to use for the initial capabilities requests (may be null)NullPointerException
- if either the URI or the transport is nullIllegalArgumentException
- if the specified URI is not compatible with the specified transportTLcdOWSDecodingException
- if an error occurs while decoding the intial WCS responseTLcdOWSServerException
- if an exception report is received from the serverTLcdOWSTransportException
- if an error occurs in the transport layer while negotiation the versionTLcdOWSUnsupportedVersionException
- if the specified WCS server does not support any of the WCS versions
implemented by this clientpublic URI getURI()
GetCapabilities
request, the address associated
with this request is used. If the GET request method is supported, the corresponding address is used;
otherwise, it is assumed that the POST request method is supported and the corresponding address is used;
if this check also fails, null
is returned and the client will not be able to connect with
the WCS server.protected final TLcdOWSOperation getOperation(String aOperationName)
aOperationName
- the name of the operationprotected List decodeOperations(TLcdWCSCapabilities aCapabilities)
aCapabilities
- the capabilities from which to derive the list of operationspublic TLcdWCSGetCapabilitiesRequest createGetCapabilitiesRequest()
public TLcdWCSDescribeCoverageRequest createDescribeCoverageRequest()
public TLcdWCSGetCoverageRequest createGetCoverageRequest()
public TLcdWCSCapabilities getCachedCapabilities()
getCapabilities(TLcdWCSGetCapabilitiesRequest)
is
called.public TLcdWCSCapabilities getCapabilities(TLcdWCSGetCapabilitiesRequest aRequest) throws TLcdOWSServerException, TLcdOWSDecodingException, TLcdOWSTransportException, TLcdOWSUnsupportedVersionException
aRequest
- the request object containing the parameters to pass to the WCS serverTLcdOWSServerException
- if the server returned an OpenGIS Web Service exceptionTLcdOWSDecodingException
- if an error occurred while decoding the 'GetCapabilities' responseTLcdOWSTransportException
- if an error occurred in the transport while accessing the web serviceTLcdOWSUnsupportedVersionException
- if the server only supports WCS specification versions that are not supported by
this clientpublic TLcdWCSCoverageDescription describeCoverage(TLcdWCSDescribeCoverageRequest aRequest) throws TLcdOWSServerException, TLcdOWSDecodingException, TLcdOWSTransportException
aRequest
- the request object containing the parameters to pass to the WCS serverTLcdOWSServerException
- if the server returned an OpenGIS Web Service exceptionTLcdOWSDecodingException
- if an error occurred while decoding the 'DescribeCoverage' responseTLcdOWSTransportException
- if an error occurred in the transport while accessing the web servicepublic TLcdOWSInputStream getCoverage(TLcdWCSGetCoverageRequest aRequest) throws TLcdOWSServerException, TLcdOWSDecodingException, TLcdOWSTransportException
aRequest
- the request object containing the parameters to pass to the WCS serverTLcdOWSServerException
- if the server returned an OpenGIS Web Service exceptionTLcdOWSDecodingException
- if an error occurred while decoding the 'DescribeCoverage' responseTLcdOWSTransportException
- if an error occurred in the transport while accessing the web serviceprotected final TLcdOWSInputStream performRequest(String aOperationName, ILcdOWSRequest aRequest) throws TLcdOWSTransportException, TLcdOWSServerException, TLcdOWSDecodingException
aOperationName
- the name of the operation to invokeaRequest
- the request object that should be sentTLcdOWSServerException
- if the server returned an OpenGIS Web Service exceptionTLcdOWSDecodingException
- if an error occurred while decoding the processing the responseTLcdOWSTransportException
- if an error occurred in the transport while accessing the web service