class EventSourceTopic implements DataTreeChangeListener<Node>, AutoCloseable {

    @Override
    public void onDataTreeChanged(final Collection<DataTreeModification<Node>> changes) {
        for (DataTreeModification<Node> change: changes) {
            final DataObjectModification<Node> rootNode = change.getRootNode();
            switch (rootNode.getModificationType()) {
                case WRITE:
                case SUBTREE_MODIFIED:
                    final Node node = rootNode.getDataAfter();
                    if (getNodeIdRegexPattern().matcher(node.getNodeId().getValue()).matches()) {
                        notifyNode(change.getRootPath().getRootIdentifier());
                    }
                    break;
                default:
                    break;
            }
        }
    }

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

}