Search in sources :

Example 1 with TransactionRequestConverter

use of org.codice.ddf.spatial.ogc.csw.catalog.converter.TransactionRequestConverter in project ddf by codice.

the class TransactionMessageBodyReader method readFrom.

@Override
public CswTransactionRequest readFrom(Class<CswTransactionRequest> aClass, Type type, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> multivaluedMap, InputStream inputStream) throws IOException, WebApplicationException {
    XStream xStream = new XStream(new Xpp3Driver());
    TransactionRequestConverter transactionRequestConverter = new TransactionRequestConverter(cswRecordConverter, registry);
    transactionRequestConverter.setCswRecordConverter(new CswRecordConverter(metacardType));
    xStream.registerConverter(transactionRequestConverter);
    xStream.alias("csw:" + CswConstants.TRANSACTION, CswTransactionRequest.class);
    xStream.alias(CswConstants.TRANSACTION, CswTransactionRequest.class);
    return (CswTransactionRequest) xStream.fromXML(inputStream);
}
Also used : Xpp3Driver(com.thoughtworks.xstream.io.xml.Xpp3Driver) TransactionRequestConverter(org.codice.ddf.spatial.ogc.csw.catalog.converter.TransactionRequestConverter) XStream(com.thoughtworks.xstream.XStream) CswTransactionRequest(org.codice.ddf.spatial.ogc.csw.catalog.common.transaction.CswTransactionRequest) CswRecordConverter(org.codice.ddf.spatial.ogc.csw.catalog.converter.CswRecordConverter)

Aggregations

XStream (com.thoughtworks.xstream.XStream)1 Xpp3Driver (com.thoughtworks.xstream.io.xml.Xpp3Driver)1 CswTransactionRequest (org.codice.ddf.spatial.ogc.csw.catalog.common.transaction.CswTransactionRequest)1 CswRecordConverter (org.codice.ddf.spatial.ogc.csw.catalog.converter.CswRecordConverter)1 TransactionRequestConverter (org.codice.ddf.spatial.ogc.csw.catalog.converter.TransactionRequestConverter)1