/** * Create a {@code SerializationDelegate} with the given serializer/deserializer. * @param serializer the {@link Serializer} to use (never {@code null)} * @param deserializer the {@link Deserializer} to use (never {@code null)} */ public SerializationDelegate(Serializer<Object> serializer, Deserializer<Object> deserializer) { Assert.notNull(serializer, "Serializer must not be null"); Assert.notNull(deserializer, "Deserializer must not be null"); this.serializer = serializer; this.deserializer = deserializer; }
@Bean public AbstractServerConnectionFactory syslogSourceConnectionFactory( @Qualifier("syslogSourceDecoder") Deserializer<?> decoder) throws Exception { AbstractServerConnectionFactory factory; if (this.properties.isNio()) { factory = new TcpNioServerConnectionFactory(this.properties.getPort()); } else { factory = new TcpNetServerConnectionFactory(this.properties.getPort()); } factory.setLookupHost(this.properties.isReverseLookup()); factory.setDeserializer(decoder); factory.setSoTimeout(this.properties.getSocketTimeout()); return factory; }
@Bean public Deserializer<?> syslogSourceDecoder() { ByteArrayLfSerializer decoder = new ByteArrayLfSerializer(); decoder.setMaxMessageSize(this.properties.getBufferSize()); if (this.properties.getRfc().equals("5424")) { return new RFC6587SyslogDeserializer(decoder); } else { return decoder; } }
public SpringSerde(Serializer<T> serializer, Deserializer<T> deserializer) { Assert.notNull(serializer, "Serializer cannot be null."); Assert.notNull(deserializer, "Deserializer cannot be null."); this.serializer = serializer; this.deserializer = deserializer; }
/** * Create a {@code DeserializingConverter} that delegates to the provided {@link Deserializer}. */ public DeserializingConverter(Deserializer<Object> deserializer) { Assert.notNull(deserializer, "Deserializer must not be null"); this.deserializer = deserializer; }
/** * Create a DeserializingConverter that delegates to the provided {@link Deserializer}. */ public DeserializingConverter(Deserializer<Object> deserializer) { Assert.notNull(deserializer, "Deserializer must not be null"); this.deserializer = deserializer; }