diff options
author | Ravi Pendurty <ravi.pendurty@highstreet-technologies.com> | 2021-02-03 14:43:58 +0100 |
---|---|---|
committer | Dan Timoney <dtimoney@att.com> | 2021-02-05 22:56:21 +0000 |
commit | f7cc6a1daa39f583494dc0a71b89e1a1317a0a2b (patch) | |
tree | 6f780ecb8c6fc7be8ec2b3ab3f6baec1481be4c5 /sdnr/wt/netconfnode-state-service/model/src | |
parent | 8bbecead253c30da60577ecd014d59983e4b6113 (diff) |
Migrate websocketmanager and netconfnode-state-service
Migrate websocketmanager and netconfnode-state-service to Aluminium
Issue-ID: CCSDK-3131
Signed-off-by: Ravi Pendurty <ravi.pendurty@highstreet-technologies.com>
Change-Id: If82aa071b8187f6cbd02f187d93b61a15463d718
Signed-off-by: Ravi Pendurty <ravi.pendurty@highstreet-technologies.com>
Diffstat (limited to 'sdnr/wt/netconfnode-state-service/model/src')
5 files changed, 251 insertions, 66 deletions
diff --git a/sdnr/wt/netconfnode-state-service/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/NetconfAccessor.java b/sdnr/wt/netconfnode-state-service/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/NetconfAccessor.java index cca71457e..f24503957 100644 --- a/sdnr/wt/netconfnode-state-service/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/NetconfAccessor.java +++ b/sdnr/wt/netconfnode-state-service/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/NetconfAccessor.java @@ -17,18 +17,9 @@ */ package org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice; -import com.google.common.util.concurrent.ListenableFuture; -import java.util.List; -import org.eclipse.jdt.annotation.NonNull; -import org.opendaylight.mdsal.binding.api.DataBroker; -import org.opendaylight.mdsal.binding.api.MountPoint; -import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.notification._1._0.rev080714.CreateSubscriptionOutput; -import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netmod.notification.rev080714.netconf.streams.Stream; +import java.util.Optional; import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; -import org.opendaylight.yangtools.concepts.ListenerRegistration; -import org.opendaylight.yangtools.yang.binding.NotificationListener; -import org.opendaylight.yangtools.yang.common.RpcResult; /** * Interface handling netconf connection. @@ -52,62 +43,8 @@ public interface NetconfAccessor { */ Capabilities getCapabilites(); - /** - * @return the dataBroker - */ - DataBroker getDataBroker(); - - /** - * @return the MDSAL Mountpoint service - **/ - MountPoint getMountpoint(); - - /** - * @Return TransAction - */ - TransactionUtils getTransactionUtils(); - - /** - * Register netconf notification listener for related mountpoint - * - * @param <T> specific child class of NotificationListener - * @param listener listener to be called - * @return handler to manager registration - */ - <T extends NotificationListener> ListenerRegistration<NotificationListener> doRegisterNotificationListener( - @NonNull T listener); + Optional<NetconfBindingAccessor> getNetconfBindingAccessor(); - /** - * Register notifications stream for the connection. - * - * @param streamName that should be "NETCONF" as default. - * @return progress indication - */ - ListenableFuture<RpcResult<CreateSubscriptionOutput>> registerNotificationsStream(String streamName); - - /** - * Register notifications stream for the connection - * - * @param streamList that contains a list of streams to be subscribed for notifications - * @return progress indication - */ - void registerNotificationsStream(List<Stream> streamList); - - /** - * check if the device supports notifications.yang - * @return true if notifications.yang is supported - */ -// boolean isNotificationsSupported(); - - /** - * check if the device supports notifications.yang - * @return true if nc-notifications.yang is supported - */ - boolean isNCNotificationsSupported(); - /** - * Get all notification streams - * @return stream list - */ - List<Stream> getNotificationStreams(); + Optional<NetconfDomAccessor> getNetconfDomAccessor(); } diff --git a/sdnr/wt/netconfnode-state-service/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/NetconfBindingAccessor.java b/sdnr/wt/netconfnode-state-service/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/NetconfBindingAccessor.java new file mode 100644 index 000000000..ffcacf213 --- /dev/null +++ b/sdnr/wt/netconfnode-state-service/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/NetconfBindingAccessor.java @@ -0,0 +1,64 @@ +/* + * ============LICENSE_START======================================================================== + * ONAP : ccsdk feature sdnr wt + * ================================================================================================= + * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. + * ================================================================================================= + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * ============LICENSE_END========================================================================== + */ +package org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice; + +import java.util.Optional; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.mdsal.binding.api.DataBroker; +import org.opendaylight.mdsal.binding.api.MountPoint; +import org.opendaylight.yangtools.concepts.ListenerRegistration; +import org.opendaylight.yangtools.yang.binding.NotificationListener; + +/** + * Interface handling netconf connection. + */ +public interface NetconfBindingAccessor extends NetconfAccessor { + + /** + * @return the dataBroker + */ + DataBroker getDataBroker(); + + /** + * @return the MDSAL Mountpoint service + **/ + MountPoint getMountpoint(); + + /** + * Get handler for read/write + * @Return Transaction + */ + TransactionUtils getTransactionUtils(); + + /** + * Get notifications handler + * @return + */ + Optional<NetconfNotifications> getNotificationAccessor(); + + /** + * Register netconf notification listener for related mountpoint + * + * @param <T> specific child class of NotificationListener + * @param listener listener to be called + * @return handler to manager registration + */ + <T extends NotificationListener> ListenerRegistration<NotificationListener> doRegisterNotificationListener( + @NonNull T listener); + +} diff --git a/sdnr/wt/netconfnode-state-service/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/NetconfDomAccessor.java b/sdnr/wt/netconfnode-state-service/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/NetconfDomAccessor.java new file mode 100644 index 000000000..0818f7972 --- /dev/null +++ b/sdnr/wt/netconfnode-state-service/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/NetconfDomAccessor.java @@ -0,0 +1,89 @@ +/* + * ============LICENSE_START======================================================================== + * ONAP : ccsdk feature sdnr wt + * ================================================================================================= + * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. + * ================================================================================================= + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * ============LICENSE_END========================================================================== + */ +package org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice; + +import java.util.Collection; +import java.util.Optional; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.mdsal.common.api.LogicalDatastoreType; +import org.opendaylight.mdsal.dom.api.DOMDataBroker; +import org.opendaylight.mdsal.dom.api.DOMMountPoint; +import org.opendaylight.mdsal.dom.api.DOMNotificationListener; +import org.opendaylight.yangtools.concepts.ListenerRegistration; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; +import org.opendaylight.yangtools.yang.model.api.SchemaPath; + +/** + * Interface handling netconf connection. + */ +public interface NetconfDomAccessor extends NetconfAccessor { + + /** + * @return the dataBroker + */ + DOMDataBroker getDataBroker(); + + /** + * @return the MDSAL Mountpoint service + **/ + DOMMountPoint getMountpoint(); + + /** + * Deliver the data into a class + * @param <T> DataObject type + * @param dataStoreType config or operational database + * @param path data path + * @return Optional<T> with object + */ + <T extends DataObject> Optional<T> readData(LogicalDatastoreType dataStoreType, YangInstanceIdentifier path, + Class<T> clazz); + + /** + * Read data from device + * @param dataStoreType + * @param path + * @return NormalizedNode<?, ?> with data + */ + Optional<NormalizedNode<?, ?>> readDataNode(LogicalDatastoreType dataStoreType, YangInstanceIdentifier path); + + /** + * Register netconf notification listener for related mountpoint + * + * @param <T> specific child class of DOMNotificationListener + * @param listener listener to be called + * @param types + * @return handler to manager registration + */ + <T extends DOMNotificationListener> @NonNull ListenerRegistration<DOMNotificationListener> doRegisterNotificationListener( + @NonNull T listener, Collection<SchemaPath> types); + /** + * Register netconf notification listener for related mountpoint + * + * @param <T> + * @param listener + * @param types + * @return + */ + <T extends DOMNotificationListener> @NonNull ListenerRegistration<DOMNotificationListener> doRegisterNotificationListener( + @NonNull T listener, SchemaPath[] types); + + + +} diff --git a/sdnr/wt/netconfnode-state-service/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/NetconfNotifications.java b/sdnr/wt/netconfnode-state-service/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/NetconfNotifications.java new file mode 100644 index 000000000..b13030dee --- /dev/null +++ b/sdnr/wt/netconfnode-state-service/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/NetconfNotifications.java @@ -0,0 +1,66 @@ +/* + * ============LICENSE_START======================================================================== + * ONAP : ccsdk feature sdnr wt + * ================================================================================================= + * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. + * ================================================================================================= + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * ============LICENSE_END========================================================================== + */ +package org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice; + +import com.google.common.util.concurrent.ListenableFuture; +import java.util.List; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.notification._1._0.rev080714.CreateSubscriptionOutput; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netmod.notification.rev080714.netconf.streams.Stream; +import org.opendaylight.yangtools.yang.common.RpcResult; + +/** + * Interface handling netconf connection. + */ +public interface NetconfNotifications { + + static String DefaultNotificationsStream = "NETCONF"; + + /** + * check if the device supports notifications.yang + * @return true if notifications.yang is supported + */ + boolean isNotificationsSupported(); + + /** + * check if the device supports notifications.yang + * @return true if nc-notifications.yang is supported + */ + boolean isNCNotificationsSupported(); + /** + * Get all notification streams + * @return stream list + */ + List<Stream> getNotificationStreams(); + + /** + * Register notifications stream for the connection + * + * @param streamList that contains a list of streams to be subscribed for notifications + * @return progress indication + */ + void registerNotificationsStream(List<Stream> streamList); + + /** + * Register notifications stream for the connection. + * + * @param streamName that should be "NETCONF" as default. + * @return progress indication + */ + ListenableFuture<RpcResult<CreateSubscriptionOutput>> registerNotificationsStream(String streamName); + +} diff --git a/sdnr/wt/netconfnode-state-service/model/src/main/yang/config.yang b/sdnr/wt/netconfnode-state-service/model/src/main/yang/config.yang new file mode 100644 index 000000000..82886e63b --- /dev/null +++ b/sdnr/wt/netconfnode-state-service/model/src/main/yang/config.yang @@ -0,0 +1,29 @@ +module config { + yang-version 1.1; + namespace urn:ietf:params:xml:ns:yang:config; + prefix config; + + revision 2020-12-08 { + description "Initial revision"; + } + + container configuration { + list entry { + key "setting"; + + leaf setting { + type string; + } + leaf value { + type uint8; + } + } + + leaf config1 { + type string; + } + leaf config2 { + type boolean; + } + } +}
\ No newline at end of file |