private WPSRequestType getRequestTypeByName( String requestName ) throws OWSException { WPSRequestType requestType = null; try { requestType = (WPSRequestType) ( (ImplementationMetadata) ( (OWSProvider) metadata.getProvider() ).getImplementationMetadata() ).getRequestTypeByName( requestName ); } catch ( IllegalArgumentException e ) { throw new OWSException( e.getMessage(), OPERATION_NOT_SUPPORTED ); } return requestType; }
private WCSRequestType getRequestType( Map<String, String> param ) throws OWSException { try { String requestName = KVPUtils.getRequired( param, "REQUEST" ); return WCSProvider.IMPLEMENTATION_METADATA.getRequestTypeByName( requestName ); } catch ( MissingParameterException e ) { throw new OWSException( e.getMessage(), OWSException.MISSING_PARAMETER_VALUE ); } }
/** * Method for mapping the request operation to the implemented operations located in {@link CSWConstants} * * @param requestName * @return CSWRequestType * @throws OWSException */ private CSWRequestType getRequestType( String requestName ) throws OWSException { CSWRequestType requestType = null; try { requestType = (CSWRequestType) ( (ImplementationMetadata) ( (OWSProvider) getMetadata().getProvider() ).getImplementationMetadata() ).getRequestTypeByName( requestName ); } catch ( IllegalArgumentException e ) { throw new OWSException( e.getMessage(), OWSException.OPERATION_NOT_SUPPORTED ); } return requestType; }
private WFSRequestType getRequestTypeByName( String requestName ) throws OWSException { ImplementationMetadata<?> md = ( (OWSProvider) getMetadata().getProvider() ).getImplementationMetadata(); WFSRequestType requestType = (WFSRequestType) md.getRequestTypeByName( requestName ); if ( requestType == null ) { String msg = "Request type '" + requestName + "' is not supported."; throw new OWSException( msg, OWSException.OPERATION_NOT_SUPPORTED, "request" ); } return requestType; }
req = (WMTSRequestType) ( (ImplementationMetadata) serviceInfo ).getRequestTypeByName( map.get( "REQUEST" ) ); } catch ( IllegalArgumentException e ) { sendException( new OWSException( "'" + map.get( "REQUEST" ) + "' is not a supported WMTS operation.",
String requestName = map.get( "REQUEST" ); try { req = (WMSRequestType) ( (ImplementationMetadata<?>) ( (OWSProvider) getMetadata().getProvider() ).getImplementationMetadata() ).getRequestTypeByName( requestName ); } catch ( IllegalArgumentException e ) { controllers.get( version ).sendException( new OWSException( get( "WMS.OPERATION_NOT_KNOWN", requestName ),
private void checkRequiredKeys( Map<String, String> param ) throws OWSException { try { ImplementationMetadata<?> imd = ( (OWSProvider) getMetadata().getProvider() ).getImplementationMetadata(); String service = KVPUtils.getRequired( param, "SERVICE" ); if ( !"WCS".equalsIgnoreCase( service ) ) { throw new OWSException( "SERVICE " + service + " is not supported", OWSException.INVALID_PARAMETER_VALUE, "SERVICE" ); } String request = KVPUtils.getRequired( param, "REQUEST" ); if ( !imd.getHandledRequests().contains( request ) ) { throw new OWSException( "REQUEST " + request + " is not supported", OWSException.OPERATION_NOT_SUPPORTED, "REQUEST" ); } String version; if ( imd.getRequestTypeByName( request ) != WCSRequestType.GetCapabilities ) { // no version required version = KVPUtils.getRequired( param, "VERSION" ); if ( version != null && !offeredVersions.contains( Version.parseVersion( version ) ) ) { throw new OWSException( "VERSION " + version + " is not supported", OWSException.VERSION_NEGOTIATION_FAILED, "VERSION" ); } } } catch ( MissingParameterException e ) { throw new OWSException( e.getMessage(), OWSException.MISSING_PARAMETER_VALUE ); } }
return; mappedRequest = (WPVSRequestType) ( (ImplementationMetadata) ( (OWSProvider) metadata.getProvider() ).getImplementationMetadata() ).getRequestTypeByName( requestName );
@Override public void doXML( XMLStreamReader xmlStream, HttpServletRequest request, HttpResponseBuffer response, List<FileItem> multiParts ) throws ServletException, IOException { try { XMLAdapter requestDoc = new XMLAdapter( xmlStream ); OMElement rootElement = requestDoc.getRootElement(); String rootName = rootElement.getLocalName(); switch ( IMPLEMENTATION_METADATA.getRequestTypeByName( rootName ) ) { case GetCapabilities: GetCapabilities100XMLAdapter capa = new GetCapabilities100XMLAdapter( rootElement ); doGetCapabilities( capa.parse(), request, response ); break; case DescribeCoverage: DescribeCoverage100XMLAdapter describe = new DescribeCoverage100XMLAdapter( rootElement ); doDescribeCoverage( describe.parse(), response ); break; case GetCoverage: GetCoverage100XMLAdapter getCoverage = new GetCoverage100XMLAdapter( rootElement ); doGetCoverage( getCoverage.parse(), response ); break; } } catch ( OWSException ex ) { sendServiceException( ex, response ); } catch ( Throwable e ) { sendServiceException( new OWSException( "an error occured while processing a request", NO_APPLICABLE_CODE ), response ); } }