Package com.vividsolutions.wms
Class AbstractWMSRequest
- java.lang.Object
-
- com.vividsolutions.wms.AbstractWMSRequest
-
- All Implemented Interfaces:
WMSRequest
- Direct Known Subclasses:
BasicRequest,FeatureInfoRequest,MapRequest
public abstract class AbstractWMSRequest extends Object implements WMSRequest
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractWMSRequest(WMService service)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description HttpURLConnectiongetConnection()for implementations seeking to work with the connection to retrieve headers or such.ImagegetImage()Connect to the service and get an Image of the map.InputStreamgetInputStream()connect and retrieve response as inputStreamWMServicegetService()Gets the WMService that this object will make requests from.StringgetText()connect and retrieve response as textabstract URLgetURL()must be implemented according to the specific needsprotected HttpURLConnectionprepareConnection()unified way to create a url connection, may be overwritten and modifiedprotected StringreadConnection(HttpURLConnection con, long limit)protected StringreadToError(HttpURLConnection con)voidsetWMSVersion(String version)reset WMS version for requests to the underlying wms service
-
-
-
Field Detail
-
service
protected WMService service
-
version
protected String version
-
con
protected HttpURLConnection con
-
-
Constructor Detail
-
AbstractWMSRequest
protected AbstractWMSRequest(WMService service)
-
-
Method Detail
-
getService
public WMService getService()
Gets the WMService that this object will make requests from.- Specified by:
getServicein interfaceWMSRequest- Returns:
- the WMService that this object will make requests from
-
setWMSVersion
public void setWMSVersion(String version)
reset WMS version for requests to the underlying wms service- Specified by:
setWMSVersionin interfaceWMSRequest- Parameters:
version- the WMS version to be used
-
getURL
public abstract URL getURL() throws MalformedURLException
must be implemented according to the specific needs- Specified by:
getURLin interfaceWMSRequest- Returns:
- the URL of the WMS request
- Throws:
MalformedURLException
-
prepareConnection
protected HttpURLConnection prepareConnection() throws IOException
unified way to create a url connection, may be overwritten and modified- Returns:
- the HttpURLConnection to use for the request
- Throws:
IOException
-
getConnection
public HttpURLConnection getConnection() throws IOException
for implementations seeking to work with the connection to retrieve headers or such.- Specified by:
getConnectionin interfaceWMSRequest- Throws:
IOException
-
getImage
public Image getImage() throws IOException
Connect to the service and get an Image of the map.- Returns:
- the retrieved map Image
- Throws:
IOException
-
getInputStream
public InputStream getInputStream() throws IOException
connect and retrieve response as inputStream- Returns:
- the request response as an InputStream
- Throws:
IOException
-
getText
public String getText() throws IOException
connect and retrieve response as text- Returns:
- the request response as text
- Throws:
IOException
-
readToError
protected String readToError(HttpURLConnection con) throws IOException
- Throws:
IOException
-
readConnection
protected String readConnection(HttpURLConnection con, long limit) throws IOException
- Throws:
IOException
-
-