|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.geotools.data.ows.AbstractOpenWebService<C,R>
public abstract class AbstractOpenWebService<C extends Capabilities,R>
This abstract class provides a building block for one to implement an Open Web Service (OWS) client. Each OWS is usually defined by an OGC specification, available at http://www.opengeospatial.org. This class provides version negotiation, Capabilities document retrieval, and a request/response infrastructure. Implementing subclasses need to provide their own Specifications (representing versions of the OWS to be implemented) and their own request/response instances.
Field Summary | |
---|---|
protected C |
capabilities
|
protected ServiceInfo |
info
|
protected int |
requestTimeout
Define a interval to wait a server response |
protected java.util.Map<R,ResourceInfo> |
resourceInfo
|
protected java.net.URL |
serverURL
|
protected Specification |
specification
|
protected Specification[] |
specs
Contains the specifications that are to be used with this service |
Constructor Summary | |
---|---|
AbstractOpenWebService(C capabilties,
java.net.URL serverURL)
|
|
AbstractOpenWebService(java.net.URL serverURL)
Set up the specifications used and retrieve the Capabilities document given by serverURL. |
|
AbstractOpenWebService(java.net.URL serverURL,
int requestTimeout)
|
Method Summary | |
---|---|
protected abstract ServiceInfo |
createInfo()
Implemented by a subclass to describe service |
protected abstract ResourceInfo |
createInfo(R resource)
|
ServiceInfo |
getInfo()
Description of this service. |
ResourceInfo |
getInfo(R resource)
|
protected Response |
internalIssueRequest(Request request)
Issues a request to the server and returns that server's response. |
GetCapabilitiesResponse |
issueRequest(GetCapabilitiesRequest request)
|
protected C |
negotiateVersion()
Version number negotiation occurs as follows (credit OGC): 1) If the server implements the requested version number, the server shall send that version. 2a) If a version unknown to the server is requested, the server shall send the highest version less than the requested version. 2b) If the client request is for a version lower than any of those known to the server, then the server shall send the lowest version it knows. 3a) If the client does not understand the new version number sent by the server, it may either cease communicating with the server or send a new request with a new version number that the client does understand but which is less than that sent by the server (if the server had responded with a lower version). 3b) If the server had responded with a higher version (because the request was for a version lower than any known to the server), and the client does not understand the proposed higher version, then the client may send a new request with a version number higher than that sent by the server. |
void |
setLoggingLevel(java.util.logging.Level newLevel)
|
protected abstract void |
setupSpecifications()
Sets up the specifications/versions that this server is capable of communicating with. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int requestTimeout
protected final java.net.URL serverURL
protected C extends Capabilities capabilities
protected ServiceInfo info
protected java.util.Map<R,ResourceInfo> resourceInfo
protected Specification[] specs
protected Specification specification
Constructor Detail |
---|
public AbstractOpenWebService(java.net.URL serverURL) throws java.io.IOException, ServiceException
serverURL
- a URL that points to the capabilities document of a server
java.io.IOException
- if there is an error communicating with the server
ServiceException
- if the server responds with an errorpublic AbstractOpenWebService(java.net.URL serverURL, int requestTimeout) throws java.io.IOException, ServiceException
java.io.IOException
ServiceException
public AbstractOpenWebService(C capabilties, java.net.URL serverURL)
Method Detail |
---|
public ServiceInfo getInfo()
Provides a very quick description of the service, for more information please review the capabilitie document.
protected abstract ServiceInfo createInfo()
public ResourceInfo getInfo(R resource)
protected abstract ResourceInfo createInfo(R resource)
protected abstract void setupSpecifications()
protected C negotiateVersion() throws java.io.IOException, ServiceException
Version number negotiation occurs as follows (credit OGC):
The OGC tells us to repeat this process (or give up). This means we are actually going to come up with a bit of setup cost in figuring out our GetCapabilities request. This means that it is possible that we may make multiple requests before being satisfied with a response. Also, if we are unable to parse a given version for some reason, for example, malformed XML, we will request a lower version until we have run out of versions to request with. Thus, a server that does not play nicely may take some time to parse and might not even succeed.
java.io.IOException
- if there is an error communicating with the server, or the XML cannot be parsed
ServiceException
- if the server returns a ServiceExceptionprotected Response internalIssueRequest(Request request) throws java.io.IOException, ServiceException
request
- the request to be issued
java.io.IOException
- if there was a problem communicating with the server
ServiceException
- if the server responds with an exception or returns bad contentpublic GetCapabilitiesResponse issueRequest(GetCapabilitiesRequest request) throws java.io.IOException, ServiceException
java.io.IOException
ServiceException
public void setLoggingLevel(java.util.logging.Level newLevel)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |