/** * Defines that a pipeline element (data processor or data sink) supports processing messaging arriving in Thrift * format * @return The resulting {@link org.streampipes.model.grounding.TransportFormat}. */ public static TransportFormat thriftFormat() { return new TransportFormat(MessageFormat.Thrift); } }
/** * Defines the transport format JSON used by a data stream at runtime. * @return The {@link org.streampipes.model.grounding.TransportFormat} of type JSON. */ public static TransportFormat jsonFormat() { return new TransportFormat(MessageFormat.Json); }
/** * Defines the transport format Apache Thrift used by a data stream at runtime. * @return The {@link org.streampipes.model.grounding.TransportFormat} of type Thrift. */ public static TransportFormat thriftFormat() { return new TransportFormat(MessageFormat.Thrift); } }
/** * Defines that a pipeline element (data processor or data sink) supports processing messaging arriving in JSON format * @return The resulting {@link org.streampipes.model.grounding.TransportFormat}. */ public static TransportFormat jsonFormat() { return new TransportFormat(MessageFormat.Json); }
public static List<TransportFormat> standardFormat() { List<TransportFormat> formats = new ArrayList<>(); formats.add(new TransportFormat(MessageFormat.Json)); formats.add(new TransportFormat(MessageFormat.Thrift)); return formats; }
public List<TransportFormat> transportFormats( List<TransportFormat> transportFormats) { return transportFormats.stream().map(t -> new TransportFormat(t)).collect(Collectors.toList()); }
public TransportFormat getTransportFormat() { if (source instanceof SpDataStream) { return ((SpDataStream) source) .getEventGrounding() .getTransportFormats() .get(0); } else { if (supportsFormat(MessageFormat.Json)) { return new TransportFormat(MessageFormat.Json); } else if (supportsFormat(MessageFormat.Thrift)) { return new TransportFormat(MessageFormat.Thrift); } } return new TransportFormat(MessageFormat.Json); }
public TransportFormat getTransportFormat() { if (source instanceof SpDataStream) { return ((SpDataStream) source) .getEventGrounding() .getTransportFormats() .get(0); } else { if (supportsFormat(MessageFormat.Json)) { return new TransportFormat(MessageFormat.Json); } else if (supportsFormat(MessageFormat.Thrift)) { return new TransportFormat(MessageFormat.Thrift); } } return new TransportFormat(MessageFormat.Json); }
public static EventGrounding makeDummyGrounding() { EventGrounding grounding = new EventGrounding(); grounding.setTransportFormats(Arrays.asList(new TransportFormat())); grounding.setTransportProtocol(ProtocolGenerator.makeDummyProtocol()); return grounding; } }