org.deegree_impl.services.wcas
Class WCASService_Impl

java.lang.Object
  extended byorg.deegree_impl.services.OGCWebService_Impl
      extended byorg.deegree_impl.services.wcas.WCASService_Impl
All Implemented Interfaces:
java.util.EventListener, Handler, OGCWebService

public class WCASService_Impl
extends OGCWebService_Impl
implements Handler

A WCAS implementns the WCASService interface to act like a OGC web service. This means that a WCAS is callable through the doService-method defined at OGCWebService.

Because the WCASService_Impl acts as proxy he also implements the OGCWebServiceClient interface to receive the response(s) from the WFS's he had called. So the WCAS is nothing else than a client to a WFS.

-----------------------------------------------------

Version:
$Revision: 1.27 $ $Date: 2004/03/16 08:07:25 $

Author:
Andreas Poth

Field Summary
private  WCASCapabilities capa
           
private  OGCWebServiceClient dest
           
private  Handler dispatcher
           
private  int expectedResponses
           
private  OGCWebServiceRequest inRequest
           
private  int reqType
           
private  OGCWebServiceRequest[] requests
           
private  java.util.ArrayList results
           
 
Fields inherited from class org.deegree_impl.services.OGCWebService_Impl
capabilities
 
Constructor Summary
WCASService_Impl(WCASCapabilities capa)
          constructor
 
Method Summary
 void doService(OGCWebServiceEvent event)
          implements the doService method inherited from the OGCWebService interface.
 OGCWebServiceResponse doService(OGCWebServiceRequest request)
          the method performs the handling of the passed OGCWebServiceEvent directly and returns the result to the calling class/method
private  void handleDescribeRecordTypeResponse()
          handles the creation and send of a describeRecordType response back to the client
private  void handleGetCapabilities(CASGetCapabilitiesRequest request)
          handles a get capabilities request by reading the capabilities document from its source.
private  void handleGetCapabilitiesResponse()
          handles the response to a GetCapabilities request
private  void handleGetRecordResponse()
          handles the creation and send of a getRecord response back to the client
private  void handleRegisterServiceResponse()
          handles the creation and send of a registerService response back to the client
 void handleRequest(OGCWebServiceEvent event)
          handles a request against an OGC web service
 void handleResponse(OGCWebServiceEvent event)
          handles the response of an OGC web service
private  void handleTransactionResponse()
          handles the creation and send of a transaction response back to the client
 boolean isInterested(OGCWebServiceEvent event)
          returns true if the handler is interested in a event
private  void performCascadeGetRecord(CASGetRecordRequest request)
          performs getRecord requests against all known federated catalogs.
 void registerHandler(Handler handler)
          registers a Handler so this Handler is able to act as a proxy to the registered handler
 void removeHandler(Handler handler)
          removes a registered handler from the service
private  OGCWebServiceEvent[] transformDescribeRecordType(CASDescribeRecordTypeRequest request)
          transforms a describeRecordType request to one describeFeatureType request and encapsulates it into one OGCWebServiceEvent
private  OGCWebServiceEvent[] transformGetRecord(CASGetRecordRequest request)
          transforms a getRecord request to one or more getFeature requests and encapsulates them into one or more OGCWebServiceEvents
private  OGCWebServiceEvent[] transformRegisterService(CASRegisterServiceRequest request)
          performs a registerService request. this will be done by requesting the service describing XML document from the specified address and transforming it into one or more (WFS) transaction requests encapsulated into one or more OGCWebServiceEvents.
private  OGCWebServiceEvent[] transformToWFSRequest(OGCWebServiceRequest request)
          transforms a CASRequest to one or more WFS requests
private  OGCWebServiceEvent[] transformTransaction(CASTransactionRequest request)
          transforms a (WCAS) transaction request to one (WFS) transaction request and encapsulates it into one OGCWebServiceEvent
 
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

results

private java.util.ArrayList results

dispatcher

private Handler dispatcher

dest

private OGCWebServiceClient dest

inRequest

private OGCWebServiceRequest inRequest

capa

private WCASCapabilities capa

requests

private OGCWebServiceRequest[] requests

expectedResponses

private int expectedResponses

reqType

private int reqType
Constructor Detail

WCASService_Impl

public WCASService_Impl(WCASCapabilities capa)
constructor

Parameters:
capa - catalog capabilities catalog
Method Detail

doService

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

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

doService

public OGCWebServiceResponse doService(OGCWebServiceRequest request)
                                throws WebServiceException
the method performs the handling of the passed OGCWebServiceEvent directly and returns the result to the calling class/method

Specified by:
doService in interface OGCWebService
Parameters:
request - request (WMS, WCS, WFS, WCAS, WCTS, WTS, Gazetter) to perform
Throws:
WebServiceException

handleGetRecordResponse

private void handleGetRecordResponse()
                              throws java.lang.Exception
handles the creation and send of a getRecord response back to the client

Throws:
java.lang.Exception

handleDescribeRecordTypeResponse

private void handleDescribeRecordTypeResponse()
handles the creation and send of a describeRecordType response back to the client


handleTransactionResponse

private void handleTransactionResponse()
handles the creation and send of a transaction response back to the client


handleRegisterServiceResponse

private void handleRegisterServiceResponse()
handles the creation and send of a registerService response back to the client


handleGetCapabilitiesResponse

private void handleGetCapabilitiesResponse()
handles the response to a GetCapabilities request


transformToWFSRequest

private OGCWebServiceEvent[] transformToWFSRequest(OGCWebServiceRequest request)
                                            throws java.lang.Exception
transforms a CASRequest to one or more WFS requests

Throws:
java.lang.Exception

transformGetRecord

private OGCWebServiceEvent[] transformGetRecord(CASGetRecordRequest request)
                                         throws java.lang.Exception
transforms a getRecord request to one or more getFeature requests and encapsulates them into one or more OGCWebServiceEvents

Throws:
java.lang.Exception

transformDescribeRecordType

private OGCWebServiceEvent[] transformDescribeRecordType(CASDescribeRecordTypeRequest request)
transforms a describeRecordType request to one describeFeatureType request and encapsulates it into one OGCWebServiceEvent


transformTransaction

private OGCWebServiceEvent[] transformTransaction(CASTransactionRequest request)
transforms a (WCAS) transaction request to one (WFS) transaction request and encapsulates it into one OGCWebServiceEvent


transformRegisterService

private OGCWebServiceEvent[] transformRegisterService(CASRegisterServiceRequest request)
                                               throws java.lang.Exception
performs a registerService request. this will be done by requesting the service describing XML document from the specified address and transforming it into one or more (WFS) transaction requests encapsulated into one or more OGCWebServiceEvents.

Throws:
java.lang.Exception

handleGetCapabilities

private void handleGetCapabilities(CASGetCapabilitiesRequest request)
handles a get capabilities request by reading the capabilities document from its source.


performCascadeGetRecord

private void performCascadeGetRecord(CASGetRecordRequest request)
                              throws java.lang.Exception
performs getRecord requests against all known federated catalogs.

Throws:
java.lang.Exception

handleRequest

public void handleRequest(OGCWebServiceEvent event)
handles a request against an OGC web service

Specified by:
handleRequest in interface Handler
Parameters:
event - event object that contains the request to be performed

handleResponse

public void handleResponse(OGCWebServiceEvent event)
handles the response of an OGC web service

Specified by:
handleResponse in interface Handler
Parameters:
event - event oject that contains the response to a request

isInterested

public boolean isInterested(OGCWebServiceEvent event)
returns true if the handler is interested in a event

Specified by:
isInterested in interface Handler
Parameters:
event - event object that contains a request or response to a request
Returns:
true if the service is interested in handling the request/response contained within the event object

registerHandler

public void registerHandler(Handler handler)
registers a Handler so this Handler is able to act as a proxy to the registered handler

Specified by:
registerHandler in interface Handler
Parameters:
handler - handler to be registered to the service

removeHandler

public void removeHandler(Handler handler)
removes a registered handler from the service

Specified by:
removeHandler in interface Handler
Parameters:
handler - handler to be removed from the service
See Also:
registerHandler(Handler)