|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.deegree.services.controller.AbstractOWS
public abstract class AbstractOWS
Each concrete extension of this class is responsible for handling requests to a specific OGC web service (WPS, WMS, WFS, CSW,...).
OGCFrontController
,
ImplementationMetadata
Field Summary | |
---|---|
protected DeegreeServiceControllerType |
mainControllerConf
|
protected DeegreeServicesMetadataType |
mainMetadataConf
Common configuration (metadata) of parent OGCFrontController . |
protected SortedSet<Version> |
offeredVersions
Versions offered by the AbstractOWS instance (depends on configuration). |
protected ImplementationMetadata<?> |
serviceInfo
|
protected DeegreeWorkspace |
workspace
|
Constructor Summary | |
---|---|
protected |
AbstractOWS(URL configURL,
ImplementationMetadata<?> serviceInfo)
|
Method Summary | ||
---|---|---|
protected void |
beginSOAPResponse(HttpResponseBuffer response)
Convenience method that may be used by controller implementations to produce OGC-SOAP responses. |
|
protected void |
checkConfigVersion(String confFileURL,
String configVersionString)
|
|
protected Version |
checkVersion(Version requestedVersion)
Checks if a request version can be handled by this controller (i.e. if is supported by the implementation *and* offered by the current configuration). |
|
void |
doSOAP(org.apache.axiom.soap.SOAPEnvelope soapDoc,
javax.servlet.http.HttpServletRequest request,
HttpResponseBuffer response,
List<org.apache.commons.fileupload.FileItem> multiParts,
org.apache.axiom.soap.SOAPFactory factory)
Called by the OGCFrontController to allow this AbstractOGCServiceController to handle a SOAP
request. |
|
protected void |
endSOAPResponse(HttpResponseBuffer response)
Finishes an OGC-SOAP response that has been initiated by beginSOAPResponse(HttpResponseBuffer) . |
|
Pair<XMLExceptionSerializer<OWSException>,String> |
getExceptionSerializer(Version requestVersion)
Returns the ExceptionSerializer and mime-type suitable for the given request version. |
|
Set<String> |
getHandledNamespaces()
Returns all namespaces that are handled by this controller. |
|
Set<String> |
getHandledRequests()
Returns the names of all requests that are handled by this controller. |
|
ImplementationMetadata<?> |
getImplementationMetadata()
|
|
List<String> |
getOfferedVersions()
Returns the offered protocol versions. |
|
String |
getOfferedVersionsString()
Returns the offered protocol versions. |
|
protected void |
init(DeegreeServicesMetadataType mainMetadataConf,
DeegreeServiceControllerType mainControllerConf,
ImplementationMetadata<?> serviceInformation,
XMLAdapter controllerConfig)
Initializes the AbstractOWS instance. |
|
void |
init(DeegreeWorkspace workspace)
Usually called by the ResourceManager upon workspace startup. |
|
protected Version |
negotiateVersion(GetCapabilities request)
Generic version negotiation algorithm for GetCapabilities requests according to OWS Common Specification
1.1.0 (OGC 06-121r3), section 7.3.2 and D.11. |
|
|
sendException(String contentType,
String encoding,
Map<String,String> additionalHeaders,
int httpStatusCode,
ExceptionSerializer<E> serializer,
E exception,
javax.servlet.http.HttpServletResponse response)
|
|
static
|
sendException(String contentType,
String encoding,
Map<String,String> additionalHeaders,
int httpStatusCode,
ExceptionSerializer<E> serializer,
ImplementationMetadata<?> md,
E exception,
javax.servlet.http.HttpServletResponse response)
Sends an exception to the client. |
|
void |
sendSOAPException(org.apache.axiom.soap.SOAPHeader header,
org.apache.axiom.soap.SOAPFactory factory,
HttpResponseBuffer response,
OWSException exception,
XMLExceptionSerializer<OWSException> serializer,
String SOAPFaultCode,
String SOAPMessage,
String SOAPaction,
String characterEncoding)
Encapsulates the given OWSException into a SOAP environment for which the given factory will be used. |
|
protected ServiceIdentificationType |
synchronizeServiceIdentificationWithMainController(ServiceIdentificationType serviceIdentification)
|
|
protected ServiceProviderType |
synchronizeServiceProviderWithMainControllerConf(ServiceProviderType configuredServiceProvider)
|
|
protected Object |
unmarshallConfig(String jaxbPackage,
String schemaLocation,
org.apache.axiom.om.OMElement element)
|
|
protected Object |
unmarshallConfig(String jaxbPackage,
String schemaLocation,
XMLAdapter xmlAdapter)
|
|
protected void |
validateAndSetOfferedVersions(Collection<String> requestedVersions)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.deegree.services.OWS |
---|
doKVP, doXML |
Methods inherited from interface org.deegree.commons.config.Resource |
---|
destroy |
Field Detail |
---|
protected DeegreeServicesMetadataType mainMetadataConf
OGCFrontController
.
protected DeegreeServiceControllerType mainControllerConf
protected SortedSet<Version> offeredVersions
AbstractOWS
instance (depends on configuration).
Versions are sorted from lowest to highest in order to support the (old-style) version negotiation algorithm.
protected DeegreeWorkspace workspace
protected ImplementationMetadata<?> serviceInfo
Constructor Detail |
---|
protected AbstractOWS(URL configURL, ImplementationMetadata<?> serviceInfo)
Method Detail |
---|
public void init(DeegreeWorkspace workspace) throws ResourceInitException
Resource
ResourceManager
upon workspace startup.
init
in interface Resource
workspace
- the workspace the resource belongs to, may be null
ResourceInitException
public ImplementationMetadata<?> getImplementationMetadata()
getImplementationMetadata
in interface OWS
protected void init(DeegreeServicesMetadataType mainMetadataConf, DeegreeServiceControllerType mainControllerConf, ImplementationMetadata<?> serviceInformation, XMLAdapter controllerConfig) throws ResourceInitException
AbstractOWS
instance.
mainMetadataConf
- serviceInformation
- controllerConfig
- controller configuration, must not be null
ControllerInitException
- if the config version does not match one of the supported versions
ResourceInitException
public final Set<String> getHandledRequests()
public final Set<String> getHandledNamespaces()
protected final void validateAndSetOfferedVersions(Collection<String> requestedVersions) throws ResourceInitException
requestedVersions
-
ResourceInitException
public void doSOAP(org.apache.axiom.soap.SOAPEnvelope soapDoc, javax.servlet.http.HttpServletRequest request, HttpResponseBuffer response, List<org.apache.commons.fileupload.FileItem> multiParts, org.apache.axiom.soap.SOAPFactory factory) throws javax.servlet.ServletException, IOException, SecurityException
OGCFrontController
to allow this AbstractOGCServiceController
to handle a SOAP
request.
doSOAP
in interface OWS
soapDoc
- XMLAdapter
for parsing the SOAP request documentrequest
- provides access to all information of the original HTTP request (NOTE: may be GET or POST)response
- response that is sent to the clientmultiParts
- A list of multiparts contained in the request. If the request was not a multipart request the list
will be null
. If multiparts were found, the requestDoc will be the first (xml-lized)
FileItem
in the list.factory
- initialized to the soap version of the request.
javax.servlet.ServletException
IOException
- if an IOException occurred
SecurityException
protected void beginSOAPResponse(HttpResponseBuffer response) throws XMLStreamException, IOException
Performs the following actions using the given HttpResponseBuffer
:
application/soap+xml
soapenv:Envelope
and soapenv:Body
elements
After calling this method, the controller may simply write the normal OGC-XML response using the
HttpResponseBuffer.getXMLWriter()
object and call endSOAPResponse(HttpResponseBuffer)
afterwards.
response
-
XMLStreamException
IOException
endSOAPResponse(HttpResponseBuffer)
protected void endSOAPResponse(HttpResponseBuffer response) throws IOException, XMLStreamException
beginSOAPResponse(HttpResponseBuffer)
.
response
-
IOException
XMLStreamException
beginSOAPResponse(HttpResponseBuffer)
protected Version checkVersion(Version requestedVersion) throws OWSException
NOTE: This method does use exception code OWSException.INVALID_PARAMETER_VALUE
, not
OWSException.VERSION_NEGOTIATION_FAILED
-- the latter should only be used for failed GetCapabilities
requests.
requestedVersion
- version to be checked, may be null (causes exception)
requestedVersion
(if it is not null), or highest version supported
OWSException
- if the requested version is not availablepublic String getOfferedVersionsString()
public List<String> getOfferedVersions()
protected void checkConfigVersion(String confFileURL, String configVersionString) throws ResourceInitException
confFileURL
- configVersionString
-
ResourceInitException
protected Object unmarshallConfig(String jaxbPackage, String schemaLocation, org.apache.axiom.om.OMElement element) throws ResourceInitException
ResourceInitException
protected Object unmarshallConfig(String jaxbPackage, String schemaLocation, XMLAdapter xmlAdapter) throws ResourceInitException
ResourceInitException
protected Version negotiateVersion(GetCapabilities request) throws OWSException
GetCapabilities
requests according to OWS Common Specification
1.1.0 (OGC 06-121r3), section 7.3.2 and D.11.
request
- GetCapabilities
request
OWSException
- if new-style version negotiation is used and no common version existspublic <E extends OWSException> void sendException(String contentType, String encoding, Map<String,String> additionalHeaders, int httpStatusCode, ExceptionSerializer<E> serializer, E exception, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException
javax.servlet.ServletException
public static <E extends OWSException> void sendException(String contentType, String encoding, Map<String,String> additionalHeaders, int httpStatusCode, ExceptionSerializer<E> serializer, ImplementationMetadata<?> md, E exception, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException
E
- the type of the Exception, which should be subtype of controller exceptioncontentType
- of the exception responseencoding
- of the exception responseadditionalHeaders
- to add to the response.httpStatusCode
- of the exception responseserializer
- responsible for creating the appropriate response format of the exception. Could be overridden by a
matching SerializerProvider
on the classpath.exception
- the cause, holding relevant information.response
- to write to.
javax.servlet.ServletException
- if the exception could not be sent.public void sendSOAPException(org.apache.axiom.soap.SOAPHeader header, org.apache.axiom.soap.SOAPFactory factory, HttpResponseBuffer response, OWSException exception, XMLExceptionSerializer<OWSException> serializer, String SOAPFaultCode, String SOAPMessage, String SOAPaction, String characterEncoding) throws javax.servlet.ServletException
OWSException
into a SOAP environment for which the given factory will be used.
header
- SOAPheaders to be set in the envelope, if missing no headers will be set.factory
- to create the soap elements.response
- to write to.exception
- to write in the 'fault/detail' sectionserializer
- to use for writing the OWSException
.SOAPFaultCode
- optional (see SOAPException
for valid once. If missing SOAPException.SENDER
will be
used.SOAPMessage
- optional message to explicitly set. If missing the owsException message will be used.SOAPaction
- to set, optional.characterEncoding
- of the response.
javax.servlet.ServletException
protected ServiceProviderType synchronizeServiceProviderWithMainControllerConf(ServiceProviderType configuredServiceProvider)
configuredServiceProvider
- to be synchronized with the main configuration
protected ServiceIdentificationType synchronizeServiceIdentificationWithMainController(ServiceIdentificationType serviceIdentification)
serviceIdentification
- to be synchronized with the configuration of the main controller.
public Pair<XMLExceptionSerializer<OWSException>,String> getExceptionSerializer(Version requestVersion)
ExceptionSerializer
and mime-type suitable for the given request version.
getExceptionSerializer
in interface OWS
requestVersion
- version of the request for which the exception has to be produced, may be null
(implies
that the serializer and mime type for the highest supported version shall be returned)
null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |