public static ContainerSchemaNode createSchemaForNotification(final NotificationDefinition next) { return new NodeContainerProxy(next.getQName(), next.getChildNodes(), next.getAvailableAugmentations()); }
@Override public Set<GroupingDefinition> getGroupings() { return notification.getGroupings(); }
private static Optional<DataNodeContainer> findNotification(final SchemaContext ctx, final QName notificationQName) { for (NotificationDefinition notification : ctx.getNotifications()) { if (notification.getQName().equals(notificationQName)) { return Optional.<DataNodeContainer> of(notification); } } return Optional.absent(); }
public static CharSequence writeNotification(final NotificationDefinition notification) { StringConcatenation _builder = new StringConcatenation(); _builder.append("notification "); QName _qName = notification.getQName(); String _localName = _qName.getLocalName(); _builder.append(_localName, ""); String _description = notification.getDescription(); boolean _isNullOrEmpty = StringExtensions.isNullOrEmpty(_description); boolean _not = (!_isNullOrEmpty); _builder.append(" "); _builder.append("\""); String _description_1 = notification.getDescription(); _builder.append(_description_1, " "); _builder.append("\";"); Collection<DataSchemaNode> _childNodes = notification.getChildNodes(); boolean _isNullOrEmpty_1 = IterableExtensions.isNullOrEmpty(_childNodes); boolean _not_1 = (!_isNullOrEmpty_1); if (_not_1) { _builder.append(" "); Collection<DataSchemaNode> _childNodes_1 = notification.getChildNodes(); CharSequence _writeDataSchemaNodes = YangTemplate.writeDataSchemaNodes(_childNodes_1); _builder.append(_writeDataSchemaNodes, " "); Set<AugmentationSchema> _availableAugmentations = notification.getAvailableAugmentations(); boolean _isNullOrEmpty_2 = IterableExtensions.isNullOrEmpty(_availableAugmentations); boolean _not_2 = (!_isNullOrEmpty_2); if (_not_2) {
private void emitNotificationNode(final NotificationDefinition notification) { if (!super.emitInstantiated && (notification.isAddedByUses() || notification.isAugmenting())) { // We skip instantiated nodes. return; } super.writer.startNotificationNode(notification.getQName()); // FIXME: BUG-2444: *(ifFeatureNode ) for (final MustDefinition mustCondition : notification.getMustConstraints()) { emitMust(mustCondition); } emitDocumentedNode(notification); emitDataNodeContainer(notification); emitUnknownStatementNodes(notification.getUnknownSchemaNodes()); super.writer.endNode(); }
@Override public List<SchemaPath> getAvailableNotifications() { final List<SchemaPath> availNotifList = new ArrayList<>(); // add Event Source Connection status notification availNotifList.add(ConnectionNotificationTopicRegistration.EVENT_SOURCE_STATUS_PATH); final Set<NotificationDefinition> availableNotifications = mount.getSchemaContext() .getNotifications(); // add all known notifications from netconf device for (final NotificationDefinition nd : availableNotifications) { availNotifList.add(nd.getPath()); } return availNotifList; }
@Override public Collection<DataSchemaNode> getChildNodes() { return notification.getChildNodes(); }
annotateDeprecatedIfNecessary(notification.getStatus(), notificationInterface); notificationInterface.addImplementsType(NOTIFICATION); context.addChildNodeType(notification, notificationInterface); notification.getChildNodes());
notification.getChildNodes()); .setComment(notification.getDescription()).setReturnType(Types.VOID);
@Override public Set<AugmentationSchemaNode> getAvailableAugmentations() { return notification.getAvailableAugmentations(); }
private static Optional<DataNodeContainer> findNotification(final SchemaContext ctx, final QName notificationQName) { for (final NotificationDefinition notification : ctx.getNotifications()) { if (notification.getQName().equals(notificationQName)) { return Optional.of(notification); } } return Optional.empty(); }
@SuppressWarnings("unchecked") public final Set<Class<? extends Notification>> getNotificationClasses(final Set<SchemaPath> interested) { final Set<Class<? extends Notification>> result = new HashSet<>(); final BindingRuntimeContext runtimeContext = runtimeContext(); for (final NotificationDefinition notification : runtimeContext.getSchemaContext().getNotifications()) { 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; }
@Override public Collection<DataSchemaNode> getChildNodes() { return notification.getChildNodes(); }
@Override public Set<AugmentationSchemaNode> getAvailableAugmentations() { return notification.getAvailableAugmentations(); }
private static Optional<DataNodeContainer> findNotification(final SchemaContext ctx, final QName notificationQName) { for (NotificationDefinition notification : ctx.getNotifications()) { if (notification.getQName().equals(notificationQName)) { return Optional.of(notification); } } return Optional.empty(); }
/** * Get specific notification classes as Binding objects. * * @param interested * - set of specific notifications paths * @return notification as Binding objects according to input set of their DOM paths */ @SuppressWarnings({ "unchecked", "rawtypes" }) 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; }
private NotificationContainerSchemaNode(final NotificationDefinition notification) { super(notification); this.notification = notification; mapNodes = Maps.uniqueIndex(notification.getChildNodes(), DataSchemaNode::getQName); }
@Override public Set<GroupingDefinition> getGroupings() { return notification.getGroupings(); }
static DataContainerCodecPrototype<NotificationDefinition> from(final Class<?> augClass, final NotificationDefinition schema, final CodecContextFactory factory) { final PathArgument arg = NodeIdentifier.create(schema.getQName()); return new DataContainerCodecPrototype<>(augClass,arg, schema, factory); }
@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; }