Search in sources :

Example 1 with NotificationDefinition

use of org.opendaylight.yangtools.yang.model.api.NotificationDefinition in project controller by opendaylight.

the class BindingToNormalizedNodeCodec method getNotificationClasses.

@SuppressWarnings("unchecked")
public Set<Class<? extends Notification>> getNotificationClasses(final Set<SchemaPath> interested) {
    final Set<Class<? extends Notification>> result = new HashSet<>();
    final Set<NotificationDefinition> knownNotifications = runtimeContext().getSchemaContext().getNotifications();
    for (final NotificationDefinition notification : knownNotifications) {
        if (interested.contains(notification.getPath())) {
            try {
                result.add((Class<? extends Notification>) runtimeContext().getClassForSchema(notification));
            } catch (final IllegalStateException e) {
                // Ignore
                LOG.warn("Class for {} is currently not known.", notification.getPath(), e);
            }
        }
    }
    return result;
}
Also used : NotificationDefinition(org.opendaylight.yangtools.yang.model.api.NotificationDefinition) Notification(org.opendaylight.yangtools.yang.binding.Notification) HashSet(java.util.HashSet)

Aggregations

HashSet (java.util.HashSet)1 Notification (org.opendaylight.yangtools.yang.binding.Notification)1 NotificationDefinition (org.opendaylight.yangtools.yang.model.api.NotificationDefinition)1