use of javax.xml.crypto.Data in project light-saga-4j by networknt.
the class SagaInstanceRepositoryJdbc method findWithData.
@Override
public <Data> SagaInstanceData<Data> findWithData(String sagaType, String sagaId) {
SagaInstance sagaInstance = find(sagaType, sagaId);
Data sagaData = SagaDataSerde.deserializeSagaData(sagaInstance.getSerializedSagaData());
return new SagaInstanceData<>(sagaInstance, sagaData);
}
use of javax.xml.crypto.Data in project santuario-java by apache.
the class DOMRetrievalMethod method dereference.
@Override
public Data dereference(XMLCryptoContext context) throws URIReferenceException {
if (context == null) {
throw new NullPointerException("context cannot be null");
}
/*
* If URIDereferencer is specified in context; use it, otherwise use
* built-in.
*/
URIDereferencer deref = context.getURIDereferencer();
if (deref == null) {
deref = DOMURIDereferencer.INSTANCE;
}
Data data = deref.dereference(this, context);
// pass dereferenced data through Transforms
try {
for (Transform transform : transforms) {
data = transform.transform(data, context);
}
} catch (Exception e) {
throw new URIReferenceException(e);
}
// guard against RetrievalMethod loops
if (data instanceof NodeSetData && Utils.secureValidation(context)) {
NodeSetData nsd = (NodeSetData) data;
Iterator<?> i = nsd.iterator();
if (i.hasNext()) {
Node root = (Node) i.next();
if ("RetrievalMethod".equals(root.getLocalName())) {
throw new URIReferenceException("It is forbidden to have one RetrievalMethod point " + "to another when secure validation is enabled");
}
}
}
return data;
}
Aggregations