@Override public NotificationSyncRequest createNotificationRequest() { if (clientState != null) { NotificationSyncRequest request = new NotificationSyncRequest(); if (!acceptedUnicastNotificationIds.isEmpty()) { LOG.info("Accepted unicast Notifications: {}", acceptedUnicastNotificationIds.size()); request.setAcceptedUnicastNotifications(new ArrayList<>(acceptedUnicastNotificationIds)); } request.setSubscriptionCommands(sentNotificationCommands); request.setTopicListHash(clientState.getTopicListHash()); request.setTopicStates(getTopicStates()); return request; } return null; }
@Override public NotificationSyncRequest createEmptyNotificationRequest() { if (clientState != null) { NotificationSyncRequest request = new NotificationSyncRequest(); request.setTopicListHash(clientState.getTopicListHash()); request.setTopicStates(getTopicStates()); return request; } return null; }
@Override public NotificationSyncRequest build() { try { NotificationSyncRequest record = new NotificationSyncRequest(); record.topicListHash = fieldSetFlags()[0] ? this.topicListHash : (java.lang.Integer) defaultValue(fields()[0]); record.topicStates = fieldSetFlags()[1] ? this.topicStates : (java.util.List<org.kaaproject.kaa.common.endpoint.gen.TopicState>) defaultValue(fields()[1]); record.acceptedUnicastNotifications = fieldSetFlags()[2] ? this.acceptedUnicastNotifications : (java.util.List<java.lang.String>) defaultValue(fields()[2]); record.subscriptionCommands = fieldSetFlags()[3] ? this.subscriptionCommands : (java.util.List<org.kaaproject.kaa.common.endpoint.gen.SubscriptionCommand>) defaultValue(fields()[3]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } }