|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.esri.wms.client.RequestHandler
public abstract class RequestHandler
RequestHandler is an entry point to extend the WMS client API.
You can add RequestListener or ResponseListener to handler vendor specific parameters:
RequestHandler handler = RequestHandler.getDefaultInstance(); RequestListener l = new RequestListener() { public String createRequest(Service service, String request) { .... return request; } }; handler.setRequestListener(l); ServerConnection server = new ServerConnection("http://host/service",null,handler); String request = handler.createGetCapsRequest().toRequestString();
Field Summary | |
---|---|
protected static String |
http_conn_impl_class
|
static String |
HTTP_CONNECTION_FILE
|
protected HttpConnectionChannel |
httpConn
|
protected static String |
impl_class
The name of the implementation class. |
protected RequestListener |
reqListener
The Request Listener. |
protected List<ResponseListener> |
respListeners
The response listener list. |
Constructor Summary | |
---|---|
protected |
RequestHandler()
Instantiates an object of RequestHandler. |
protected |
RequestHandler(ServerConnection server)
Instantiates an object of RequestHandler. |
Method Summary | |
---|---|
void |
addCapabilitiesFormat(String format)
Adds a MIME type supported by the server. |
void |
addExceptionFormat(String format)
Adds a MIME type supported by the server. |
void |
addFeatureInfoFormat(String format)
Adds a MIME type supported by the server. |
boolean |
addListener(ResponseListener o)
Adds a ResponseListener to the handler. |
void |
addMapFormat(String format)
Adds a MIME type supported by the server. |
abstract GenericRequest |
createGetCapsRequest()
Creates a GetCapabilities request object. |
abstract GenericRequest |
createGetFeatureInfoRequest(Map map,
Point point,
String queryLayers,
int count,
String mime)
Creates a GetFeatureInfo request object from a Map object. |
abstract GenericRequest |
createGetMapRequest(Map map,
String format)
Creates a GetMap request object from a Map object. |
InputStream |
getCapabilities(String request)
Sends a GetCapabilities request. |
static RequestHandler |
getDefaultInstance()
Gets a default implementation instance. |
InputStream |
getFeatureInfo(String request)
Sends a GetFeatureInfo request. |
InputStream |
getMap(String request)
Sends a GetMap request. |
RequestListener |
getRequestListener()
Gets the request listener. |
abstract ServerConnection |
getServer()
Gets the server associated with the handler. |
protected InputStream |
issueRequest(String serviceURL,
String request)
Issues the request to the given URL+Request. |
abstract Map |
parseCapabilitiesResponse(InputStream in)
Parses out a Map object from the GetCapabilities response. |
abstract FeatureInfo |
parseFeatureInfoResponse(InputStream in)
Parses out a FeatureInfo object from the GetFeatureInfo response. |
void |
removeAllListeners()
Removes all of the response listeners from the handler. |
boolean |
removeListener(ResponseListener o)
Removes the given response listener from the handler. |
void |
setCapabilitiesServiceURL(String capabilitiesServiceURL)
Sets the URL of the GetCapabilities service. |
void |
setDefaultMapRef(SpatialReference defaultMapRef)
Set the default Map Spatial reference. |
void |
setFeatureInfoServiceURL(String featureInfoServiceURL)
Sets the URL of the GetFeatureInfo service. |
void |
setMapServiceURL(String mapServiceURL)
Sets the URL of the GetMap service. |
void |
setRequestListener(RequestListener o)
Sets the request listener. |
abstract void |
setServer(ServerConnection server)
Sets the server associated with the handler. |
void |
setServerAbstract(String serverAbstract)
Sets the server abstract information. |
void |
setServerName(String serverName)
Sets the name of the server. |
void |
setServerTitle(String serverTitle)
Sets the title of the server. |
void |
setServerVersion(String serverVersion)
Set the version of the communication. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String HTTP_CONNECTION_FILE
protected static String impl_class
protected List<ResponseListener> respListeners
protected RequestListener reqListener
protected HttpConnectionChannel httpConn
protected static String http_conn_impl_class
Constructor Detail |
---|
protected RequestHandler(ServerConnection server)
server
- the server to connect.protected RequestHandler()
Method Detail |
---|
public static RequestHandler getDefaultInstance()
public abstract ServerConnection getServer()
public abstract void setServer(ServerConnection server)
server
- public InputStream getCapabilities(String request) throws IOException
request
- e.g. REQUEST=GetCapabilities&VERSION=1.3.0&SERVICE=WMS
IOException
public InputStream getFeatureInfo(String request) throws IOException
request
- e.g.LAYERS=0,1,2,3,4,5,6&CRS=EPSG:4326&FORMAT=image/bmp&HEIGHT=300&REQUEST=GetMap&WIDTH=400&BBOX=-124.73%2C31.91%2C-109.99%2C42.96&STYLES=&VERSION=1.3.0
IOException
public InputStream getMap(String request) throws IOException
request
- e.g.
LAYERS=0,1,2,3,4,5,6&CRS=EPSG:4326&FORMAT=image/bmp&HEIGHT=300&REQUEST=GetMap&WIDTH=400&BBOX=31.911976%2C-124.73%2C42.96%2C-109.96&STYLES=&VERSION=1.3.0
IOException
protected InputStream issueRequest(String serviceURL, String request) throws IOException
serviceURL
- the server URL e.g. http://host:8399/arcgis/services/usa_n/MapServer/WMSServerrequest
- the request e.g. REQUEST=GetCapabilities&VERSION=1.3.0&SERVICE=WMS
IOException
public abstract GenericRequest createGetFeatureInfoRequest(Map map, Point point, String queryLayers, int count, String mime)
map
- the map to query.point
- the screen point.queryLayers
- the layer string delimited by comma.count
- Number of features about which to return information (default=1).mime
- Return format of feature information (MIME type).public abstract GenericRequest createGetMapRequest(Map map, String format)
format
- the format of the return map.public abstract GenericRequest createGetCapsRequest()
public abstract Map parseCapabilitiesResponse(InputStream in) throws ServiceException
in
- the response.
ServiceException
public abstract FeatureInfo parseFeatureInfoResponse(InputStream in) throws ServiceException
in
- the response.
ServiceException
public void addCapabilitiesFormat(String format)
public void addFeatureInfoFormat(String format)
public void addMapFormat(String format)
public void addExceptionFormat(String format)
public void setServerAbstract(String serverAbstract)
public void setServerName(String serverName)
public void setServerTitle(String serverTitle)
public void setServerVersion(String serverVersion)
public void setFeatureInfoServiceURL(String featureInfoServiceURL)
public void setMapServiceURL(String mapServiceURL)
public void setCapabilitiesServiceURL(String capabilitiesServiceURL)
public void setDefaultMapRef(SpatialReference defaultMapRef)
public boolean addListener(ResponseListener o)
public void removeAllListeners()
public boolean removeListener(ResponseListener o)
public void setRequestListener(RequestListener o)
public RequestListener getRequestListener()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |