protected MetadataResultSet<?> getRecordById( GetRecordById getRecBI, MetadataStore<?> store, List<String> requestedIdList ) throws OWSException { if ( store != null ) { try { return store.getRecordById( requestedIdList, getRecBI.getTypeNames() ); } catch ( MetadataStoreException e ) { throw new OWSException( e.getMessage(), OWSException.NO_APPLICABLE_CODE ); } } return null; }
/** * Preprocessing for the export of a {@link DescribeRecord} request to determine which recordstore is requested. * * @param descRec * the parsed describeRecord request * @param response * for the servlet request to the client * @throws XMLStreamException * @throws IOException * @throws OWSException */ public void doDescribeRecord( DescribeRecord descRec, HttpResponseBuffer response, ServiceProfile profile ) throws XMLStreamException, IOException, OWSException { this.profile = profile; QName[] typeNames = descRec.getTypeNames(); Version version = descRec.getVersion(); response.setContentType( descRec.getOutputFormat() ); XMLStreamWriter xmlWriter = dcHelper.getXMLResponseWriter( response, null ); try { export( xmlWriter, typeNames, version ); } catch ( MetadataStoreException e ) { LOG.debug( e.getMessage() ); throw new OWSException( e.getMessage(), NO_APPLICABLE_CODE ); } xmlWriter.flush(); }
/** * Preprocessing for the export of a {@link GetRecords} request * * @param getRec * @param response * @throws XMLStreamException * @throws IOException * @throws SQLException * @throws OWSException */ public void doGetRecords( GetRecords getRec, HttpResponseBuffer response, MetadataStore<?> store ) throws XMLStreamException, IOException, OWSException { LOG.debug( "doGetRecords: " + getRec ); Version version = getRec.getVersion(); String outputFormat = getRec.getOutputFormat(); response.setContentType( outputFormat ); XMLStreamWriter xmlWriter = getXmlorJsonStreamWriter( outputFormat, response ); try { export( xmlWriter, getRec, version, store ); } catch ( OWSException e ) { LOG.debug( e.getMessage() ); throw new InvalidParameterValueException( e.getMessage() ); } catch ( MetadataStoreException e ) { LOG.debug( e.getMessage() ); throw new OWSException( e.getMessage(), NO_APPLICABLE_CODE ); } xmlWriter.flush(); }
/** * * Preprocessing for the export of a {@link Transaction} request * * @param trans * @param response * @throws XMLStreamException * @throws OWSException * @throws IOException */ public void doTransaction( Transaction trans, HttpResponseBuffer response, MetadataStore<?> store ) throws XMLStreamException, OWSException, IOException { LOG.debug( "doTransaction: " + trans ); Version version = trans.getVersion(); response.setContentType( "application/xml; charset=UTF-8" ); // to be sure of a valid response String schemaLocation = ""; if ( version.equals( VERSION_202 ) ) { schemaLocation = CSW_202_NS + " " + CSW_202_PUBLICATION_SCHEMA; } XMLStreamWriter xmlWriter = getXMLResponseWriter( response, schemaLocation ); try { doTransaction( xmlWriter, trans, version, store ); } catch ( MetadataStoreException e ) { throw new OWSException( e.getMessage(), OWSException.NO_APPLICABLE_CODE ); } xmlWriter.flush(); }
@Override public void doGetRecordById( GetRecordById getRecBI, HttpResponseBuffer response, MetadataStore<?> store, ServiceProfile profile ) throws XMLStreamException, IOException, InvalidParameterValueException, OWSException { this.profile = profile; LOG.debug( "doGetRecordById: " + getRecBI ); Version version = getRecBI.getVersion(); String outputFormat = getRecBI.getOutputFormat(); response.setContentType( outputFormat ); // to be sure of a valid response String schemaLocation = profile.getGetRecordByIdSchemaLocation( getRecBI.getVersion() ); XMLStreamWriter xmlWriter = getXmlorJsonStreamWriter( outputFormat, response, schemaLocation ); try { export( xmlWriter, getRecBI, version, store ); } catch ( OWSException e ) { LOG.debug( e.getMessage() ); throw new InvalidParameterValueException( e.getMessage() ); } catch ( MetadataStoreException e ) { throw new OWSException( e.getMessage(), NO_APPLICABLE_CODE ); } xmlWriter.flush(); }
trans = acquireTransaction(); } catch ( MetadataStoreException e ) { String msg = "Could not aquireTranacation to update the profile: " + e.getMessage(); LOG.debug( msg ); throw new ResourceInitException( msg, e ); String msg = "Could not update the profile: " + e.getMessage(); LOG.debug( msg ); try {
useLegacyPredicates = JDBCUtils.useLegayPostGISPredicates( conn, LOG ); } catch ( MetadataStoreException e ) { throw new ResourceInitException( e.getMessage(), e ); } finally { JDBCUtils.close( conn ); String msg = "Could not insert profile: " + e.getMessage(); LOG.debug( msg ); throw new ResourceInitException( msg, e );
LOG.debug( e.getMessage(), e ); throw new OWSException( e.getMessage(), OWSException.INVALID_PARAMETER_VALUE );