org.deegree_impl.services.gazetteer
Class GazetteerService_Impl

java.lang.Object
  extended byorg.deegree_impl.services.OGCWebService_Impl
      extended byorg.deegree_impl.services.gazetteer.GazetteerService_Impl
All Implemented Interfaces:
OGCWebService, OGCWebServiceClient

public class GazetteerService_Impl
extends OGCWebService_Impl
implements OGCWebServiceClient

This is the basic implementation for a OGC conform web coverage service within the deegree framework. A WCSService extends the OGCWebService interface to act like a OGC web service. This means that a WCS is callable through the doService -method inherited from OGCWebService.

Version:
$Revision: 1.21 $ $Date: 2004/04/02 06:41:56 $
Author:
Andreas Poth

Field Summary
private  OGCWebServiceEvent event
           
private  GazetteerResponseTree gazetteerresponsetree
           
private  int hierarchyLevels
           
private  java.lang.String[] propertyNames
           
private  java.lang.String relationType
           
 
Fields inherited from class org.deegree_impl.services.OGCWebService_Impl
capabilities
 
Constructor Summary
GazetteerService_Impl(WFSGCapabilities capabilities)
           
 
Method Summary
private  Node appendChild(java.lang.String id, SI_LocationType locType, Feature feature)
          appends a child node to the node identified by the passed ID
private  WFSGetFeatureRequest createGetFeatureRequest(java.lang.String id, java.lang.String featureType, Operation operation, java.lang.String wfsVersion)
          creates a GetFeature request for accessing the locationinstances of the next level.
private  Operation createOperation(GM_Object prop)
          creates the FilterEncoding operation formulating the relation between two location types for Geometry type properties
private  Operation createOperation(java.lang.Object prop)
          creates the FilterEncoding operation formulating the relation between two location types for none Geometry type properties
 void doService(OGCWebServiceEvent event)
          implements the doService method inherited from the OGCWebService_Impl class.
 OGCWebServiceResponse doService(OGCWebServiceRequest req)
          implements the doService method inherited from the OGCWebService_Impl class.
private  void finishGazetteerService()
           
private  void handleDescribeFeatureType(WFSGDescribeFeatureTypeRequest request)
           
private  void handleGetCapabilities(WFSGGetCapabilitiesRequest request)
           
private  void handleGetFeatureRequest(WFSGGetFeatureRequest request)
          creates and performs the initial GetFeature request
private  void handleGetFeatureResponse(OGCWebServiceEvent wse)
          handles a response to a GetFeature request by informing the controller about the received response and creating a list of new GetFeature requests for the next hierarchy level if the last hierarchy level hasn't been reached.
private  void initResponseTree(java.lang.String id, SI_LocationType locationtype)
          initializes the tree that manages all submitted requests and the responses to it.
 boolean isFinnished(Node node)
          traverses the tree in preorder starting at the passed node
private  void performGetFeatureRequest(WFSGetFeatureRequest request)
           
private  void performHierachyRequests(WFSGetFeatureResponse response, Node node)
          creates GetFeature requests to receive the locations instances for the next hierarchy level related to the passed response
private  void performWFSRequest(WFSGetFeatureResponse response, SI_LocationType locType)
          performs requests for accessing the location instances ofthe next narrower term corresponding to the current hierarchy level of the passed WFSGetFeatureRespose
private  Feature recreateFeature(Feature feature, java.lang.String[] propertyNames, boolean leaf)
          creates a new feature by adding a property named 'children' that will contain all children of the passed feature.
 void write(java.lang.Object result)
          Method from OGCWebServiceClient.
 
Methods inherited from class org.deegree_impl.services.OGCWebService_Impl
getCapabilities
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

event

private OGCWebServiceEvent event

hierarchyLevels

private int hierarchyLevels

relationType

private java.lang.String relationType

propertyNames

private java.lang.String[] propertyNames

gazetteerresponsetree

private GazetteerResponseTree gazetteerresponsetree
Constructor Detail

GazetteerService_Impl

public GazetteerService_Impl(WFSGCapabilities capabilities)
Parameters:
capabilities -
Method Detail

doService

public void doService(OGCWebServiceEvent event)
               throws WebServiceException
implements the doService method inherited from the OGCWebService_Impl class. The method receives a WFSG... request and delievers it to one or more WFS's

Specified by:
doService in interface OGCWebService
Parameters:
event - event object that contains the requests to be performed
Throws:
WebServiceException

doService

public OGCWebServiceResponse doService(OGCWebServiceRequest req)
implements the doService method inherited from the OGCWebService_Impl class. The method receives a WFSG... request and delievers it to one or more WFS's

Specified by:
doService in interface OGCWebService
Parameters:
req - requet to be performed

handleGetCapabilities

private void handleGetCapabilities(WFSGGetCapabilitiesRequest request)
                            throws WebServiceException
Parameters:
request -
Throws:
WebServiceException

handleDescribeFeatureType

private void handleDescribeFeatureType(WFSGDescribeFeatureTypeRequest request)
                                throws WebServiceException
Parameters:
request -
Throws:
WebServiceException

handleGetFeatureRequest

private void handleGetFeatureRequest(WFSGGetFeatureRequest request)
                              throws GazetteerException
creates and performs the initial GetFeature request

Parameters:
request -
Throws:
GazetteerException

initResponseTree

private void initResponseTree(java.lang.String id,
                              SI_LocationType locationtype)
initializes the tree that manages all submitted requests and the responses to it. Each request will form a node in the tree.

Parameters:
id - id of the root node
locationtype - type of the request assigned to the root node

performGetFeatureRequest

private void performGetFeatureRequest(WFSGetFeatureRequest request)
                               throws GazetteerException
Parameters:
request -
Throws:
GazetteerException

write

public void write(java.lang.Object result)
Method from OGCWebServiceClient. All responses to requests will be passed to this method

Specified by:
write in interface OGCWebServiceClient
Parameters:
result -

handleGetFeatureResponse

private void handleGetFeatureResponse(OGCWebServiceEvent wse)
handles a response to a GetFeature request by informing the controller about the received response and creating a list of new GetFeature requests for the next hierarchy level if the last hierarchy level hasn't been reached.

Parameters:
wse - OGCWebServiceEvent containing a WFSGetFeatureResponse

performHierachyRequests

private void performHierachyRequests(WFSGetFeatureResponse response,
                                     Node node)
                              throws GazetteerException
creates GetFeature requests to receive the locations instances for the next hierarchy level related to the passed response

Throws:
GazetteerException

performWFSRequest

private void performWFSRequest(WFSGetFeatureResponse response,
                               SI_LocationType locType)
                        throws GazetteerException
performs requests for accessing the location instances ofthe next narrower term corresponding to the current hierarchy level of the passed WFSGetFeatureRespose

Parameters:
response -
locType -
Throws:
GazetteerException

createOperation

private Operation createOperation(GM_Object prop)
                           throws GazetteerException
creates the FilterEncoding operation formulating the relation between two location types for Geometry type properties

Parameters:
prop - geometry property acting as literal of the operation
Returns:
Throws:
GazetteerException

createOperation

private Operation createOperation(java.lang.Object prop)
                           throws GazetteerException
creates the FilterEncoding operation formulating the relation between two location types for none Geometry type properties

Parameters:
prop - feature property acting as literal of the operation
Returns:
Throws:
GazetteerException

createGetFeatureRequest

private WFSGetFeatureRequest createGetFeatureRequest(java.lang.String id,
                                                     java.lang.String featureType,
                                                     Operation operation,
                                                     java.lang.String wfsVersion)
                                              throws GazetteerException
creates a GetFeature request for accessing the locationinstances of the next level.

Throws:
GazetteerException

appendChild

private Node appendChild(java.lang.String id,
                         SI_LocationType locType,
                         Feature feature)
appends a child node to the node identified by the passed ID

Parameters:
id - of the parent node
locType - location type of the requested instances
feature - feature assigned to the new node

recreateFeature

private Feature recreateFeature(Feature feature,
                                java.lang.String[] propertyNames,
                                boolean leaf)
creates a new feature by adding a property named 'children' that will contain all children of the passed feature. Also the geographicExtent property will be removed from the feature if not requested to be returned

Parameters:
feature - source feature to re-create
propertyNames - names of the properties to be consider

isFinnished

public boolean isFinnished(Node node)
traverses the tree in preorder starting at the passed node


finishGazetteerService

private void finishGazetteerService()