use of org.onosproject.grpc.net.host.models.HostEventProto.HostNotificationProto in project onos by opennetworkinglab.
the class HostEventConverter method buildHostProtoMessage.
private HostNotificationProto buildHostProtoMessage(HostEvent hostEvent) {
HostNotificationProto.Builder notificationBuilder = HostNotificationProto.newBuilder();
HostProto hostCore = HostProto.newBuilder().setHostId(HostIdProtoTranslator.translate(hostEvent.subject().id())).setConfigured(hostEvent.subject().configured()).addAllIpAddresses(hostEvent.subject().ipAddresses().stream().map(IpAddress::toString).collect(Collectors.toList())).setLocation(HostLocationProtoTranslator.translate(hostEvent.subject().location())).setVlan(hostEvent.subject().vlan().toShort()).putAllAnnotations(AnnotationsTranslator.asMap(hostEvent.subject().annotations())).build();
notificationBuilder.setHostEventType(getProtoType(hostEvent)).setHost(hostCore);
return notificationBuilder.build();
}
Aggregations