class EventSourceTopic implements DataTreeChangeListener<Node>, AutoCloseable {

    public void notifyNode(final InstanceIdentifier<?> nodeId) {
        LOG.debug("Notify node: {}", nodeId);
        try {
            final RpcResult<JoinTopicOutput> rpcResultJoinTopic =
                    sourceService.joinTopic(getJoinTopicInputArgument(nodeId)).get();
            if (!rpcResultJoinTopic.isSuccessful()) {
                for (final RpcError err : rpcResultJoinTopic.getErrors()) {
                    LOG.error("Can not join topic: [{}] on node: [{}]. Error: {}", getTopicId().getValue(),
                            nodeId.toString(), err.toString());
                }
            } else {
                joinedEventSources.add(nodeId);
            }
        } catch (InterruptedException | ExecutionException e) {
            LOG.error("Could not invoke join topic for node {}", nodeId);
        }
    }

    private  EventSourceTopic(final NotificationPattern notificationPattern, final String nodeIdRegexPattern,
            final EventSourceService sourceService);

}