diff options
author | Ravi Pendurty <ravi.pendurty@highstreet-technologies.com> | 2021-08-02 10:42:37 +0530 |
---|---|---|
committer | Ravi Pendurty <ravi.pendurty@highstreet-technologies.com> | 2021-08-02 11:30:40 +0530 |
commit | 191ddbe36e3ff1bbc6e9e104a8d3626f70d49ac4 (patch) | |
tree | 7910c13eab225c9650a692c30d96c75ca45463ee /sdnr/wt/websocketmanager/model | |
parent | 0b829aa95b44134cd0b5574d32d8275fdb6b2c55 (diff) |
Update websocketmanager's NotificationOutput interface
Use new NotificationOutput interface
Issue-ID: CCSDK-3407
Signed-off-by: Ravi Pendurty <ravi.pendurty@highstreet-technologies.com>
Change-Id: Ie6c6acfe1a86c76f7ede50cdce85b4a1b99d63d1
Signed-off-by: Ravi Pendurty <ravi.pendurty@highstreet-technologies.com>
Diffstat (limited to 'sdnr/wt/websocketmanager/model')
4 files changed, 168 insertions, 1 deletions
diff --git a/sdnr/wt/websocketmanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/websocketmanager/model/data/DOMNotificationOutput.java b/sdnr/wt/websocketmanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/websocketmanager/model/data/DOMNotificationOutput.java new file mode 100644 index 000000000..62229b33c --- /dev/null +++ b/sdnr/wt/websocketmanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/websocketmanager/model/data/DOMNotificationOutput.java @@ -0,0 +1,82 @@ +/* + * ============LICENSE_START======================================================= + * ONAP : ccsdk features + * ================================================================================ + * Copyright (C) 2020 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.websocketmanager.model.data; + +import org.opendaylight.mdsal.dom.api.DOMNotification; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime; +import org.opendaylight.yangtools.yang.common.QName; + +public class DOMNotificationOutput implements INotificationOutput{ + + private DateAndTime eventTime; + private DOMNotification data; + private String nodeId; + private ReducedSchemaInfo type; + + + public DOMNotificationOutput() { + + } + + @Override + public DateAndTime getEventTime() { + return eventTime; + } + + public void setEventTime(DateAndTime eventTime) { + this.eventTime = eventTime; + } + + public DOMNotification getData() { + return data; + } + + @Override + public String getNodeId() { + return this.nodeId; + } + + @Override + public ReducedSchemaInfo getType() { + return this.type; + } + + public void setData(DOMNotification data) { + this.data = data; + } + + public void setNodeId(String nodeId) { + this.nodeId = nodeId; + } + + public void setType(ReducedSchemaInfo type) { + this.type = type; + } + + public DOMNotificationOutput(DOMNotification notification, String nodeId, QName type, DateAndTime eventTime) { + this.data = notification; + this.nodeId = nodeId; + this.eventTime = eventTime; + this.type = new ReducedSchemaInfo(type); + } + +} diff --git a/sdnr/wt/websocketmanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/websocketmanager/model/data/INotificationOutput.java b/sdnr/wt/websocketmanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/websocketmanager/model/data/INotificationOutput.java new file mode 100644 index 000000000..c16b4205d --- /dev/null +++ b/sdnr/wt/websocketmanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/websocketmanager/model/data/INotificationOutput.java @@ -0,0 +1,31 @@ +/* + * ============LICENSE_START======================================================= + * ONAP : ccsdk features + * ================================================================================ + * Copyright (C) 2020 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.websocketmanager.model.data; + +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime; + +public interface INotificationOutput { + + public DateAndTime getEventTime(); + public String getNodeId(); + public ReducedSchemaInfo getType(); +} diff --git a/sdnr/wt/websocketmanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/websocketmanager/model/data/NotificationOutput.java b/sdnr/wt/websocketmanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/websocketmanager/model/data/NotificationOutput.java index 5b966ef1e..7e0ba728c 100644 --- a/sdnr/wt/websocketmanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/websocketmanager/model/data/NotificationOutput.java +++ b/sdnr/wt/websocketmanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/websocketmanager/model/data/NotificationOutput.java @@ -25,7 +25,7 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types. import org.opendaylight.yangtools.yang.binding.Notification; import org.opendaylight.yangtools.yang.common.QName; -public class NotificationOutput { +public class NotificationOutput implements INotificationOutput{ private DateAndTime eventTime; private Notification data; @@ -37,6 +37,7 @@ public class NotificationOutput { } + @Override public DateAndTime getEventTime() { return eventTime; } @@ -49,10 +50,12 @@ public class NotificationOutput { return data; } + @Override public String getNodeId() { return this.nodeId; } + @Override public ReducedSchemaInfo getType() { return this.type; } diff --git a/sdnr/wt/websocketmanager/model/src/main/yang/websocketmanager.yang b/sdnr/wt/websocketmanager/model/src/main/yang/websocketmanager.yang new file mode 100644 index 000000000..18d7bd27a --- /dev/null +++ b/sdnr/wt/websocketmanager/model/src/main/yang/websocketmanager.yang @@ -0,0 +1,51 @@ +module websocketmanager { + + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:websocketmanager"; + prefix websocketmanager; + + import ietf-yang-types { + prefix yang; + } + organization + "highstreet technologies GmbH"; + contact + "Web: <https://highstreet-technologies.com> + ONAP: <https://wiki.onap.org/display/DW/SDN-R+Websocketmanager+Upgrade>"; + + description + "Websocketmanager Api Module + + Copyright 2021 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."; + + revision 2021-03-22 { + description + "Initial revision"; + } + + notification items-dropped-notification { + uses items-dropped-notification-g; + description "none"; + } + grouping items-dropped-notification-g { + leaf amount { + type uint32; + default 0; + description "Counts of notifications that were dropped."; + } + description "To be sent when notifications were dropped in fact of a set ratio limit."; + } +} |