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);
}
Aggregations