X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=nbinotifications%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Ftransportpce%2Fnbinotifications%2Fserialization%2FNotificationServiceSerializer.java;h=b3f6ae119c5d86cb44be50145ef48da9c6ea9b6b;hb=274148a8d813140f86e1f9770ba992b072c1a5cd;hp=eb998746f9a1f25349f49d097921c008579ffa2a;hpb=c305715705f2fc92e418c49cbb7c43e501c3d4c6;p=transportpce.git diff --git a/nbinotifications/src/main/java/org/opendaylight/transportpce/nbinotifications/serialization/NotificationServiceSerializer.java b/nbinotifications/src/main/java/org/opendaylight/transportpce/nbinotifications/serialization/NotificationServiceSerializer.java index eb998746f..b3f6ae119 100644 --- a/nbinotifications/src/main/java/org/opendaylight/transportpce/nbinotifications/serialization/NotificationServiceSerializer.java +++ b/nbinotifications/src/main/java/org/opendaylight/transportpce/nbinotifications/serialization/NotificationServiceSerializer.java @@ -12,15 +12,15 @@ import java.nio.charset.StandardCharsets; import java.util.Map; import org.apache.kafka.common.serialization.Serializer; import org.opendaylight.transportpce.common.converter.JsonStringConverter; -import org.opendaylight.yang.gen.v1.nbi.notifications.rev201130.NotificationService; +import org.opendaylight.yang.gen.v1.nbi.notifications.rev210813.NotificationProcessService; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.opendaylight.yangtools.yang.data.codec.gson.JSONCodecFactorySupplier; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class NotificationServiceSerializer implements Serializer { +public class NotificationServiceSerializer implements Serializer { private static final Logger LOG = LoggerFactory.getLogger(NotificationServiceSerializer.class); - private JsonStringConverter converter; + private JsonStringConverter converter; @SuppressWarnings("unchecked") @Override @@ -28,21 +28,21 @@ public class NotificationServiceSerializer implements Serializer) { - converter = (JsonStringConverter) configs.get(ConfigConstants.CONVERTER); + converter = (JsonStringConverter) configs.get(ConfigConstants.CONVERTER); } } @Override - public byte[] serialize(String topic, NotificationService data) { + public byte[] serialize(String topic, NotificationProcessService data) { if (converter == null) { - throw new IllegalArgumentException( - "Converter should be" + "configured through configure method of serializer"); + throw new IllegalArgumentException("Converter should be configured through configure method of serializer"); } if (data == null) { return new byte[0]; } try { - InstanceIdentifier iid = InstanceIdentifier.builder(NotificationService.class).build(); + InstanceIdentifier iid = InstanceIdentifier + .builder(NotificationProcessService.class).build(); String serialized = converter.createJsonStringFromDataObject(iid, data, JSONCodecFactorySupplier.RFC7951); LOG.info("Serialized event {}", serialized); return serialized.getBytes(StandardCharsets.UTF_8);