Class TLcdWCSClient
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:
- GetCapabilities:
createGetCapabilitiesRequest()
- GetCoverage:
createGetCoverageRequest()
- DescribeCoverage:
createDescribeCoverageRequest()
To send requests to the server and receive the response, the following methods can be used:
- GetCapabilities:
getCachedCapabilities()
orgetCapabilities(TLcdWCSGetCapabilitiesRequest)
- GetCoverage:
getCoverage(TLcdWCSGetCoverageRequest)
- DescribeCoverage:
describeCoverage(TLcdWCSDescribeCoverageRequest)
- Since:
- 8.2
- See Also:
-
Constructor Summary
ModifierConstructorDescriptionprotected
TLcdWCSClient
(TLcdWCSCapabilities aCapabilities, ILcdOWSTransport aTransport) Creates a newTLcdWCSClient
with the given parameters.protected
TLcdWCSClient
(URI aURI, ILcdOWSTransport aTransport, Object aTransportData) Creates a newTLcdWCSClient
with the given parameters. -
Method Summary
Modifier and TypeMethodDescriptionCreates a new 'DescribeCoverage' request object which is compatible with the WCS version implemented by the WCS server this client communicates with.Creates a new 'GetCapabilities' request object which is compatible with the WCS version implemented by the WCS server this client communicates with.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.Performs the 'DescribeCoverage' request.Returns the most recent capabilities object that was requested by this client.getCapabilities
(TLcdWCSGetCapabilitiesRequest aRequest) Performs the 'GetCapabilities' request.getCoverage
(TLcdWCSGetCoverageRequest aRequest) Performs the 'GetCoverage' request.protected final TLcdOWSOperation
getOperation
(String aOperationName) Retrieves an operation based on the operation name.getURI()
Returns the URI of the WCS server.protected final TLcdOWSInputStream
performRequest
(String aOperationName, ILcdOWSRequest aRequest) Performs a WCS request.toString()
-
Constructor Details
-
TLcdWCSClient
protected TLcdWCSClient(TLcdWCSCapabilities aCapabilities, ILcdOWSTransport aTransport) throws TLcdOWSDecodingException, TLcdOWSTransportException, TLcdOWSServerException, TLcdOWSUnsupportedVersionException Creates a newTLcdWCSClient
with the given parameters.- Parameters:
aCapabilities
- the capabilities of the WCS serveraTransport
- the transport to use- Throws:
TLcdOWSDecodingException
- 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 client
-
TLcdWCSClient
protected TLcdWCSClient(URI aURI, ILcdOWSTransport aTransport, Object aTransportData) throws TLcdOWSDecodingException, TLcdOWSTransportException, TLcdOWSServerException, TLcdOWSUnsupportedVersionException Creates a newTLcdWCSClient
with the given parameters.- 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)- Throws:
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 client
-
-
Method Details
-
createWCSClient
public static TLcdWCSClient createWCSClient(URI aURI) throws TLcdOWSTransportException, TLcdOWSServerException, TLcdOWSDecodingException, TLcdOWSUnsupportedVersionException Creates a new WCS client using the specified URI. The WCS client will use the default transport (HTTP).- Parameters:
aURI
- the URI of the WCS server- Returns:
- a new WCS client
- Throws:
NullPointerException
- 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 client- See Also:
-
createWCSClient
public static TLcdWCSClient createWCSClient(TLcdWCSCapabilities aCapabilities, ILcdOWSTransport aTransport) throws TLcdOWSUnsupportedVersionException, TLcdOWSDecodingException, TLcdOWSServerException, TLcdOWSTransportException Creates a new WCS client using the specified capabilities. The WCS client will use the specified transport. If the version number of the capabilities is supported, a WCS client is initiated with the given capabilities. If the version number is not supported, this method performs the version negotiation process described in the WCS specification. The WCS client returned by this method is guaranteed to be compatible with the WCS version supported by the WCS server. server.- Parameters:
aCapabilities
- the capabilities of the WCS serveraTransport
- the transport to use- Returns:
- a new WCS client
- Throws:
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 client
-
createWCSClient
public static TLcdWCSClient createWCSClient(URI aURI, ILcdOWSTransport aTransport, Object aTransportData) throws TLcdOWSUnsupportedVersionException, TLcdOWSDecodingException, TLcdOWSServerException, TLcdOWSTransportException Creates a new WCS client using the specified URI. The WCS client will use the specified transport. This method will retrieve the capabilities description from the WCS server at the specified URI. Depending on the response of the WCS server this method will then perform the version negotiation process described in the WCS specification. These initial capabilities requests will use the specified transport data, if not null. Transport data can for example be used to supply authentication information, if required by the server. The WCS client returned by this method is guaranteed to be compatible with the WCS version supported by the WCS server.- 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)- Returns:
- a new WCS client
- Throws:
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 client
-
getURI
Returns the URI of the WCS server. If no URI was specified at construction, the URI is determined from the capabilities: as each OGC Web Service should support aGetCapabilities
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.- Returns:
- the URI of the WCS server.
-
getOperation
Retrieves an operation based on the operation name.- Parameters:
aOperationName
- the name of the operation- Returns:
- the operation or null if the requested operation is not supported by the WCS server
-
decodeOperations
Returns a list of TLcdOWSOperation instances based on the contents of the provided TLcdWCSCapabilities instance. By default, this method will return a list of operations that are read from the 'Capability/Request' section of the WCS capabilities object.- Parameters:
aCapabilities
- the capabilities from which to derive the list of operations- Returns:
- a list of TLcdOWSOperation instances or an empty list if no operations are available
-
createGetCapabilitiesRequest
Creates a new 'GetCapabilities' request object which is compatible with the WCS version implemented by the WCS server this client communicates with.- Returns:
- a new 'GetCapabilities' request
-
createDescribeCoverageRequest
Creates a new 'DescribeCoverage' request object which is compatible with the WCS version implemented by the WCS server this client communicates with.- Returns:
- a new 'DescribeCoverage' request
-
createGetCoverageRequest
Creates a new 'GetCoverage' request object which is compatible with the WCS version implemented by the WCS server this client communicates with.- Returns:
- a new 'GetCoverage' request
-
getCachedCapabilities
Returns the most recent capabilities object that was requested by this client. The client will update the capabilities when it is first created and every timegetCapabilities(TLcdWCSGetCapabilitiesRequest)
is called.- Returns:
- the capabilities of the WCS service
-
getCapabilities
public TLcdWCSCapabilities getCapabilities(TLcdWCSGetCapabilitiesRequest aRequest) throws TLcdOWSServerException, TLcdOWSDecodingException, TLcdOWSTransportException, TLcdOWSUnsupportedVersionException Performs the 'GetCapabilities' request.- Parameters:
aRequest
- the request object containing the parameters to pass to the WCS server- Returns:
- the capabilities of the WCS service
- Throws:
TLcdOWSServerException
- 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 client
-
describeCoverage
public TLcdWCSCoverageDescription describeCoverage(TLcdWCSDescribeCoverageRequest aRequest) throws TLcdOWSServerException, TLcdOWSDecodingException, TLcdOWSTransportException Performs the 'DescribeCoverage' request.- Parameters:
aRequest
- the request object containing the parameters to pass to the WCS server- Returns:
- a description of the coverages specified in the request object
- Throws:
TLcdOWSServerException
- 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 service
-
getCoverage
public TLcdOWSInputStream getCoverage(TLcdWCSGetCoverageRequest aRequest) throws TLcdOWSServerException, TLcdOWSDecodingException, TLcdOWSTransportException Performs the 'GetCoverage' request.- Parameters:
aRequest
- the request object containing the parameters to pass to the WCS server- Returns:
- an inputstream containing the data returned by the WCS server
- Throws:
TLcdOWSServerException
- 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 service
-
performRequest
protected final TLcdOWSInputStream performRequest(String aOperationName, ILcdOWSRequest aRequest) throws TLcdOWSTransportException, TLcdOWSServerException, TLcdOWSDecodingException Performs a WCS request.- Parameters:
aOperationName
- the name of the operation to invokeaRequest
- the request object that should be sent- Returns:
- the response input stream
- Throws:
TLcdOWSServerException
- 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
-
toString
-