/** * Convert unicast notification. * * @param unicastNotification the unicast notification * @return the notification dto */ private NotificationDto convertUnicastNotification(EndpointNotificationDto unicastNotification) { NotificationDto dto = unicastNotification.getNotificationDto(); dto.setId(unicastNotification.getId()); return dto; }
/** * Create new instance of <code>MongoEndpointNotification</code>. * @param dto data transfer object contain data that * assign on fields of new instance */ public MongoEndpointNotification(EndpointNotificationDto dto) { this.id = dto.getId(); this.endpointKeyHash = getArrayCopy(dto.getEndpointKeyHash()); this.notification = dto.getNotificationDto() != null ? new MongoNotification(dto.getNotificationDto()) : null; }
endpointId, unicastNotification.getId()); LOG.trace("[{}] detected new unicast notification: {} ", endpointId, unicastNotification); NotificationDto notificationDto = unicastNotification.getNotificationDto(); if (notificationDto != null) { Date date = notificationDto.getExpiredAt();
validateObject(dto, "Can't save unicast notification. Invalid endpoint notification object."); UpdateNotificationDto<EndpointNotificationDto> updateNotificationDto = null; NotificationDto notificationDto = dto.getNotificationDto(); String schemaId = notificationDto.getSchemaId(); String topicId = notificationDto.getTopicId(); if (unicast != null && unicast.getNotificationDto() != null) { LOG.trace("Saved unicast notifications {}", unicast); updateNotificationDto = new UpdateNotificationDto<EndpointNotificationDto>(); NotificationDto savedDto = unicast.getNotificationDto(); updateNotificationDto.setAppId(savedDto.getApplicationId()); updateNotificationDto.setTopicId(savedDto.getTopicId());
/** * Create new instance of <code>CassandraTopicListEntry</code>. * * @param dto data transfer object contain data that assign on fields of new instance */ public CassandraEndpointNotification(EndpointNotificationDto dto) { this.endpointKeyHash = ByteBuffer.wrap(dto.getEndpointKeyHash()); NotificationDto notificationDto = dto.getNotificationDto(); if (notificationDto != null) { this.seqNum = notificationDto.getSecNum(); this.type = notificationDto.getType(); this.applicationId = notificationDto.getApplicationId(); this.schemaId = notificationDto.getSchemaId(); this.nfVersion = notificationDto.getNfVersion(); this.lastModifyTime = notificationDto.getLastTimeModify(); this.body = getByteBuffer(notificationDto.getBody()); this.expiredAt = notificationDto.getExpiredAt(); this.topicId = notificationDto.getTopicId(); } this.id = dto.getId() != null ? dto.getId() : generateId(); }