use of org.apache.nifi.cluster.protocol.ProtocolException in project nifi by apache.
the class BulletinsPayload method marshal.
public static void marshal(final BulletinsPayload payload, final OutputStream os) throws ProtocolException {
try {
final Marshaller marshaller = JAXB_CONTEXT.createMarshaller();
marshaller.marshal(payload, os);
} catch (final JAXBException je) {
throw new ProtocolException(je);
}
}
use of org.apache.nifi.cluster.protocol.ProtocolException in project nifi by apache.
the class BulletinsPayload method unmarshal.
public static BulletinsPayload unmarshal(final InputStream is) throws ProtocolException {
try {
final Unmarshaller unmarshaller = JAXB_CONTEXT.createUnmarshaller();
final XMLStreamReader xsr = XmlUtils.createSafeReader(is);
return (BulletinsPayload) unmarshaller.unmarshal(xsr);
} catch (final JAXBException | XMLStreamException e) {
throw new ProtocolException(e);
}
}
Aggregations