diff options
author | KAPIL SINGAL <ks220y@att.com> | 2020-12-03 14:03:07 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-12-03 14:03:07 +0000 |
commit | 92c89c8ba4507cc1e556a091e1d61376a7804a4d (patch) | |
tree | 53f32e2fa7592f611c1c8daf38e1471ac6fba8e5 /sdnr/wt/data-provider | |
parent | 9e5ce985c3384526e54259efc4057bec71bb93bb (diff) | |
parent | 8016160afd589d269cfcdb09079e329dabd328b8 (diff) |
Merge "SDN-R Server provide GUI cut through for ODLUX"
Diffstat (limited to 'sdnr/wt/data-provider')
45 files changed, 1020 insertions, 2437 deletions
diff --git a/sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/DataProvider.java b/sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/DataProvider.java index 639fe301b..d277b763e 100644 --- a/sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/DataProvider.java +++ b/sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/DataProvider.java @@ -20,13 +20,14 @@ package org.onap.ccsdk.features.sdnr.wt.dataprovider.model; import java.util.Date; import java.util.List; import org.onap.ccsdk.features.sdnr.wt.common.database.HtDatabaseClient; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ConnectionlogEntity; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.EventlogEntity; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.FaultcurrentEntity; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.FaultlogEntity; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Inventory; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.NetworkElementConnectionEntity; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.PmdataEntity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ConnectionlogEntity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EventlogEntity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.FaultcurrentEntity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.FaultlogEntity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Guicutthrough; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Inventory; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.NetworkElementConnectionEntity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.PmdataEntity; public interface DataProvider extends ArchiveCleanProvider { @@ -72,6 +73,13 @@ public interface DataProvider extends ArchiveCleanProvider { void writeInventory(Inventory internalEquipment); /** + * write GUI Cut through data to database + * + * @param gcData + */ + void writeGuiCutThroughData(Guicutthrough gcData); + + /** * * @param networkElementConnectionEntitiy to wirte to DB * @param nodeId Id for this DB element @@ -102,10 +110,7 @@ public interface DataProvider extends ArchiveCleanProvider { /** * @param list */ - void doWritePerformanceData(List<PmdataEntity> list); - - void doWritePerformanceData2(List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.v2.rev200702.PmdataEntity> list); - + void doWritePerformanceData(List<PmdataEntity> list); /** * @return raw database client diff --git a/sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/HtDatabaseMaintenance.java b/sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/HtDatabaseMaintenance.java index 51fe25d89..99e251c44 100644 --- a/sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/HtDatabaseMaintenance.java +++ b/sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/HtDatabaseMaintenance.java @@ -19,7 +19,7 @@ package org.onap.ccsdk.features.sdnr.wt.dataprovider.model; import java.util.List; import org.eclipse.jdt.annotation.Nullable; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.MaintenanceEntity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.MaintenanceEntity; /** * @author herbert diff --git a/sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/types/YangHelper2.java b/sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/types/YangHelper2.java new file mode 100644 index 000000000..339bf7c6e --- /dev/null +++ b/sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/types/YangHelper2.java @@ -0,0 +1,102 @@ +/* + * ============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.dataprovider.model.types; + +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.math.BigInteger; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.binding.Identifier; +import org.opendaylight.yangtools.yang.common.Uint16; +import org.opendaylight.yangtools.yang.common.Uint32; +import org.opendaylight.yangtools.yang.common.Uint64; + +public class YangHelper2 { + + static public @NonNull Uint64 getUint64(@NonNull BigInteger val) { + return Uint64.valueOf(val); + } + + static public @NonNull Uint64 getUint64(@NonNull Uint64 val) { + return val; + } + + static public @NonNull Uint32 getUint32(@NonNull Long val) { + return Uint32.valueOf(val); + } + + static public @NonNull Uint32 getUint32(@NonNull Uint32 val) { + return val; + } + + public static @NonNull Uint16 getUint16(@Nullable Integer val) { + return Uint16.valueOf(val); + } + + public static @NonNull Uint16 getUint16(@Nullable Uint16 val) { + return val; + } + + public static @NonNull Integer getInteger(@Nullable Integer val) { + return val; + } + + public static @NonNull Integer getInteger(@Nullable Uint16 val) { + return val.intValue(); + } + /** + * Aluminium version + */ + public static <K extends Identifier<T>,T extends Identifiable<K>> Map<K, T> getListOrMapALUMINIUM(Class<K> clazz, List<T> list) { + Map<K,T> map = new HashMap<>(); + for(T listelement:list) { + Constructor<K> constructor; + try { + constructor = clazz.getConstructor(clazz); + clazz.getConstructors(); + map.put(constructor.newInstance(listelement.key()), listelement); + } catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { + throw new IllegalArgumentException("Can not create map element.", e); + } + } + return map; + } + public static <K extends Identifier<T>,T extends Identifiable<K>> Map<K, T> getListOrMapALUMINIUM(Class<K> clazz, T listElement) { + return getListOrMapALUMINIUM(clazz, Arrays.asList(listElement) ); + } + /** + * Sodium version + */ + public static <K extends Identifier<T>,T extends Identifiable<K>> List<T> getListOrMap(Class<K> clazz, List<T> list) { + return list; + } + public static <K extends Identifier<T>,T extends Identifiable<K>> List<T> getListOrMap(Class<K> clazz, T listElement) { + return Arrays.asList(listElement); + } + +} diff --git a/sdnr/wt/data-provider/model/src/main/java/org/opendaylight/yang/gen/v1/http/org/openroadm/pm/types/rev191129/PmDataTypeBuilder.java b/sdnr/wt/data-provider/model/src/main/java/org/opendaylight/yang/gen/v1/http/org/openroadm/pm/types/rev191129/PmDataTypeBuilder.java index 98e93c363..b660787c6 100644 --- a/sdnr/wt/data-provider/model/src/main/java/org/opendaylight/yang/gen/v1/http/org/openroadm/pm/types/rev191129/PmDataTypeBuilder.java +++ b/sdnr/wt/data-provider/model/src/main/java/org/opendaylight/yang/gen/v1/http/org/openroadm/pm/types/rev191129/PmDataTypeBuilder.java @@ -1,23 +1,85 @@ package org.opendaylight.yang.gen.v1.http.org.openroadm.pm.types.rev191129; -import java.lang.String; -import java.lang.UnsupportedOperationException; + +import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import org.opendaylight.yangtools.yang.common.Uint64; /** - * The purpose of generated class in src/main/java for Union types is to create new instances of unions from a string representation. - * In some cases it is very difficult to automate it since there can be unions such as (uint32 - uint16), or (string - uint32). + * The purpose of generated class in src/main/java for Union types is to create new instances of unions from a string + * representation. In some cases it is very difficult to automate it since there can be unions such as (uint32 - + * uint16), or (string - uint32). * - * The reason behind putting it under src/main/java is: - * This class is generated in form of a stub and needs to be finished by the user. This class is generated only once to prevent - * loss of user code. + * The reason behind putting it under src/main/java is: This class is generated in form of a stub and needs to be + * finished by the user. This class is generated only once to prevent loss of user code. * */ +@JsonPOJOBuilder(buildMethodName = "build", withPrefix = "with") public class PmDataTypeBuilder { - private PmDataTypeBuilder() { - //Exists only to defeat instantiation. + private Uint64 _uint64; + private BigInteger _unint64; + private Long _int64; + private BigDecimal _decimal64; + + public PmDataTypeBuilder() { + System.out.println("-- Builder"); + } + + public PmDataTypeBuilder setUnint64(String v) { + _unint64 = new BigInteger(v); + return this; + } + + public PmDataTypeBuilder setUint64(String v) { + _uint64 = Uint64.valueOf(v); + return this; + } + + public PmDataTypeBuilder setInt64(String v) { + _int64 = new Long(v); + return this; + } + + public PmDataTypeBuilder setDecimal64(String v) { + _decimal64 = new BigDecimal(v); + return this; + } + + public PmDataType build() { + Optional<Constructor<PmDataType>> cons1; + try { + cons1 = Optional.of(PmDataType.class.getConstructor(BigInteger.class)); + } catch (NoSuchMethodException | SecurityException e) { + cons1 = Optional.empty(); + } + Optional<Constructor<PmDataType>> cons2; + try { + cons2 = Optional.of(PmDataType.class.getConstructor(Uint64.class)); + } catch (NoSuchMethodException | SecurityException e) { + cons2 = Optional.empty(); + } + + try { + if (_unint64 != null) { + return cons1.get().newInstance(_unint64); + } else if (_uint64 != null) { + return cons2.get().newInstance(_uint64); + } else if (_int64 != null) { + return new PmDataType(_int64); + } else { + return new PmDataType(_decimal64); + } + } catch (InstantiationException | IllegalAccessException | IllegalArgumentException + | InvocationTargetException e) { + throw new IllegalArgumentException("Wrong stuff"); + } } public static PmDataType getDefaultInstance(String defaultValue) { - throw new UnsupportedOperationException("Not yet implemented"); + return new PmDataTypeBuilder().setInt64("-1").build(); } } diff --git a/sdnr/wt/data-provider/model/src/main/yang/data-provider-g826-pm-types.yang b/sdnr/wt/data-provider/model/src/main/yang/data-provider-g826-pm-types.yang index ae9410ce4..a8d9d1ca2 100644 --- a/sdnr/wt/data-provider/model/src/main/yang/data-provider-g826-pm-types.yang +++ b/sdnr/wt/data-provider/model/src/main/yang/data-provider-g826-pm-types.yang @@ -4,7 +4,7 @@ module data-provider-g826-pm-types { namespace "urn:opendaylight:params:xml:ns:yang:data-provider-g836-pm-types"; prefix pmt; - import data-provider-v2 { + import data-provider { prefix uxp; } diff --git a/sdnr/wt/data-provider/model/src/main/yang/data-provider-openroadm-pm-types.yang b/sdnr/wt/data-provider/model/src/main/yang/data-provider-openroadm-pm-types.yang index 2a3fb17a8..2e3a2608a 100644 --- a/sdnr/wt/data-provider/model/src/main/yang/data-provider-openroadm-pm-types.yang +++ b/sdnr/wt/data-provider/model/src/main/yang/data-provider-openroadm-pm-types.yang @@ -4,7 +4,7 @@ module data-provider-openroadm-pm-types { namespace "urn:opendaylight:params:xml:ns:yang:data-provider-openroadm-pm-types"; prefix pmt; - import data-provider-v2 { + import data-provider { prefix uxp; } diff --git a/sdnr/wt/data-provider/model/src/main/yang/data-provider-units.yang b/sdnr/wt/data-provider/model/src/main/yang/data-provider-units.yang index e8979396f..7ff9e71d3 100644 --- a/sdnr/wt/data-provider/model/src/main/yang/data-provider-units.yang +++ b/sdnr/wt/data-provider/model/src/main/yang/data-provider-units.yang @@ -4,7 +4,7 @@ module data-provider-units { namespace "urn:opendaylight:params:xml:ns:yang:data-provider-units"; prefix unit; - import data-provider-v2 { + import data-provider { prefix uxp; } diff --git a/sdnr/wt/data-provider/model/src/main/yang/data-provider@2019-08-01.yang b/sdnr/wt/data-provider/model/src/main/yang/data-provider@2019-08-01.yang deleted file mode 100644 index 46505cd8f..000000000 --- a/sdnr/wt/data-provider/model/src/main/yang/data-provider@2019-08-01.yang +++ /dev/null @@ -1,1674 +0,0 @@ -module data-provider { - - yang-version 1.1; - namespace "urn:opendaylight:params:xml:ns:yang:data-provider"; - prefix odluxprovider; - - import ietf-yang-types { - prefix yang; - reference - "RFC 6991: Common YANG Data Types."; - } - - organization - "highstreet technologies GmbH"; - contact - "Web: <https://highstreet-technologies.com> - ONAP: <https://wiki.onap.org/display/DW/ODLUX+DB+API>"; - - description - "This module defines the API for the data-provider component. - - Copyright 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."; - - revision 2019-08-01 { - description - "Initial revision"; - reference - "https://jira.onap.org/browse/SDNC-879"; - } - - // --- typedef - - typedef Entity { - type enumeration { - enum connectionlog { - description - "logs mountpoint connection state changes"; - } - enum faultcurrent { - description - "current faults"; - } - enum eventlog { - description - "logs for all notifications e.g. NetConf, ves and internal events"; - } - enum faultlog { - description - "faultlog information"; - } - enum historicalperformance15min { - description - "performance data"; - } - enum historicalperformance24h { - description - "performance data"; - } - enum mediator-server { - description - "list of mediator servers"; - } - enum networkelement-connection { - description - "list of mountpoints for NetConf devices (joint required-network-element+mdsal - state"; - } - enum inventoryequipment { - description - "list of equipment inventory"; - } - enum maintenancemode { - description - "list of maintenance setting"; - } - } - description - "Data type and alias for elasticsearch or table name for SQL database."; - } - - typedef SortOrder { - type enumeration { - enum ascending { - description - "Self explaining."; - } - enum descending { - description - "Self explaining."; - } - } - description - "Entities for odlux clients"; - } - - typedef FilterProperty { - type string; - description - "A string type describing a property (attribute, column, parameter) - filter"; - } - - typedef NotificationType { - type enumeration { - enum ProblemNotificationXml { - description - "A fault (alarm, problem) notification type in XML format."; - } - enum AttributeValueChangedNotificationXml { - description - "An attribute value change notification type in XML format."; - } - } - description - "An enumeration describing the found notification type."; - } - - typedef ConnectionLogStatus { - type enumeration { - enum Mounted { - description - "Mountpoint created"; - } - enum Unmounted { - description - "Mountpoint removed"; - } - enum Connecting { - description - "Mountpoint establishing connection"; - } - enum Connected { - description - "Mountpoint connection established"; - } - enum UnableToConnect { - description - "Mountpoint connection not possible"; - } - enum Disconnected { - description - "Required and mountpoint removed"; - } - enum Undefined { - description - "Status not available"; - } - } - description - "An enumeration describing connection states."; - } - - typedef NetworkElementDeviceType { - type enumeration { - enum Wireless { - description - "implements microwave-model.yang or air-interface.yang"; - } - enum RAN { - description - "implements sth. like o-ran*.yang"; - } - enum ORAN { - description - "implements RAN according to o-ran*.yang"; - } - enum RAN3GPP { - description - "implements RAN according to _3gpp-ran*.yang"; - } - enum Optical { - description - "implements tapi-*.yang or org-openroadm*.yang"; - } - enum Router { - description - "implements vlan-interface.yang"; - } - enum NtsManager { - description - "Manage adapter to simulate devices"; - } - enum Nonsupported { - description - "Device type known, but not support"; - } - enum Unknown { - description - "Device type at this point of time unknown"; - } - enum O-RAN-FH { - description - "implements RAN according to o-ran*.yang fro for fronthaule"; - } - enum O-ROADM { - description - "implements Open ROADM"; - } - enum O1-TR069 { - description - "implements O1 RAN interface according to TR069"; - } - } - description - "An enumeration as identification of the device."; - } - - typedef severity-type { - type enumeration { - enum NonAlarmed { - description - "problem cleared indication"; - } - enum Warning { - description - "problem level"; - } - enum Minor { - description - "problem level"; - } - enum Major { - description - "problem level"; - } - enum Critical { - description - "problem level"; - } - } - description - "According to ITU-T M.3160"; - } - - typedef source-type { - type enumeration { - enum Ves { - description - "VES Interface"; - } - enum Netconf { - description - "NetConf Interface"; - } - enum Controller { - description - "SDN Controller"; - } - enum Unknown { - description - "Unknown source"; - } - } - description - "An enumeration for the information source of an event/notification."; - } - - typedef granularity-period-type { - type enumeration { - enum unknown { - description - "none"; - } - enum period-15-min { - description - "none"; - } - enum period-24-hours { - description - "none"; - } - } - description - "The enumeration with the options for granularity period of the - performance data similar to g.874.1-model"; - } - - // --- grouping and builder-container - - grouping connectionlog-entity { - leaf id { - type string; - description - "database id"; - } - leaf node-id { - type string; - description - "the node/mountpoint which connection state has changed"; - } - leaf timestamp { - type yang:date-and-time; - description - "timestamp when event happened, preferred in UTC time format."; - } - leaf status { - type ConnectionLogStatus; - description - "new state of the connection of the device"; - } - description - "An object class describing an entry in the connection status log."; - } - - container connectionlog { - description - "builder"; - uses connectionlog-entity; - } - - grouping object-change-reference { - description - "Reference of of object (e.g. Interface pack) owned by a node"; - leaf node-id { - type string; - description - "A network wide unique identifier of the NetConf server."; - } - leaf counter { - type int32; - description - "An arbitrary counter value."; - } - leaf timestamp { - type yang:date-and-time; - description - "The time of the reported change, preferred in UTC time format. "; - } - leaf object-id { - type string; - description - "The identifier of the reporting object (resource)."; - } - } - - grouping source-reference { - description - "Identify a source"; - leaf source-type { - type source-type; - description - "The source type."; - } - } - - grouping fault { - description - "Fault event of an object"; - leaf problem { - type string; - description - "The alarm type identifier."; - } - leaf severity { - type severity-type; - description - "The reported severity of the fault (alarm)."; - } - } - - grouping attribute-change { - description - "update change of an attribute"; - leaf attribute-name { - type string; - description - "The attribute name which was changed."; - } - leaf new-value { - type string; - description - "The new value of the attribute converted to a string format."; - } - } - - grouping entity-id { - description - "Unique database id of entity"; - leaf id { - type string; - description - "The unique identifier of the entity."; - } - } - - grouping faultcurrent-entity { - description - "Current fault status"; - uses object-change-reference; - uses fault; - uses entity-id; - } - - container faultcurrent { - description - "builder"; - uses faultcurrent-entity; - } - - grouping faultlog-entity { - description - "Changed fault indication"; - uses source-reference; - uses object-change-reference; - uses fault; - uses entity-id; - } - - container faultlog { - description - "builder"; - uses faultlog-entity; - } - - grouping eventlog-entity { - description - "One change event of devices"; - uses source-reference; - uses object-change-reference; - uses attribute-change; - uses entity-id; - } - - container eventlog { - description - "builder"; - uses eventlog-entity; - } - - grouping filter { - leaf description { - type string; - description - "Filter specific description"; - } - leaf start { - type yang:date-and-time; - description - "begin of maintenance-mode"; - } - leaf end { - type yang:date-and-time; - description - "end of maintenance-mode"; - } - leaf object-id-ref { - type string; - description - "object id to filter on, or empty for all"; - } - leaf problem { - type string; - description - "name of the problem to filter or empty for all"; - } - description - "An object class describing a generic filter of an interval for - faults (alarms)."; - } - - grouping maintenance-entity { - description - "Maintenance mode for a device. "; - leaf id { - type string; - mandatory true; - description - "Key to get/set configuration entry in database. Normally Mountpoint - name is used as key id of node."; - } - leaf node-id { - type string; - mandatory true; - description - "A network wide unique identifier of the NetConf server."; - } - leaf active { - type boolean; - description - "Configuration to activate or deactivate this entry"; - } - uses filter; - } - - container maintenance { - presence "false"; - description - "builder"; - uses maintenance-entity; - } - - grouping mediator-server-entity { - leaf id { - type string; - mandatory true; - description - "A network unique identifier of the mediator server."; - } - leaf url { - type string; - description - "The ULR to reach the REST interface of the mediator server."; - } - leaf name { - type string; - description - "A human readable name of the mediator server."; - } - description - "An object class describing a mediator server entity."; - } - - grouping pmdata-base { - description - "Performance data base information"; - leaf node-name { - type string; - description - "A network unique identifier of reporting NetConf server."; - } - leaf uuid-interface { - type string; - description - "A universal unique identifier of the performance monitoring point."; - } - leaf layer-protocol-name { - type string; - description - "The name of the measured transport layer."; - } - leaf radio-signal-id { - type string; - description - "The value exists only of wireless transport devices."; - } - leaf time-stamp { - type yang:date-and-time; - description - "The time-stamp of the measurement, preferred in UTC format."; - } - leaf suspect-interval-flag { - type boolean; - description - "If false, the measurement is not completed and should not be used - for performance analysis. "; - } - leaf granularity-period { - type granularity-period-type; - description - "The expected measurement interval."; - } - leaf scanner-id { - type string; - description - "See ITU-T X.739 chapter 8.1.1.2."; - } - } - - grouping pmdata-microwave { - description - "Consolidated performance information of all microwave model interface - PACs"; - leaf es { - type int32; - units "s"; - default "-1"; - config false; - description - "Number of errored seconds."; - } - leaf ses { - type int32; - units "s"; - default "-1"; - config false; - description - "Number of severely errored seconds."; - } - leaf cses { - type int32; - units "s"; - default "-1"; - config false; - description - "Number of consecutive severely errored seconds."; - } - leaf unavailability { - type int32; - units "s"; - default "-1"; - config false; - description - "Total time of unavailability in seconds."; - } - leaf tx-level-min { - type int8; - units "dBm"; - default "99"; - config false; - description - "Minimum transmit power. Signed integers are required."; - } - leaf tx-level-max { - type int8; - units "dBm"; - default "99"; - config false; - description - "Maximum transmit power. Signed integers are required."; - } - leaf tx-level-avg { - type int8; - units "dBm"; - default "99"; - config false; - description - "Averaged transmit power. Signed integers are required."; - } - leaf rx-level-min { - type int8; - units "dBm"; - default "99"; - config false; - description - "Minimum receive level. Signed integers are required."; - } - leaf rx-level-max { - type int8; - units "dBm"; - default "99"; - config false; - description - "Maximum receive level. Signed integers are required."; - } - leaf rx-level-avg { - type int8; - units "dBm"; - default "99"; - config false; - description - "Averaged receive level. Signed integers are required."; - } - leaf time2-states { - type int32; - units "s"; - default "-1"; - config false; - description - "Sum of all seconds the transmitter operated in e.g. BPSK."; - } - leaf time4-states-s { - type int32; - units "s"; - default "-1"; - config false; - description - "none"; - } - leaf time4-states { - type int32; - units "s"; - default "-1"; - config false; - description - "none"; - } - leaf time8-states { - type int32; - units "s"; - default "-1"; - config false; - description - "none"; - } - leaf time16-states-s { - type int32; - units "s"; - default "-1"; - config false; - description - "none"; - } - leaf time16-states { - type int32; - units "s"; - default "-1"; - config false; - description - "none"; - } - leaf time32-states { - type int32; - units "s"; - default "-1"; - config false; - description - "none"; - } - leaf time64-states { - type int32; - units "s"; - default "-1"; - config false; - description - "none"; - } - leaf time128-states { - type int32; - units "s"; - default "-1"; - config false; - description - "none"; - } - leaf time256-states { - type int32; - units "s"; - default "-1"; - config false; - description - "none"; - } - leaf time512-states { - type int32; - units "s"; - default "-1"; - config false; - description - "none"; - } - leaf time512-states-l { - type int32; - units "s"; - default "-1"; - config false; - description - "none"; - } - leaf time1024-states { - type int32; - units "s"; - default "-1"; - config false; - description - "none"; - } - leaf time1024-states-l { - type int32; - units "s"; - default "-1"; - config false; - description - "none"; - } - leaf time2048-states { - type int32; - units "s"; - default "-1"; - config false; - description - "none"; - } - leaf time2048-states-l { - type int32; - units "s"; - default "-1"; - config false; - description - "none"; - } - leaf time4096-states { - type int32; - units "s"; - default "-1"; - config false; - description - "none"; - } - leaf time4096-states-l { - type int32; - units "s"; - default "-1"; - config false; - description - "none"; - } - leaf time8192-states { - type int32; - units "s"; - default "-1"; - config false; - description - "none"; - } - leaf time8192-states-l { - type int32; - units "s"; - default "-1"; - config false; - description - "none"; - } - leaf snir-min { - type int8; - units "dB"; - default "-99"; - config false; - description - "Minimum signal to (noise+interference) ratio."; - } - leaf snir-max { - type int8; - units "dB"; - default "-99"; - config false; - description - "Maximum signal to (noise+interference) ratio."; - } - leaf snir-avg { - type int8; - units "dB"; - default "-99"; - config false; - description - "Averaged signal to (noise+interference) ratio."; - } - leaf xpd-min { - type int8; - units "dB"; - default "-99"; - config false; - description - "Minimum cross polarization discrimination."; - } - leaf xpd-max { - type int8; - units "dB"; - default "-99"; - config false; - description - "Maximum cross polarization discrimination."; - } - leaf xpd-avg { - type int8; - units "dB"; - default "-99"; - config false; - description - "Averaged cross polarization discrimination."; - } - leaf rf-temp-min { - type int8; - units "C"; - default "-99"; - config false; - description - "Lowest temperature (in degree Celsius) of the radio module inside the - outdoor unit."; - } - leaf rf-temp-max { - type int8; - units "C"; - default "-99"; - config false; - description - "Highest temperature (in degree Celsius) of the radio module inside the - outdoor unit."; - } - leaf rf-temp-avg { - type int8; - units "C"; - default "-99"; - config false; - description - "Averaged temperature (in degree Celsius) of the radio module inside - the outdoor unit."; - } - leaf defect-blocks-sum { - type int16; - units "blocks"; - default "-1"; - config false; - description - "Total number of blocks that were defect after receiving and could not - be corrected by the FEC."; - } - leaf time-period { - type int32; - units "s"; - default "-1"; - config false; - description - "Total length of the measurement period."; - } - } - - grouping pmdata-ethernet { - description - "Consolidated performance information for Ethernet."; - leaf tx-ethernet-bytes-max-s { - type int32; - units "Bytes/s"; - default "-1"; - config false; - description - "Counts the number of Bytes of Ethernet traffic (before header - compression) transmitted within a second and keeps the highest value - within the measurement period. Field to be left blank for all types of - TDM containers."; - } - leaf tx-ethernet-bytes-max-m { - type int64; - units "Bytes/min"; - default "-1"; - config false; - description - "Counts the number of Bytes of Ethernet traffic (before header - compression) transmitted within a minute and keeps the highest value - with in the measurement period. Field to be left blank for all types - of TDM containers."; - } - leaf tx-ethernet-bytes-sum { - type int64; - units "Bytes"; - default "-1"; - config false; - description - "Total number of Bytes of Ethernet traffic (before header compression) - transmitted (in direction out of the device) during the measurement - period. Field to be left blank for all types of TDM containers."; - } - } - - container pmdata-entity { - description - "builder"; - uses pmdata-base; - container performance-data { - uses pmdata-microwave; - uses pmdata-ethernet; - description - "An object combining different performance monitoring data."; - } - } - - grouping pmdata15m-entity { - uses pmdata-base; - container performance-data { - uses pmdata-microwave; - uses pmdata-ethernet; - description - "An object combining different performance monitoring data."; - } - description - "An object class describing a 15 minute performance monitoring entity."; - } - - grouping pmdata24h-entity { - uses pmdata-base; - container performance-data { - uses pmdata-microwave; - uses pmdata-ethernet; - description - "An object combining different performance monitoring data."; - } - description - "An object class describing a 24 hour performance monitoring entity."; - } - - grouping inventory-entity { - description - "One equipment entity in a list of a network element that could be rack, - card, backplane, module"; - leaf id { - type string; - mandatory true; - description - "Unique database id, node-id/uuid"; - } - leaf tree-level { - type uint32; - description - "Containment level, starting with 0.."; - } - leaf parent-uuid { - type string; - description - "Unique inventory id of holder"; - } - leaf node-id { - type string; - description - "Unique node id of network element"; - } - leaf uuid { - type string; - description - "Unique inventory id of this node for this equipment, provided by - network element"; - } - leaf-list contained-holder { - type string; - description - "List of uuid of contained equipment"; - } - leaf manufacturer-name { - type string; - description - "manufactured-thing/manufacturer-properties/manufacturer-name"; - } - leaf manufacturer-identifier { - type string; - description - "manufactured-thing/manufacturer-properties/manufacturer-identifier"; - } - leaf serial { - type string; - description - "manufactured-thing/equipment-instance/serial"; - } - leaf date { - type string; - description - "manufactured-thing/equipment-instance/manufacture-date: Date - information provided by manufacturer. No specific format. ()"; - } - leaf version { - type string; - description - "manufactured-thing/equipment-type/version"; - } - leaf description { - type string; - description - "manufactured-thing/equipment-type/description"; - } - leaf part-type-id { - type string; - description - "manufactured-thing/equipment-type/part-type-identifier"; - } - leaf model-identifier { - type string; - description - "manufactured-thing/equipment-type/model-identifier"; - } - leaf type-name { - type string; - description - "manufactured-thing/equipment-type/type-name"; - } - } - - container inventory { - presence "false"; - description - "builder"; - uses inventory-entity; - } - - grouping node-details-g { - leaf-list available-capabilities { - type string; - description - "The list of available yang capabilities."; - } - leaf-list unavailable-capabilities { - type string; - description - "The list of unavailable yang capabilities."; - } - description - "An object class description the available and unavailable yang - capabilities."; - } - - grouping network-element-connection-entity { - leaf id { - type string; - description - "database id/key. here is equal to node-id"; - } - leaf node-id { - type string; - description - "mountpoint name of device in controller"; - } - leaf host { - type string; - description - "NetConf server host name or IP address of device"; - } - leaf port { - type uint32; - description - "NetConf port of device"; - } - leaf username { - type string; - description - "NetConf user name"; - } - leaf password { - type string; - description - "NetConf password. should be removed asap"; - } - leaf core-model-capability { - type string; - description - "revision of core-model capability"; - } - leaf device-type { - type NetworkElementDeviceType; - description - "categorized type of device based on implemented yang specs"; - } - leaf is-required { - type boolean; - description - "entry exists in db index required-networkelement"; - } - container node-details { - uses node-details-g; - description - "holder of available and unavailable capabilities"; - } - leaf status { - type ConnectionLogStatus; - description - "current connection status. default Disconnected"; - } - description - "An object class defining the NetConf connection towards a - NetConf server. "; - } - - container network-element-connection { - description - "builder"; - uses network-element-connection-entity; - } - - grouping status-entity { - container faults { - leaf criticals { - type uint32; - description - "The number of current faults (active alarms) with severity - 'critical'."; - } - leaf majors { - type uint32; - description - "The number of current faults (active alarms) with severity - 'major'."; - } - leaf minors { - type uint32; - description - "The number of current faults (active alarms) with severity - 'minor'."; - } - leaf warnings { - type uint32; - description - "The number of current faults (active alarms) with severity - 'warning'."; - } - description - "An object containing the number of current faults per its severity."; - } - description - "An object class defining an status entity for current faults - (also called active alarms)."; - } - - container status { - description - "builder"; - uses status-entity; - } - - grouping entity-input { - list filter { - key "property"; - leaf property { - type string; - description - "The property (parameter, column, field) identifier."; - } - leaf filtervalue { - type string; - description - "The filter information for the corresponding property."; - } - description - "List with filter criteria. Not listed means all."; - } - list sortorder { - key "property"; - leaf property { - type string; - description - "The property (parameter, column, field) identifier."; - } - leaf sortorder { - type SortOrder; - description - "The definition of the sort order for the corresponding property."; - } - description - "List with sort order. Not listed means default"; - } - container pagination { - leaf size { - type uint32 { - range "1..max"; - } - default "20"; - description - "Number of entries to be delivered"; - } - leaf page { - type uint64 { - range "1..max"; - } - default "1"; - description - "Number to be used to calculate starting entry to deliver"; - } - description - "An object defining the pagination details."; - } - description - "An object class defining a request input entity."; - } - - grouping pagination-output-g { - leaf size { - type uint32 { - range "1..max"; - } - default "20"; - description - "Number of entries to be delivered"; - } - leaf page { - type uint64 { - range "1..max"; - } - default "1"; - description - "Number to be used to calculate starting entry to deliver"; - } - leaf total { - type uint64 { - range "0..max"; - } - default "0"; - description - "Number to be used to calculate starting entry to deliver"; - } - description - "An object class defining the filter information for pagination."; - } - - container pagination-output { - description - "builder"; - uses pagination-output-g; - } - - // --- rpc - - rpc read-faultcurrent-list { - description - "Get list of current fault (active alarm) entries according to filter"; - input { - uses entity-input; - } - output { - container pagination { - uses pagination-output-g; - description - "The pagination details used by the provider to filter the data."; - } - list data { - uses faultcurrent-entity; - description - "The output data as list of current fault (or active alarm) - entities."; - } - } - } - - rpc read-faultlog-list { - description - "Get list of faultlog entries according to filter"; - input { - uses entity-input; - } - output { - container pagination { - uses pagination-output-g; - description - "The pagination details used by the provider to filter the data."; - } - list data { - uses faultlog-entity; - description - "The output data as list of fault entities."; - } - } - } - - rpc read-eventlog-list { - description - "Get list of event log entities according to filter"; - input { - uses entity-input; - } - output { - container pagination { - uses pagination-output-g; - description - "The pagination details used by the provider to filter the data."; - } - list data { - uses eventlog-entity; - description - "The output data as list of event log entities."; - } - } - } - - rpc read-connectionlog-list { - description - "Get list of event log entities according to filter"; - input { - uses entity-input; - } - output { - container pagination { - uses pagination-output-g; - description - "The pagination details used by the provider to filter the data."; - } - list data { - uses connectionlog-entity; - description - "The output data as list of connection log entities."; - } - } - } - - rpc read-maintenance-list { - description - "Get list of maintenance entries according to filter"; - input { - uses entity-input; - } - output { - container pagination { - uses pagination-output-g; - description - "The pagination details used by the provider to filter the data."; - } - list data { - uses maintenance-entity; - description - "The output data as list of maintenance entities."; - } - } - } - - rpc create-maintenance { - description - "insert new entry of maintenance"; - input { - uses maintenance-entity; - } - output { - uses maintenance-entity; - } - } - - rpc update-maintenance { - description - "update existing entity of maintenance"; - input { - uses maintenance-entity; - } - output { - uses maintenance-entity; - } - } - - rpc delete-maintenance { - description - "delete entity of maintenance"; - input { - uses maintenance-entity; - } - } - - rpc read-mediator-server-list { - description - "Get list of mediator-servers according to filter"; - input { - uses entity-input; - } - output { - container pagination { - uses pagination-output-g; - description - "The pagination details used by the provider to filter the data."; - } - list data { - uses mediator-server-entity; - description - "The list of found mediator server entities."; - } - } - } - - rpc create-mediator-server { - description - "create new entry of entity mediator-server"; - input { - uses mediator-server-entity; - } - output { - uses mediator-server-entity; - } - } - - rpc update-mediator-server { - description - "update entry of entity mediator-server"; - input { - uses mediator-server-entity; - } - output { - uses mediator-server-entity; - } - } - - rpc delete-mediator-server { - description - "delete entry of entity mediator-server"; - input { - uses mediator-server-entity; - } - } - - rpc read-network-element-connection-list { - description - "Get list of networkelement-connections according to filter"; - input { - uses entity-input; - } - output { - container pagination { - uses pagination-output-g; - description - "The pagination details used by the provider to filter the data."; - } - list data { - uses network-element-connection-entity; - description - "The output data as list of found network-element (or mountpoint, - or network functions) connection entities."; - } - } - } - - rpc create-network-element-connection { - description - "create entry in networkelement-connection"; - input { - uses network-element-connection-entity; - } - output { - uses network-element-connection-entity; - } - } - - rpc update-network-element-connection { - description - "Put an element to ne-entity"; - input { - uses network-element-connection-entity; - } - output { - uses network-element-connection-entity; - } - } - - rpc delete-network-element-connection { - description - "!ONLY FOR TESTING! Put an element to ne-entity"; - input { - uses network-element-connection-entity; - } - } - - rpc read-pmdata-15m-ltp-list { - description - "Get list of ltps for one mountpoint with historical pmdata"; - input { - uses entity-input; - } - output { - container pagination { - uses pagination-output-g; - description - "The pagination details used by the provider to filter the data."; - } - leaf-list data { - type string; - description - "The list of found mountpoint names."; - } - } - } - - rpc read-pmdata-24h-ltp-list { - description - "Get list of ltps for one mountpoint with historical pmdata"; - input { - uses entity-input; - } - output { - container pagination { - uses pagination-output-g; - description - "The pagination details used by the provider to filter the data."; - } - leaf-list data { - type string; - description - "The list of found logical-termination-point identifiers."; - } - } - } - - rpc read-pmdata-15m-device-list { - description - "Get list of mountpoints with historical pmdata"; - input { - uses entity-input; - } - output { - container pagination { - uses pagination-output-g; - description - "The pagination details used by the provider to filter the data."; - } - leaf-list data { - type string; - description - "The list of found mountpoint names."; - } - } - } - - rpc read-pmdata-24h-device-list { - description - "Get list of mountpoints with historical pmdata"; - input { - uses entity-input; - } - output { - container pagination { - uses pagination-output-g; - description - "The pagination details used by the provider to filter the data."; - } - leaf-list data { - type string; - description - "The list of found mountpoint names."; - } - } - } - - rpc read-pmdata-15m-list { - description - "Get list of entities according to filter"; - input { - uses entity-input; - } - output { - container pagination { - uses pagination-output-g; - description - "The pagination details used by the provider to filter the data."; - } - list data { - uses pmdata15m-entity; - description - "The output data as list of 15 minutes performance monitoring - entities."; - } - } - } - - rpc read-pmdata-24h-list { - description - "Get list of historical pmdata according to filter"; - input { - uses entity-input; - } - output { - container pagination { - uses pagination-output-g; - description - "The pagination details used by the provider to filter the data."; - } - list data { - uses pmdata24h-entity; - description - "The output data as list of 24 hours performance monitoring - entities."; - } - } - } - - rpc read-inventory-list { - description - "Get list of inventory according to filter"; - input { - uses entity-input; - } - output { - container pagination { - uses pagination-output-g; - description - "The pagination details used by the provider to filter the data."; - } - list data { - uses inventory-entity; - description - "The output data as list of inventory entities."; - } - } - } - - rpc read-status { - description - "Read status information of controller"; - output { - list data { - uses status-entity; - description - "The output data as list of status entities."; - } - } - } -} diff --git a/sdnr/wt/data-provider/model/src/main/yang/data-provider-v2@2020-07-02.yang b/sdnr/wt/data-provider/model/src/main/yang/data-provider@2020-11-10.yang index 47cc009f1..8509007e1 100644 --- a/sdnr/wt/data-provider/model/src/main/yang/data-provider-v2@2020-07-02.yang +++ b/sdnr/wt/data-provider/model/src/main/yang/data-provider@2020-11-10.yang @@ -1,22 +1,22 @@ -module data-provider-v2 { - +module data-provider { + yang-version 1.1; - namespace "urn:opendaylight:params:xml:ns:yang:data-provider-v2"; + namespace "urn:opendaylight:params:xml:ns:yang:data-provider"; prefix odluxprovider; - import org-openroadm-pm-types { - prefix org-openroadm-pm-types; - revision-date 2019-11-29; - reference - "OpenROADM: YANG definitions of performance management types"; - } - import ietf-yang-types { prefix yang; reference "RFC 6991: Common YANG Data Types."; } + import org-openroadm-pm-types { + prefix org-openroadm-pm-types; + revision-date 2019-11-29; + reference + "OpenROADM: YANG definitions of performance management types"; + } + organization "highstreet technologies GmbH"; contact @@ -41,11 +41,18 @@ module data-provider-v2 { See the License for the specific language governing permissions and limitations under the License."; - revision 2020-07-02 { + revision 2020-11-10 { + description + "Support for GUI Cut through and V2 PM model"; + reference + "https://jira.onap.org/browse/SDNC-1396"; + } + + revision 2019-08-01 { description "Initial revision"; reference - "https://jira.onap.org/browse/SDNC-xxx"; + "https://jira.onap.org/browse/SDNC-879"; } // --- typedef @@ -93,6 +100,10 @@ module data-provider-v2 { description "list of maintenance setting"; } + enum guicutthrough { + description + "list of GUI Cut through entries"; + } } description "Data type and alias for elasticsearch or table name for SQL database."; @@ -198,7 +209,7 @@ module data-provider-v2 { } enum NtsManager { description - "Simulation of device"; + "Manage adapter to simulate devices"; } enum Nonsupported { description @@ -208,6 +219,18 @@ module data-provider-v2 { description "Device type at this point of time unknown"; } + enum O-RAN-FH { + description + "implements RAN according to o-ran*.yang fro for fronthaule"; + } + enum O-ROADM { + description + "implements Open ROADM"; + } + enum O1-TR069 { + description + "implements O1 RAN interface according to TR069"; + } } description "An enumeration as identification of the device."; @@ -279,9 +302,25 @@ module data-provider-v2 { } } description - "The enumeration with the options for granularity period of the + "The enumeration with the options for granularity period of the performance data similar to g.874.1-model"; } + + typedef entity-type { + type enumeration { + enum device { + description + "none"; + } + enum ltp { + description + "none"; + } + } + description + "The enumeration with the type of requested information"; + } + // --- grouping and builder-container @@ -473,7 +512,7 @@ module data-provider-v2 { type string; mandatory true; description - "Key to get/set configuration entry in database. Normally Mountpoint + "Key to get/set configuration entry in database. Normally Mountpoint name is used as key id of node."; } leaf node-id { @@ -566,7 +605,7 @@ module data-provider-v2 { grouping pmdata-microwave { description - "Consolidated performance information of all microwave model interface + "Consolidated performance information of all microwave model interface PACs"; leaf es { type int32; @@ -862,7 +901,7 @@ module data-provider-v2 { default "-99"; config false; description - "Lowest temperature (in degree Celsius) of the radio module inside the + "Lowest temperature (in degree Celsius) of the radio module inside the outdoor unit."; } leaf rf-temp-max { @@ -871,7 +910,7 @@ module data-provider-v2 { default "-99"; config false; description - "Highest temperature (in degree Celsius) of the radio module inside the + "Highest temperature (in degree Celsius) of the radio module inside the outdoor unit."; } leaf rf-temp-avg { @@ -880,7 +919,7 @@ module data-provider-v2 { default "-99"; config false; description - "Averaged temperature (in degree Celsius) of the radio module inside + "Averaged temperature (in degree Celsius) of the radio module inside the outdoor unit."; } leaf defect-blocks-sum { @@ -889,7 +928,7 @@ module data-provider-v2 { default "-1"; config false; description - "Total number of blocks that were defect after receiving and could not + "Total number of blocks that were defect after receiving and could not be corrected by the FEC."; } leaf time-period { @@ -911,9 +950,9 @@ module data-provider-v2 { default "-1"; config false; description - "Counts the number of Bytes of Ethernet traffic (before header - compression) transmitted within a second and keeps the highest value - within the measurement period. Field to be left blank for all types of + "Counts the number of Bytes of Ethernet traffic (before header + compression) transmitted within a second and keeps the highest value + within the measurement period. Field to be left blank for all types of TDM containers."; } leaf tx-ethernet-bytes-max-m { @@ -922,9 +961,9 @@ module data-provider-v2 { default "-1"; config false; description - "Counts the number of Bytes of Ethernet traffic (before header - compression) transmitted within a minute and keeps the highest value - with in the measurement period. Field to be left blank for all types + "Counts the number of Bytes of Ethernet traffic (before header + compression) transmitted within a minute and keeps the highest value + with in the measurement period. Field to be left blank for all types of TDM containers."; } leaf tx-ethernet-bytes-sum { @@ -933,8 +972,8 @@ module data-provider-v2 { default "-1"; config false; description - "Total number of Bytes of Ethernet traffic (before header compression) - transmitted (in direction out of the device) during the measurement + "Total number of Bytes of Ethernet traffic (before header compression) + transmitted (in direction out of the device) during the measurement period. Field to be left blank for all types of TDM containers."; } } @@ -1006,6 +1045,7 @@ module data-provider-v2 { "An abstract object class representing a key-value pair for pm-measurement."; } + grouping pmdata-grp { list measurement { key pm-key; @@ -1036,6 +1076,7 @@ module data-provider-v2 { container performance-data { uses pmdata-microwave; uses pmdata-ethernet; + uses pmdata-grp; description "An object combining different performance monitoring data."; } @@ -1048,6 +1089,7 @@ module data-provider-v2 { container performance-data { uses pmdata-microwave; uses pmdata-ethernet; + uses pmdata-grp; description "An object combining different performance monitoring data."; } @@ -1057,7 +1099,7 @@ module data-provider-v2 { grouping inventory-entity { description - "One equipment entity in a list of a network element that could be rack, + "One equipment entity in a list of a network element that could be rack, card, backplane, module"; leaf id { type string; @@ -1083,7 +1125,7 @@ module data-provider-v2 { leaf uuid { type string; description - "Unique inventory id of this node for this equipment, provided by + "Unique inventory id of this node for this equipment, provided by network element"; } leaf-list contained-holder { @@ -1109,7 +1151,7 @@ module data-provider-v2 { leaf date { type string; description - "manufactured-thing/equipment-instance/manufacture-date: Date + "manufactured-thing/equipment-instance/manufacture-date: Date information provided by manufacturer. No specific format. ()"; } leaf version { @@ -1359,6 +1401,33 @@ module data-provider-v2 { uses pagination-output-g; } + grouping guicutthrough-entity { + leaf id { + type string; + mandatory true; + description + "Unique database id, node-id/uuid"; + } + leaf name { + type string; + description + "Mountpoint Name"; + } + leaf weburi { + type string; + description + "The URI of the system Web UI."; + } + description + "An object class defining the information for invoking GUI cut through to the device."; + } + + container guicutthrough { + description + "builder"; + uses guicutthrough-entity; + } + // --- rpc rpc read-faultcurrent-list { @@ -1746,4 +1815,24 @@ module data-provider-v2 { } } } + + rpc read-gui-cut-through-entry { + description + "Get GUI cut through entry according to filter"; + input { + uses entity-input; + } + output { + container pagination { + uses pagination-output-g; + description + "The pagination details used by the provider to filter the data."; + } + list data { + uses guicutthrough-entity; + description + "The output data as list of found GUI Cut through entities"; + } + } + } } diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/ElasticSearchDataProvider.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/ElasticSearchDataProvider.java index e8d573b79..7a30542b4 100644 --- a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/ElasticSearchDataProvider.java +++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/ElasticSearchDataProvider.java @@ -34,44 +34,47 @@ import org.onap.ccsdk.features.sdnr.wt.dataprovider.data.entity.HtDatabaseMainte import org.onap.ccsdk.features.sdnr.wt.dataprovider.data.rpctypehelper.QueryResult; import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider; import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.HtDatabaseMaintenance; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateMaintenanceInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateMaintenanceOutputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateMediatorServerInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateMediatorServerOutputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateNetworkElementConnectionOutputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.DeleteMaintenanceInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.DeleteMaintenanceOutputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.DeleteMediatorServerInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.DeleteMediatorServerOutputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.DeleteNetworkElementConnectionInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.DeleteNetworkElementConnectionOutputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Entity; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.EntityInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.MaintenanceEntity; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.MediatorServerEntity; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.NetworkElementConnectionEntity; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadConnectionlogListOutputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadEventlogListInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadEventlogListOutputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadFaultcurrentListOutputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadFaultlogListOutputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadInventoryListOutputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadMaintenanceListOutputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadMediatorServerListOutputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadNetworkElementConnectionListOutputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata15mDeviceListOutputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata15mListOutputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata15mLtpListOutputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata24hDeviceListOutputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata24hListOutputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata24hLtpListOutputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadStatusOutputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.UpdateMaintenanceInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.UpdateMaintenanceOutputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.UpdateMediatorServerInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.UpdateMediatorServerOutputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.UpdateNetworkElementConnectionInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.UpdateNetworkElementConnectionOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateMaintenanceInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateMaintenanceOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateMediatorServerInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateMediatorServerOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateNetworkElementConnectionOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.DeleteMaintenanceInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.DeleteMaintenanceOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.DeleteMediatorServerInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.DeleteMediatorServerOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.DeleteNetworkElementConnectionInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.DeleteNetworkElementConnectionOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Entity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EntityInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.MaintenanceEntity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.MediatorServerEntity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.NetworkElementConnectionEntity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadConnectionlogListOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadEventlogListInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadEventlogListOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadFaultcurrentListOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadFaultlogListOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadInventoryListOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadMaintenanceListOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadMediatorServerListOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadNetworkElementConnectionListOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadPmdata15mDeviceListOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadPmdata15mListOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadPmdata15mLtpListOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadPmdata24hDeviceListOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadPmdata24hListOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadPmdata24hLtpListOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadStatusOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.UpdateMaintenanceInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.UpdateMaintenanceOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.UpdateMediatorServerInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.UpdateMediatorServerOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.UpdateNetworkElementConnectionInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.UpdateNetworkElementConnectionOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Guicutthrough; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadGuiCutThroughEntryInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadGuiCutThroughEntryOutputBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -84,16 +87,17 @@ public class ElasticSearchDataProvider /*extends BaseStatusProvider /* implement private static final String EXCEPTION_UNABLE_TO_REMOVE_FROM_DATABASE = "unable to remove data from database"; private final HtDatabaseClient dbClient; - private final DataObjectAcessorWithId<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.faultcurrent.list.output.Data> eventRWFaultCurrent; - private final DataObjectAcessorWithId<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.faultlog.list.output.Data> eventRWFaultLog; - private final DataObjectAcessorWithId<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.mediator.server.list.output.Data> mediatorserverRW; - private final DataObjectAcessorWithId<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.maintenance.list.output.Data> maintenanceRW; - private final DataObjectAcessorWithId<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.inventory.list.output.Data> equipmentRW; - private final DataObjectAcessorWithId<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.connectionlog.list.output.Data> connnectionlogRW; - private final DataObjectAcessorWithId<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.eventlog.list.output.Data> eventlogRW; - private final DataObjectAcessorWithId<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.network.element.connection.list.output.Data> networkelementConnectionRW; - private final DataObjectAcessorPm<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._15m.list.output.Data> pm15mRW; - private final DataObjectAcessorPm<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._24h.list.output.Data> pm24hRW; + private final DataObjectAcessorWithId<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.faultcurrent.list.output.Data> eventRWFaultCurrent; + private final DataObjectAcessorWithId<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.faultlog.list.output.Data> eventRWFaultLog; + private final DataObjectAcessorWithId<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.mediator.server.list.output.Data> mediatorserverRW; + private final DataObjectAcessorWithId<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.maintenance.list.output.Data> maintenanceRW; + private final DataObjectAcessorWithId<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.gui.cut.through.entry.output.Data> guicutthroughRW; + private final DataObjectAcessorWithId<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.inventory.list.output.Data> equipmentRW; + private final DataObjectAcessorWithId<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.connectionlog.list.output.Data> connnectionlogRW; + private final DataObjectAcessorWithId<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.eventlog.list.output.Data> eventlogRW; + private final DataObjectAcessorWithId<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.network.element.connection.list.output.Data> networkelementConnectionRW; + private final DataObjectAcessorPm<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.pmdata._15m.list.output.Data> pm15mRW; + private final DataObjectAcessorPm<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.pmdata._24h.list.output.Data> pm24hRW; private final DataObjectAcessorStatus readStatus; private final HtDatabaseEventsService databaseService; @@ -115,37 +119,41 @@ public class ElasticSearchDataProvider /*extends BaseStatusProvider /* implement this.dbClient = HtDatabaseClient.getClient(hosts, authUsername, authPassword, trustAllCerts); this.mediatorserverRW = new DataObjectAcessorWithId<>(dbClient, Entity.MediatorServer, - org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.mediator.server.list.output.Data.class); + org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.mediator.server.list.output.Data.class); this.mediatorserverRW.setWriteInterface(MediatorServerEntity.class); this.maintenanceRW = new DataObjectAcessorWithId<>(dbClient, Entity.Maintenancemode, - org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.maintenance.list.output.Data.class); + org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.maintenance.list.output.Data.class); this.maintenanceRW.setWriteInterface(MaintenanceEntity.class); + this.guicutthroughRW = new DataObjectAcessorWithId<>(dbClient, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Entity.Guicutthrough, + org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.gui.cut.through.entry.output.Data.class); + this.guicutthroughRW.setWriteInterface(Guicutthrough.class); + this.equipmentRW = new DataObjectAcessorWithId<>(dbClient, Entity.Inventoryequipment, - org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.inventory.list.output.Data.class); + org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.inventory.list.output.Data.class); this.eventRWFaultCurrent = new DataObjectAcessorWithId<>(dbClient, Entity.Faultcurrent, - org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.faultcurrent.list.output.Data.class); + org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.faultcurrent.list.output.Data.class); this.eventRWFaultLog = new DataObjectAcessorWithId<>(dbClient, Entity.Faultlog, - org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.faultlog.list.output.Data.class); + org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.faultlog.list.output.Data.class); this.connnectionlogRW = new DataObjectAcessorWithId<>(dbClient, Entity.Connectionlog, - org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.connectionlog.list.output.Data.class); + org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.connectionlog.list.output.Data.class); this.eventlogRW = new DataObjectAcessorWithId<>(dbClient, Entity.Eventlog, - org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.eventlog.list.output.Data.class); + org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.eventlog.list.output.Data.class); this.networkelementConnectionRW = new DataObjectAcessorWithId<>(dbClient, Entity.NetworkelementConnection, - org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.network.element.connection.list.output.Data.class); + org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.network.element.connection.list.output.Data.class); this.networkelementConnectionRW.setWriteInterface(NetworkElementConnectionEntity.class); this.pm15mRW = new DataObjectAcessorPm<>(dbClient, Intervall.PMDATA15M, Entity.Historicalperformance15min, - org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._15m.list.output.Data.class); + org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.pmdata._15m.list.output.Data.class); this.pm24hRW = new DataObjectAcessorPm<>(dbClient, Intervall.PMDATA24H, Entity.Historicalperformance24h, - org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._24h.list.output.Data.class); + org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.pmdata._24h.list.output.Data.class); this.readStatus = new DataObjectAcessorStatus(dbClient, Entity.Faultcurrent); @@ -157,144 +165,144 @@ public class ElasticSearchDataProvider /*extends BaseStatusProvider /* implement * Provide access to model API */ - //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.faultcurrent.list.output.Data - //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.faultcurrent.list.output.PaginationBuilder + //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.faultcurrent.list.output.Data + //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.faultcurrent.list.output.PaginationBuilder //eventRWFaultCurrent public ReadFaultcurrentListOutputBuilder readFaultCurrentList(EntityInput input) { ReadFaultcurrentListOutputBuilder outputBuilder = new ReadFaultcurrentListOutputBuilder(); - QueryResult<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.faultcurrent.list.output.Data> result = + QueryResult<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.faultcurrent.list.output.Data> result = this.eventRWFaultCurrent.getData(input); outputBuilder.setData(result.getResult().getHits()); outputBuilder.setPagination( - new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.faultcurrent.list.output.PaginationBuilder( + new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.faultcurrent.list.output.PaginationBuilder( result.getPagination()).build()); return outputBuilder; } - //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.faultlog.list.output.Data - //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.faultlog.list.output.PaginationBuilder + //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.faultlog.list.output.Data + //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.faultlog.list.output.PaginationBuilder //eventRWFaultLog public ReadFaultlogListOutputBuilder readFaultLogList(EntityInput input) { ReadFaultlogListOutputBuilder outputBuilder = new ReadFaultlogListOutputBuilder(); - QueryResult<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.faultlog.list.output.Data> result = + QueryResult<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.faultlog.list.output.Data> result = this.eventRWFaultLog.getData(input); outputBuilder.setData(result.getResult().getHits()); outputBuilder.setPagination( - new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.faultlog.list.output.PaginationBuilder( + new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.faultlog.list.output.PaginationBuilder( result.getPagination()).build()); return outputBuilder; } - //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.maintenance.list.output.Data - //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.maintenance.list.output.PaginationBuilder + //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.maintenance.list.output.Data + //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.maintenance.list.output.PaginationBuilder //maintenanceRW public ReadMaintenanceListOutputBuilder readMaintenanceList(EntityInput input) { ReadMaintenanceListOutputBuilder outputBuilder = new ReadMaintenanceListOutputBuilder(); - QueryResult<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.maintenance.list.output.Data> result = + QueryResult<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.maintenance.list.output.Data> result = this.maintenanceRW.getData(input); outputBuilder.setData(result.getResult().getHits()); outputBuilder.setPagination( - new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.maintenance.list.output.PaginationBuilder( + new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.maintenance.list.output.PaginationBuilder( result.getPagination()).build()); return outputBuilder; } - //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.mediator.server.list.output.Data - //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.mediator.server.list.output.Pagination + //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.mediator.server.list.output.Data + //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.mediator.server.list.output.Pagination //mediatorserverRW public ReadMediatorServerListOutputBuilder readMediatorServerList(EntityInput input) { ReadMediatorServerListOutputBuilder outputBuilder = new ReadMediatorServerListOutputBuilder(); - QueryResult<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.mediator.server.list.output.Data> result = + QueryResult<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.mediator.server.list.output.Data> result = this.mediatorserverRW.getData(input); outputBuilder.setData(result.getResult().getHits()); outputBuilder.setPagination( - new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.mediator.server.list.output.PaginationBuilder( + new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.mediator.server.list.output.PaginationBuilder( result.getPagination()).build()); return outputBuilder; } - //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.network.element.connection.list.output.Data - //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.network.element.connection.list.output.PaginationBuilder + //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.network.element.connection.list.output.Data + //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.network.element.connection.list.output.PaginationBuilder //networkelementConnectionRW public ReadNetworkElementConnectionListOutputBuilder readNetworkElementConnectionList(EntityInput input) { ReadNetworkElementConnectionListOutputBuilder outputBuilder = new ReadNetworkElementConnectionListOutputBuilder(); - QueryResult<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.network.element.connection.list.output.Data> result = + QueryResult<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.network.element.connection.list.output.Data> result = this.networkelementConnectionRW.getData(input); outputBuilder.setData(result.getResult().getHits()); outputBuilder.setPagination( - new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.network.element.connection.list.output.PaginationBuilder( + new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.network.element.connection.list.output.PaginationBuilder( result.getPagination()).build()); return outputBuilder; } - //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.inventory.list.output.Data - //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.inventory.list.output.PaginationBuilder + //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.inventory.list.output.Data + //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.inventory.list.output.PaginationBuilder //equipmentRW public ReadInventoryListOutputBuilder readInventoryList(EntityInput input) { ReadInventoryListOutputBuilder outputBuilder = new ReadInventoryListOutputBuilder(); - QueryResult<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.inventory.list.output.Data> result = + QueryResult<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.inventory.list.output.Data> result = this.equipmentRW.getData(input); outputBuilder.setData(result.getResult().getHits()); outputBuilder.setPagination( - new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.inventory.list.output.PaginationBuilder( + new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.inventory.list.output.PaginationBuilder( result.getPagination()).build()); return outputBuilder; } - //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.inventory.list.output.Data - //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.inventory.list.output.PaginationBuilder + //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.inventory.list.output.Data + //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.inventory.list.output.PaginationBuilder //connnectionlogRW public ReadConnectionlogListOutputBuilder readConnectionlogList(EntityInput input) { ReadConnectionlogListOutputBuilder outputBuilder = new ReadConnectionlogListOutputBuilder(); - QueryResult<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.connectionlog.list.output.Data> result = + QueryResult<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.connectionlog.list.output.Data> result = this.connnectionlogRW.getData(input); outputBuilder.setData(result.getResult().getHits()); outputBuilder.setPagination( - new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.connectionlog.list.output.PaginationBuilder( + new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.connectionlog.list.output.PaginationBuilder( result.getPagination()).build()); return outputBuilder; } - //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.eventlog.list.output.Data - //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.eventlog.list.output.PaginationBuilder + //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.eventlog.list.output.Data + //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.eventlog.list.output.PaginationBuilder //eventlogRW public ReadEventlogListOutputBuilder readEventlogList(ReadEventlogListInput input) throws IOException { ReadEventlogListOutputBuilder outputBuilder = new ReadEventlogListOutputBuilder(); - QueryResult<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.eventlog.list.output.Data> result = + QueryResult<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.eventlog.list.output.Data> result = this.eventlogRW.getData(input); outputBuilder.setData(result.getResult().getHits()); outputBuilder.setPagination( - new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.eventlog.list.output.PaginationBuilder( + new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.eventlog.list.output.PaginationBuilder( result.getPagination()).build()); return outputBuilder; } - //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._15m.list.output.Data - //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._15m.list.output.PaginationBuilder + //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.pmdata._15m.list.output.Data + //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.pmdata._15m.list.output.PaginationBuilder public ReadPmdata15mListOutputBuilder readPmdata15mList(EntityInput input) { ReadPmdata15mListOutputBuilder outputBuilder = new ReadPmdata15mListOutputBuilder(); - QueryResult<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._15m.list.output.Data> result = + QueryResult<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.pmdata._15m.list.output.Data> result = this.pm15mRW.getData(input); outputBuilder.setData(result.getResult().getHits()); outputBuilder.setPagination( - new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._15m.list.output.PaginationBuilder( + new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.pmdata._15m.list.output.PaginationBuilder( result.getPagination()).build()); return outputBuilder; } - //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._24h.list.output.Data - //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._24h.list.output.Pagination + //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.pmdata._24h.list.output.Data + //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.pmdata._24h.list.output.Pagination public ReadPmdata24hListOutputBuilder readPmdata24hList(EntityInput input) { ReadPmdata24hListOutputBuilder outputBuilder = new ReadPmdata24hListOutputBuilder(); - QueryResult<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._24h.list.output.Data> result = + QueryResult<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.pmdata._24h.list.output.Data> result = this.pm24hRW.getData(input); outputBuilder.setData(result.getResult().getHits()); outputBuilder.setPagination( - new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._24h.list.output.PaginationBuilder( + new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.pmdata._24h.list.output.PaginationBuilder( result.getPagination()).build()); return outputBuilder; } @@ -303,7 +311,7 @@ public class ElasticSearchDataProvider /*extends BaseStatusProvider /* implement ReadPmdata15mLtpListOutputBuilder outputBuilder = new ReadPmdata15mLtpListOutputBuilder(); QueryResult<String> result = pm15mRW.getDataLtpList(input); outputBuilder.setPagination( - new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._15m.ltp.list.output.PaginationBuilder( + new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.pmdata._15m.ltp.list.output.PaginationBuilder( result.getPagination()).build()); outputBuilder.setData(result.getResult().getHits()); return outputBuilder; @@ -313,7 +321,7 @@ public class ElasticSearchDataProvider /*extends BaseStatusProvider /* implement ReadPmdata15mDeviceListOutputBuilder outputBuilder = new ReadPmdata15mDeviceListOutputBuilder(); QueryResult<String> result = pm15mRW.getDataDeviceList(input); outputBuilder.setPagination( - new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._15m.device.list.output.PaginationBuilder( + new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.pmdata._15m.device.list.output.PaginationBuilder( result.getPagination()).build()); outputBuilder.setData(result.getResult().getHits()); return outputBuilder; @@ -324,9 +332,9 @@ public class ElasticSearchDataProvider /*extends BaseStatusProvider /* implement QueryResult<String> result = pm24hRW.getDataLtpList(input); ReadPmdata24hLtpListOutputBuilder outputBuilder = new ReadPmdata24hLtpListOutputBuilder(); - new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._24h.ltp.list.output.PaginationBuilder(); + new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.pmdata._24h.ltp.list.output.PaginationBuilder(); outputBuilder.setPagination( - new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._24h.ltp.list.output.PaginationBuilder( + new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.pmdata._24h.ltp.list.output.PaginationBuilder( result.getPagination()).build()); outputBuilder.setData(result.getResult().getHits()); return outputBuilder; @@ -338,14 +346,14 @@ public class ElasticSearchDataProvider /*extends BaseStatusProvider /* implement ReadPmdata24hDeviceListOutputBuilder outputBuilder = new ReadPmdata24hDeviceListOutputBuilder(); outputBuilder.setPagination( - new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._24h.device.list.output.PaginationBuilder( + new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.pmdata._24h.device.list.output.PaginationBuilder( result.getPagination()).build()); outputBuilder.setData(result.getResult().getHits()); return outputBuilder; } public ReadStatusOutputBuilder readStatus() throws IOException { - QueryResult<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.status.output.Data> result = + QueryResult<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.status.output.Data> result = readStatus.getDataStatus(); ReadStatusOutputBuilder outputBuilder = new ReadStatusOutputBuilder(); @@ -453,6 +461,17 @@ public class ElasticSearchDataProvider /*extends BaseStatusProvider /* implement return builder; } + public ReadGuiCutThroughEntryOutputBuilder readGuiCutThroughEntry(EntityInput input) { + ReadGuiCutThroughEntryOutputBuilder outputBuilder = new ReadGuiCutThroughEntryOutputBuilder(); + QueryResult<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.gui.cut.through.entry.output.Data> result = + this.guicutthroughRW.getData(input); + outputBuilder.setData(result.getResult().getHits()); + outputBuilder.setPagination( + new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.gui.cut.through.entry.output.PaginationBuilder( + ).build()); + return outputBuilder; + } + public DataProvider getDataProvider() { return this.databaseService; } diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/MediatorServerDataProvider.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/MediatorServerDataProvider.java index 4998c3031..c4fe672cd 100644 --- a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/MediatorServerDataProvider.java +++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/MediatorServerDataProvider.java @@ -31,8 +31,8 @@ import org.onap.ccsdk.features.sdnr.wt.common.database.HtDatabaseClient; import org.onap.ccsdk.features.sdnr.wt.common.database.SearchResult; import org.onap.ccsdk.features.sdnr.wt.common.database.config.HostInfo; import org.onap.ccsdk.features.sdnr.wt.dataprovider.data.acessor.DataObjectAcessorWithId; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Entity; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.mediator.server.list.output.Data; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Entity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.mediator.server.list.output.Data; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/acessor/DataObjectAcessor.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/acessor/DataObjectAcessor.java index 90915fc63..0cd327bfc 100644 --- a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/acessor/DataObjectAcessor.java +++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/acessor/DataObjectAcessor.java @@ -27,8 +27,8 @@ import org.onap.ccsdk.features.sdnr.wt.common.database.queries.QueryBuilder; import org.onap.ccsdk.features.sdnr.wt.dataprovider.data.rpctypehelper.QueryByFilter; import org.onap.ccsdk.features.sdnr.wt.dataprovider.data.rpctypehelper.QueryResult; import org.onap.ccsdk.features.sdnr.wt.dataprovider.database.EsDataObjectReaderWriter2; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Entity; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.EntityInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Entity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EntityInput; import org.opendaylight.yangtools.yang.binding.DataObject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/acessor/DataObjectAcessorPm.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/acessor/DataObjectAcessorPm.java index aa9da01ad..9280a0602 100644 --- a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/acessor/DataObjectAcessorPm.java +++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/acessor/DataObjectAcessorPm.java @@ -31,8 +31,8 @@ import org.onap.ccsdk.features.sdnr.wt.common.database.responses.AggregationEntr import org.onap.ccsdk.features.sdnr.wt.common.database.responses.SearchResponse; import org.onap.ccsdk.features.sdnr.wt.dataprovider.data.rpctypehelper.QueryByFilter; import org.onap.ccsdk.features.sdnr.wt.dataprovider.data.rpctypehelper.QueryResult; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Entity; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.EntityInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Entity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EntityInput; import org.opendaylight.yangtools.yang.binding.DataObject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -80,7 +80,7 @@ public class DataObjectAcessorPm<T extends DataObject> extends DataObjectAcessor /** * get aggregated list of ltps for filter NODE_KEY - * + * * @param input * @return * @throws IOException @@ -105,7 +105,7 @@ public class DataObjectAcessorPm<T extends DataObject> extends DataObjectAcessor /** * get aggregated devices list - * + * * @param input filter should be empty/no filter handled, only sortorder for KEY ('node-name') * @return * @throws IOException diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/acessor/DataObjectAcessorStatus.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/acessor/DataObjectAcessorStatus.java index f6fc60e2f..3926d3f51 100644 --- a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/acessor/DataObjectAcessorStatus.java +++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/acessor/DataObjectAcessorStatus.java @@ -31,10 +31,10 @@ import org.onap.ccsdk.features.sdnr.wt.common.database.requests.SearchRequest; import org.onap.ccsdk.features.sdnr.wt.common.database.responses.AggregationEntries; import org.onap.ccsdk.features.sdnr.wt.common.database.responses.SearchResponse; import org.onap.ccsdk.features.sdnr.wt.dataprovider.data.rpctypehelper.QueryResult; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Entity; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.status.output.Data; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.status.output.DataBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.status.entity.FaultsBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Entity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.status.output.Data; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.status.output.DataBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.status.entity.FaultsBuilder; public class DataObjectAcessorStatus extends DataObjectAcessor<Data> { diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/acessor/DataObjectAcessorWithId.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/acessor/DataObjectAcessorWithId.java index accd1d894..a977890c9 100644 --- a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/acessor/DataObjectAcessorWithId.java +++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/acessor/DataObjectAcessorWithId.java @@ -22,7 +22,7 @@ package org.onap.ccsdk.features.sdnr.wt.dataprovider.data.acessor; import org.onap.ccsdk.features.sdnr.wt.common.database.HtDatabaseClient; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Entity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Entity; import org.opendaylight.yangtools.yang.binding.DataObject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/entity/FaultEntityManager.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/entity/FaultEntityManager.java index 46252651f..f1a43359c 100644 --- a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/entity/FaultEntityManager.java +++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/entity/FaultEntityManager.java @@ -24,9 +24,9 @@ package org.onap.ccsdk.features.sdnr.wt.dataprovider.data.entity; import java.util.regex.Matcher; import java.util.regex.Pattern; import javax.annotation.Nonnull; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Fault; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.FaultcurrentEntity; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.SeverityType; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Fault; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.FaultcurrentEntity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SeverityType; public class FaultEntityManager { diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/entity/HtDatabaseEventsService.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/entity/HtDatabaseEventsService.java index de6870571..0f2f7d250 100644 --- a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/entity/HtDatabaseEventsService.java +++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/entity/HtDatabaseEventsService.java @@ -40,25 +40,28 @@ import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider; import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.NetconfTimeStamp; import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.types.NetconfTimeStampImpl; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ConnectionLogStatus; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ConnectionlogBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ConnectionlogEntity; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Entity; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.EventlogBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.EventlogEntity; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.FaultcurrentBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.FaultcurrentEntity; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.FaultlogBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.FaultlogEntity; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.GranularityPeriodType; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Inventory; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.InventoryBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.InventoryEntity; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.NetworkElementConnectionBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.NetworkElementConnectionEntity; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.PmdataEntity; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.PmdataEntityBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.UpdateNetworkElementConnectionInputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ConnectionLogStatus; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ConnectionlogBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ConnectionlogEntity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Entity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EventlogBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EventlogEntity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.FaultcurrentBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.FaultcurrentEntity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.FaultlogBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.FaultlogEntity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.GranularityPeriodType; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Guicutthrough; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.GuicutthroughBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.GuicutthroughEntity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Inventory; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.InventoryBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.InventoryEntity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.NetworkElementConnectionBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.NetworkElementConnectionEntity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.PmdataEntity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.PmdataEntityBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.UpdateNetworkElementConnectionInputBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -79,10 +82,9 @@ public class HtDatabaseEventsService implements ArchiveCleanProvider, DataProvid private EsDataObjectReaderWriter2<FaultlogEntity> eventRWFaultLogDB; private EsDataObjectReaderWriter2<ConnectionlogEntity> eventRWConnectionLogDB; private final EsDataObjectReaderWriter2<NetworkElementConnectionEntity> networkelementConnectionDB; + private final EsDataObjectReaderWriter2<GuicutthroughEntity> guiCutThroughDB; private final EsDataObjectReaderWriter2<PmdataEntity> pmData15mDB; private final EsDataObjectReaderWriter2<PmdataEntity> pmData24hDB; - private final EsDataObjectReaderWriter2<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.v2.rev200702.PmdataEntity> pmData15mDBv2; - private final EsDataObjectReaderWriter2<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.v2.rev200702.PmdataEntity> pmData24hDBv2; @SuppressWarnings("unused") private final ElasticSearchDataProvider dataProvider; @@ -118,21 +120,15 @@ public class HtDatabaseEventsService implements ArchiveCleanProvider, DataProvid NetworkElementConnectionEntity.class, NetworkElementConnectionBuilder.class, true) .setEsIdAttributeName("_id"); + guiCutThroughDB = new EsDataObjectReaderWriter2<>(client, Entity.Guicutthrough, + GuicutthroughEntity.class, GuicutthroughBuilder.class); + pmData15mDB = new EsDataObjectReaderWriter2<>(client, Entity.Historicalperformance15min, PmdataEntity.class, PmdataEntityBuilder.class); pmData24hDB = new EsDataObjectReaderWriter2<>(client, Entity.Historicalperformance24h, PmdataEntity.class, PmdataEntityBuilder.class); - pmData15mDBv2 = new EsDataObjectReaderWriter2<>(client, Entity.Historicalperformance15min, - org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.v2.rev200702.PmdataEntity.class, - org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.v2.rev200702.PmdataEntityBuilder.class); - - pmData24hDBv2 = new EsDataObjectReaderWriter2<>(client, Entity.Historicalperformance24h, - org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.v2.rev200702.PmdataEntity.class, - org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.v2.rev200702.PmdataEntityBuilder.class); - - } catch (Exception e) { LOG.error("Can not start database client. Exception: {}", e); throw new Exception("Can not start database client. Exception: {}", e); @@ -522,51 +518,20 @@ public class HtDatabaseEventsService implements ArchiveCleanProvider, DataProvid }); } - @Override - public void doWritePerformanceData2( - List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.v2.rev200702.PmdataEntity> list) { - list.forEach(elem -> { - org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.v2.rev200702.GranularityPeriodType - granularityPeriod = nnGetGranularityPeriodType2(elem.getGranularityPeriod()); - //_id": "Sim12600/LP-MWPS-TTP-01/2017-07-04T15:15:00.0+00:00" - StringBuffer id = new StringBuffer(); - DateAndTime date = elem.getTimeStamp(); - id.append(elem.getNodeName()); - id.append("/"); - id.append(elem.getUuidInterface()); - id.append("/"); - id.append(date != null ? date.getValue() : "null"); - - switch (granularityPeriod) { - case Period15Min: - pmData15mDB.write(elem, id.toString()); - break; - case Period24Hours: - pmData24hDB.write(elem, id.toString()); - break; - case Unknown: - default: - LOG.debug("Unknown granularity {} id {}", granularityPeriod, id); - break; - } - }); - } @NonNull GranularityPeriodType nnGetGranularityPeriodType(@Nullable GranularityPeriodType granularityPeriod) { return granularityPeriod != null ? granularityPeriod : GranularityPeriodType.Unknown; } - org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.v2.rev200702.GranularityPeriodType nnGetGranularityPeriodType2( - org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.v2.rev200702.@Nullable GranularityPeriodType granularityPeriod) { - return granularityPeriod != null ? granularityPeriod : - org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.v2.rev200702.GranularityPeriodType.Unknown; - } @Override public HtDatabaseClient getRawClient() { return this.client; } - + @Override + public void writeGuiCutThroughData(Guicutthrough gcData) { + guiCutThroughDB.write(gcData, null); + } } diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/entity/HtDatabaseMaintenanceService.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/entity/HtDatabaseMaintenanceService.java index 1cb7c3a6e..380526d9a 100644 --- a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/entity/HtDatabaseMaintenanceService.java +++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/entity/HtDatabaseMaintenanceService.java @@ -31,11 +31,11 @@ import org.onap.ccsdk.features.sdnr.wt.dataprovider.database.EsDataObjectReaderW import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.HtDatabaseMaintenance; import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.types.NetconfTimeStampImpl; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Entity; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.MaintenanceBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.MaintenanceEntity; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.NetworkElementConnectionBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.NetworkElementConnectionEntity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Entity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.MaintenanceBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.MaintenanceEntity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.NetworkElementConnectionBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.NetworkElementConnectionEntity; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -61,7 +61,7 @@ public class HtDatabaseMaintenanceService implements HtDatabaseMaintenance { /** * Get existing object for mountpoint to manage maintenance mode - * + * * @return Object with configuration */ @Override @@ -125,7 +125,7 @@ public class HtDatabaseMaintenanceService implements HtDatabaseMaintenance { /** * Provide default maintenanceinformation for a device - * + * * @param mountpointId nodeId of device * @return default data */ diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/rpctypehelper/QueryByFilter.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/rpctypehelper/QueryByFilter.java index a12391acd..09e48197a 100644 --- a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/rpctypehelper/QueryByFilter.java +++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/rpctypehelper/QueryByFilter.java @@ -21,15 +21,14 @@ */ package org.onap.ccsdk.features.sdnr.wt.dataprovider.data.rpctypehelper; -import java.math.BigInteger; import java.util.ArrayList; import java.util.Arrays; import java.util.Calendar; import java.util.Date; import java.util.List; import java.util.TimeZone; - import org.eclipse.jdt.annotation.Nullable; +import org.onap.ccsdk.features.sdnr.wt.common.YangHelper; import org.onap.ccsdk.features.sdnr.wt.common.database.data.DbFilter; import org.onap.ccsdk.features.sdnr.wt.common.database.queries.BoolQueryBuilder; import org.onap.ccsdk.features.sdnr.wt.common.database.queries.QueryBuilder; @@ -39,11 +38,14 @@ import org.onap.ccsdk.features.sdnr.wt.common.database.requests.SearchRequest; import org.onap.ccsdk.features.sdnr.wt.dataprovider.data.acessor.DataObjectAcessorPm; import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.NetconfTimeStamp; import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.types.NetconfTimeStampImpl; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.EntityInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.SortOrder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.entity.input.Filter; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.entity.input.Pagination; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.entity.input.Sortorder; +import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.types.YangHelper2; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EntityInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SortOrder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.entity.input.Filter; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.entity.input.Pagination; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.entity.input.Sortorder; +import org.opendaylight.yangtools.yang.common.Uint32; +import org.opendaylight.yangtools.yang.common.Uint64; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -64,7 +66,7 @@ public class QueryByFilter { /** * Process input from RPC into Queries to database - * + * * @param input Input from RPC, for test it could be null */ public QueryByFilter(EntityInput input) { @@ -74,13 +76,13 @@ public class QueryByFilter { @Nullable Pagination pagination = input.getPagination(); if (pagination != null) { - BigInteger pageOrNull = pagination.getPage(); + @Nullable Uint64 pageOrNull = YangHelper2.getUint64(pagination.getPage()); if (pageOrNull != null) { page = pageOrNull.longValue(); } - Long pageSizeOrNull = pagination.getSize(); + @Nullable Uint32 pageSizeOrNull = YangHelper2.getUint32(pagination.getSize()); if (pageSizeOrNull != null) { - pageSize = pageSizeOrNull; + pageSize = pageSizeOrNull.longValue(); } } } @@ -93,10 +95,10 @@ public class QueryByFilter { if (fromPage < 0 || pageSize > 10000) throw new IllegalArgumentException("mismatching input parameters. From:" + fromPage + " size:" + pageSize); - filterList = input.getFilter(); + filterList = YangHelper.getList(input.getFilter()); if (filterList == null) filterList = emptyFilterList; - sortOrder = input.getSortorder(); + sortOrder = YangHelper.getList(input.getSortorder()); if (sortOrder == null) sortOrder = emptySortOrderList; diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/rpctypehelper/QueryByFilterStatic.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/rpctypehelper/QueryByFilterStatic.java index 3e4fcfedd..b76e0a872 100644 --- a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/rpctypehelper/QueryByFilterStatic.java +++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/rpctypehelper/QueryByFilterStatic.java @@ -35,10 +35,10 @@ import org.onap.ccsdk.features.sdnr.wt.common.database.queries.RangeQueryBuilder import org.onap.ccsdk.features.sdnr.wt.dataprovider.data.acessor.DataObjectAcessorPm; import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.NetconfTimeStamp; import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.types.NetconfTimeStampImpl; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.EntityInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.SortOrder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.entity.input.Filter; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.entity.input.Sortorder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EntityInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SortOrder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.entity.input.Filter; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.entity.input.Sortorder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/rpctypehelper/QueryResult.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/rpctypehelper/QueryResult.java index 544cd059c..4cd015a7f 100644 --- a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/rpctypehelper/QueryResult.java +++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/rpctypehelper/QueryResult.java @@ -24,8 +24,8 @@ package org.onap.ccsdk.features.sdnr.wt.dataprovider.data.rpctypehelper; import java.math.BigInteger; import org.onap.ccsdk.features.sdnr.wt.common.database.SearchResult; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.PaginationOutputG; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.connectionlog.list.output.PaginationBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.PaginationOutputG; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.connectionlog.list.output.PaginationBuilder; public class QueryResult<T> { diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/database/EsDataObjectReaderWriter2.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/database/EsDataObjectReaderWriter2.java index 658826986..bf1aff372 100644 --- a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/database/EsDataObjectReaderWriter2.java +++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/database/EsDataObjectReaderWriter2.java @@ -32,9 +32,8 @@ import org.onap.ccsdk.features.sdnr.wt.common.database.DatabaseClient; import org.onap.ccsdk.features.sdnr.wt.common.database.SearchHit; import org.onap.ccsdk.features.sdnr.wt.common.database.SearchResult; import org.onap.ccsdk.features.sdnr.wt.common.database.queries.QueryBuilder; -import org.onap.ccsdk.features.sdnr.wt.dataprovider.yangtools.YangToolsMapper; import org.onap.ccsdk.features.sdnr.wt.dataprovider.yangtools.YangToolsMapper2; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Entity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Entity; import org.opendaylight.yangtools.concepts.Builder; import org.opendaylight.yangtools.yang.binding.DataObject; import org.slf4j.Logger; @@ -143,7 +142,7 @@ public class EsDataObjectReaderWriter2<T extends DataObject> { * @return this for further operations. */ public EsDataObjectReaderWriter2<T> setEsIdAttributeNameCamelized(String esIdAttributeName) { - return setEsIdAttributeName(YangToolsMapper.toCamelCaseAttributeName(esIdAttributeName)); + return setEsIdAttributeName(YangToolsMapper2.toCamelCaseAttributeName(esIdAttributeName)); } /** diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/http/DataTreeHttpServlet.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/http/DataTreeHttpServlet.java index 245ac1cf6..085d3816a 100644 --- a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/http/DataTreeHttpServlet.java +++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/http/DataTreeHttpServlet.java @@ -41,7 +41,7 @@ import javax.servlet.http.HttpServletResponse; import org.json.JSONObject; import org.onap.ccsdk.features.sdnr.wt.common.database.HtDatabaseClient; import org.onap.ccsdk.features.sdnr.wt.dataprovider.impl.DataTreeProviderImpl; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Entity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Entity; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -57,7 +57,7 @@ public class DataTreeHttpServlet extends HttpServlet { } /** - * + * */ private static final long serialVersionUID = 1L; private final DataTreeProviderImpl dataTreeProvider; diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/http/about/ODLVersionLUT.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/http/about/ODLVersionLUT.java index 1adbea01f..b08e5ad16 100644 --- a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/http/about/ODLVersionLUT.java +++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/http/about/ODLVersionLUT.java @@ -60,6 +60,7 @@ public class ODLVersionLUT { } if(odlMdsalVersionLUT==null) { odlMdsalVersionLUT = new HashMap<>(); + odlMdsalVersionLUT.put("6.0.4","aluminium-SR0 (0.13.0)"); odlMdsalVersionLUT.put("5.0.14","magnesium-SR2 (0.12.2)"); odlMdsalVersionLUT.put("5.0.10","magnesium-SR1 (0.12.1)"); odlMdsalVersionLUT.put("5.0.9","magnesium-SR0 (0.12.0)"); diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/impl/DataProviderServiceImpl.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/impl/DataProviderServiceImpl.java index 6eabc969b..30819dca2 100644 --- a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/impl/DataProviderServiceImpl.java +++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/impl/DataProviderServiceImpl.java @@ -36,55 +36,58 @@ import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider; import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.HtDatabaseMaintenance; import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.IEsConfig; import org.opendaylight.mdsal.binding.api.RpcProviderService; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateMaintenanceInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateMaintenanceOutput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateMediatorServerInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateMediatorServerOutput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateNetworkElementConnectionInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateNetworkElementConnectionOutput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.DataProviderService; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.DeleteMaintenanceInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.DeleteMaintenanceOutput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.DeleteMediatorServerInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.DeleteMediatorServerOutput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.DeleteNetworkElementConnectionInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.DeleteNetworkElementConnectionOutput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadConnectionlogListInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadConnectionlogListOutput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadEventlogListInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadEventlogListOutput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadFaultcurrentListInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadFaultcurrentListOutput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadFaultlogListInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadFaultlogListOutput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadInventoryListInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadInventoryListOutput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadMaintenanceListInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadMaintenanceListOutput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadMediatorServerListInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadMediatorServerListOutput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadNetworkElementConnectionListInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadNetworkElementConnectionListOutput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata15mDeviceListInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata15mDeviceListOutput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata15mListInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata15mListOutput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata15mLtpListInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata15mLtpListOutput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata24hDeviceListInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata24hDeviceListOutput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata24hListInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata24hListOutput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata24hLtpListInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata24hLtpListOutput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadStatusInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadStatusOutput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.UpdateMaintenanceInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.UpdateMaintenanceOutput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.UpdateMediatorServerInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.UpdateMediatorServerOutput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.UpdateNetworkElementConnectionInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.UpdateNetworkElementConnectionOutput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateMaintenanceInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateMaintenanceOutput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateMediatorServerInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateMediatorServerOutput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateNetworkElementConnectionInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateNetworkElementConnectionOutput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.DataProviderService; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.DeleteMaintenanceInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.DeleteMaintenanceOutput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.DeleteMediatorServerInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.DeleteMediatorServerOutput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.DeleteNetworkElementConnectionInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.DeleteNetworkElementConnectionOutput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadConnectionlogListInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadConnectionlogListOutput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadEventlogListInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadEventlogListOutput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadFaultcurrentListInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadFaultcurrentListOutput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadFaultlogListInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadFaultlogListOutput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadInventoryListInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadInventoryListOutput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadMaintenanceListInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadMaintenanceListOutput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadMediatorServerListInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadMediatorServerListOutput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadNetworkElementConnectionListInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadNetworkElementConnectionListOutput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadPmdata15mDeviceListInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadPmdata15mDeviceListOutput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadPmdata15mListInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadPmdata15mListOutput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadPmdata15mLtpListInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadPmdata15mLtpListOutput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadPmdata24hDeviceListInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadPmdata24hDeviceListOutput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadPmdata24hListInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadPmdata24hListOutput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadPmdata24hLtpListInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadPmdata24hLtpListOutput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadStatusInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadStatusOutput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.UpdateMaintenanceInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.UpdateMaintenanceOutput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.UpdateMediatorServerInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.UpdateMediatorServerOutput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.UpdateNetworkElementConnectionInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.UpdateNetworkElementConnectionOutput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadGuiCutThroughEntryInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadGuiCutThroughEntryOutput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadGuiCutThroughEntryOutputBuilder; import org.opendaylight.yangtools.concepts.Builder; import org.opendaylight.yangtools.concepts.ObjectRegistration; import org.opendaylight.yangtools.yang.binding.DataObject; @@ -370,6 +373,14 @@ public class DataProviderServiceImpl implements DataProviderService, AutoCloseab return result.buildFuture(); } + @Override + public ListenableFuture<RpcResult<ReadGuiCutThroughEntryOutput>> readGuiCutThroughEntry( + ReadGuiCutThroughEntryInput input) { + LOG.debug("RPC Request: readGuiCutThroughEntry with input {}", input); + RpcResultBuilder<ReadGuiCutThroughEntryOutput> result = + read(() -> DataProviderServiceImpl.this.dataProvider.readGuiCutThroughEntry(input)); + return result.buildFuture(); + } // -- private classes and functions private static String assembleExceptionMessage(Exception e) { diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/impl/DataTreeProviderImpl.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/impl/DataTreeProviderImpl.java index 2af354bcc..4340d8168 100644 --- a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/impl/DataTreeProviderImpl.java +++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/impl/DataTreeProviderImpl.java @@ -38,7 +38,7 @@ import org.onap.ccsdk.features.sdnr.wt.common.database.responses.SearchResponse; import org.onap.ccsdk.features.sdnr.wt.dataprovider.http.DataTreeChildObject; import org.onap.ccsdk.features.sdnr.wt.dataprovider.http.DataTreeHttpServlet.FilterMode; import org.onap.ccsdk.features.sdnr.wt.dataprovider.http.DataTreeObject; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Entity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Entity; /** * @author Michael Dürre diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/yangtools/DateAndTimeBuilder.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/yangtools/DateAndTimeBuilder.java new file mode 100644 index 000000000..628890018 --- /dev/null +++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/yangtools/DateAndTimeBuilder.java @@ -0,0 +1,15 @@ +package org.onap.ccsdk.features.sdnr.wt.dataprovider.yangtools; + +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime; + +public class DateAndTimeBuilder { + private final String _value; + + public DateAndTimeBuilder(String v) { + this._value = v; + } + + public DateAndTime build() { + return new DateAndTime(_value); + } +} diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/yangtools/YangToolsMapper2.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/yangtools/YangToolsMapper2.java index 814bfd745..8f05437c9 100644 --- a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/yangtools/YangToolsMapper2.java +++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/yangtools/YangToolsMapper2.java @@ -21,18 +21,6 @@ */ package org.onap.ccsdk.features.sdnr.wt.dataprovider.yangtools; -import java.io.IOException; -import javax.annotation.Nullable; - -import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.credentials.Credentials; -import org.opendaylight.yangtools.concepts.Builder; -import org.opendaylight.yangtools.yang.binding.DataObject; -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleContext; -import org.osgi.framework.FrameworkUtil; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonProcessingException; @@ -46,9 +34,20 @@ import com.fasterxml.jackson.databind.introspect.AnnotatedClass; import com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector; import com.fasterxml.jackson.databind.module.SimpleModule; import com.fasterxml.jackson.databind.ser.std.StdSerializer; - +import java.io.IOException; +import javax.annotation.Nullable; import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.types.rev191129.PmDataType; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime; +import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.credentials.Credentials; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.binding.TypeObject; +import org.osgi.framework.Bundle; +import org.osgi.framework.BundleContext; +import org.osgi.framework.FrameworkUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * YangToolsMapper is a specific Jackson mapper configuration for opendaylight yangtools serialization or @@ -57,7 +56,7 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types. */ public class YangToolsMapper2<T extends DataObject> extends ObjectMapper { - private final Logger LOG = LoggerFactory.getLogger(YangToolsMapper2.class); + private static final Logger LOG = LoggerFactory.getLogger(YangToolsMapper2.class); private static final long serialVersionUID = 1L; private static String BUILDER = "Builder"; @@ -68,7 +67,7 @@ public class YangToolsMapper2<T extends DataObject> extends ObjectMapper { /** * Generic Object creation of yangtools java class builder pattern. - * + * * @param <X> Class of DataObject * @param <B> Builder for the class. * @param clazz specifies class to be mapped @@ -86,6 +85,10 @@ public class YangToolsMapper2<T extends DataObject> extends ObjectMapper { SimpleModule dateAndTimeSerializerModule = new SimpleModule(); dateAndTimeSerializerModule.addSerializer(DateAndTime.class, new CustomDateAndTimeSerializer()); registerModule(dateAndTimeSerializerModule); + + SimpleModule pmDataTypeSerializerModule = new SimpleModule(); + pmDataTypeSerializerModule.addSerializer(PmDataType.class, new CustomPMDataTypeSerializer()); + registerModule(pmDataTypeSerializerModule); Bundle bundle = FrameworkUtil.getBundle(YangToolsMapper2.class); this.clazz = clazz; @@ -93,6 +96,10 @@ public class YangToolsMapper2<T extends DataObject> extends ObjectMapper { context = bundle != null ? bundle.getBundleContext() : null; } + public <X extends T, B extends Builder<X>> YangToolsMapper2(@NonNull Class<T> clazz) throws ClassNotFoundException { + this(clazz, null); + } + @Override public String writeValueAsString(Object value) throws JsonProcessingException { return super.writeValueAsString(value); @@ -100,7 +107,7 @@ public class YangToolsMapper2<T extends DataObject> extends ObjectMapper { /** * Get Builder object for yang tools interface. - * + * * @param <T> yang-tools base datatype * @param clazz class with interface. * @return builder for interface or null if not existing @@ -108,7 +115,7 @@ public class YangToolsMapper2<T extends DataObject> extends ObjectMapper { public @Nullable Builder<? extends T> getBuilder(Class<T> clazz) { try { if (builderClazz != null) - return (Builder<? extends T>) builderClazz.newInstance(); + return builderClazz.newInstance(); else return null; } catch (InstantiationException | IllegalAccessException e) { @@ -119,7 +126,7 @@ public class YangToolsMapper2<T extends DataObject> extends ObjectMapper { /** * Callback for handling mapping failures. - * + * * @return */ public int getMappingFailures() { @@ -128,7 +135,7 @@ public class YangToolsMapper2<T extends DataObject> extends ObjectMapper { /** * Provide mapping of string to attribute names, generated by yang-tools. "netconf-id" converted to "_netconfId" - * + * * @param name with attribute name, not null or empty * @return converted string or null if name was empty or null */ @@ -155,7 +162,7 @@ public class YangToolsMapper2<T extends DataObject> extends ObjectMapper { /** * Verify if builder is available - * + * * @throws ClassNotFoundException **/ public Class<?> assertBuilderClass(Class<?> clazz) throws ClassNotFoundException { @@ -166,7 +173,7 @@ public class YangToolsMapper2<T extends DataObject> extends ObjectMapper { /** * Create name of builder class - * + * * @param <T> * @param clazz * @return builders class name @@ -178,7 +185,7 @@ public class YangToolsMapper2<T extends DataObject> extends ObjectMapper { /** * Search builder in context - * + * * @param name * @return * @throws ClassNotFoundException @@ -189,6 +196,7 @@ public class YangToolsMapper2<T extends DataObject> extends ObjectMapper { if (context != null) { //OSGi environment for (Bundle b : context.getBundles()) { + LOG.info("Search in bundle: {}", b.getSymbolicName()); try { return (Class<B>) b.loadClass(name); } catch (ClassNotFoundException e) { @@ -212,27 +220,42 @@ public class YangToolsMapper2<T extends DataObject> extends ObjectMapper { @Override public Class<?> findPOJOBuilder(AnnotatedClass ac) { - - if (ac.getRawType().equals(Credentials.class)) { + Class<?> clazz2build = ac.getRawType(); + if (clazz2build.equals(Credentials.class)) { return org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.credentials.credentials.LoginPasswordBuilder.class; - } else if (ac.getRawType().equals(DateAndTime.class)) { + } else if (clazz2build.equals(DateAndTime.class)) { return DateAndTimeBuilder.class; - - } else if (ac.getRawType().equals(clazz)) { + // } else if (ac.getRawType().equals(PmDataType.class)) { + // LOG.info("Builder class"); + // return PMDataTypeBuilder.class; + } else if (clazz2build.equals(clazz)) { return builderClazz; } - if (ac.getRawType().isInterface()) { - String builder = getBuilderClassName(ac.getRawType()); + if (clazz2build.isInterface() || TypeObject.class.isAssignableFrom(clazz2build)) { + String builder = getBuilderClassName(clazz2build); + LOG.info("Search: {}", builder); + Class<?> innerBuilder; + try { + innerBuilder = Class.forName(builder); + LOG.info("Found1: {}", innerBuilder); + return innerBuilder; + } catch (ClassNotFoundException e) { + LOG.info("Could not find {}", clazz2build); + // No problem .. try next + } try { - Class<?> innerBuilder = getBuilderClass(builder); + innerBuilder = getBuilderClass(builder); + LOG.info("Found2: {}", innerBuilder); return innerBuilder; } catch (ClassNotFoundException e) { + LOG.info("Could not find {}", clazz2build); // No problem .. try next } } - return super.findPOJOBuilder(ac); + Class<?> clazz = super.findPOJOBuilder(ac); + return clazz; } @Override @@ -275,4 +298,22 @@ public class YangToolsMapper2<T extends DataObject> extends ObjectMapper { } } + public static class CustomPMDataTypeSerializer extends StdSerializer<@NonNull PmDataType> { + + private static final long serialVersionUID = 1L; + + public CustomPMDataTypeSerializer() { + this(null); + } + + protected CustomPMDataTypeSerializer(Class<PmDataType> t) { + super(t); + } + + @Override + public void serialize(PmDataType value, JsonGenerator gen, SerializerProvider serializers) throws IOException { + gen.writeString(value.toString()); + } + + } } diff --git a/sdnr/wt/data-provider/provider/src/main/resources/es-init.replaced.sh b/sdnr/wt/data-provider/provider/src/main/resources/es-init.replaced.sh index 67d495aa0..9474f91be 100755 --- a/sdnr/wt/data-provider/provider/src/main/resources/es-init.replaced.sh +++ b/sdnr/wt/data-provider/provider/src/main/resources/es-init.replaced.sh @@ -45,6 +45,7 @@ set_definition() { def "historicalperformance15min" '{"node-name":{"type": "keyword"},"timestamp":{"type": "date"},"suspect-interval-flag":{"type":"boolean"},"scanner-id":{"type": "keyword"},"uuid-interface":{"type": "keyword"},"layer-protocol-name":{"type": "keyword"},"granularity-period":{"type": "keyword"},"radio-signal-id":{"type": "keyword"}}' def "mediator-server" '{"url":{"type": "keyword"},"name":{"type": "keyword"}}' def "networkelement-connection" '{"node-id": {"type": "keyword"},"host": {"type": "keyword"},"port": {"type": "long"},"username": {"type": "keyword"},"password": {"type": "keyword"},"core-model-capability": {"type": "keyword"},"device-type": {"type": "keyword"},"is-required": {"type": "boolean"},"status": {"type": "keyword"}},"date_detection":false' + def "guicutthrough" '{"name":{"type": "keyword"},"weburi":{"type": "keyword"}}' } # ------------------------------------------------------------ diff --git a/sdnr/wt/data-provider/provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml b/sdnr/wt/data-provider/provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml index 1be114612..ebb20fc7b 100644 --- a/sdnr/wt/data-provider/provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml +++ b/sdnr/wt/data-provider/provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml @@ -27,8 +27,7 @@ xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" odl:use-default-for-reference-types="true"> <reference id="rpcProviderService" - interface="org.opendaylight.mdsal.binding.api.RpcProviderService" - odl:type="default"/> + interface="org.opendaylight.mdsal.binding.api.RpcProviderService"/> <reference id="bundleService" interface="org.apache.karaf.bundle.core.BundleService" /> diff --git a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestAbout.java b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestAbout.java index 1e6752764..92ac04702 100644 --- a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestAbout.java +++ b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestAbout.java @@ -21,25 +21,22 @@ */ package org.onap.ccsdk.features.sdnr.wt.dataprovider.test; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; -import org.onap.ccsdk.features.sdnr.wt.dataprovider.http.about.AboutHttpServlet; - import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; - -import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; -import java.io.StringWriter; import java.nio.file.Files; import javax.servlet.ServletException; -import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; +import org.onap.ccsdk.features.sdnr.wt.common.test.ServletOutputStreamToByteArrayOutputStream; +import org.onap.ccsdk.features.sdnr.wt.common.test.ServletOutputStreamToStringWriter; +import org.onap.ccsdk.features.sdnr.wt.dataprovider.http.about.AboutHttpServlet; public class TestAbout { @@ -83,20 +80,13 @@ public class TestAbout { HttpServletRequest request = mock(HttpServletRequest.class); HttpServletResponse response = mock(HttpServletResponse.class); when(request.getRequestURI()).thenReturn("/about"); - StringWriter out = new StringWriter(); - ServletOutputStream printOut = new ServletOutputStream() { - - @Override - public void write(int arg0) throws IOException { - out.write(arg0); - } - }; + ServletOutputStreamToStringWriter printOut = new ServletOutputStreamToStringWriter(); when(response.getOutputStream()).thenReturn(printOut); servlet.doGet(request, response); verify(response).setStatus(200); verify(response).setContentType("text/plain"); - System.out.println(out.getBuffer().toString()); - assertTrue(out.getBuffer().length() > 0); + System.out.println(printOut.getStringWriter().getBuffer().toString()); + assertTrue(printOut.getStringWriter().getBuffer().length() > 0); } @Test @@ -105,19 +95,12 @@ public class TestAbout { HttpServletRequest request = mock(HttpServletRequest.class); HttpServletResponse response = mock(HttpServletResponse.class); when(request.getRequestURI()).thenReturn("/about/test.bmp"); - ByteArrayOutputStream out = new ByteArrayOutputStream(); - ServletOutputStream printOut = new ServletOutputStream() { - - @Override - public void write(int arg0) throws IOException { - out.write(arg0); - } - }; + ServletOutputStreamToByteArrayOutputStream printOut = new ServletOutputStreamToByteArrayOutputStream(); when(response.getOutputStream()).thenReturn(printOut); servlet.doGet(request, response); verify(response).setStatus(200); verify(response).setContentType("image/bmp"); - assertTrue(out.size() > 0); + assertTrue(printOut.getByteArrayOutputStream().size() > 0); } diff --git a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestCRUDforDatabase.java b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestCRUDforDatabase.java index a22f3033d..5f78999d0 100644 --- a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestCRUDforDatabase.java +++ b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestCRUDforDatabase.java @@ -29,7 +29,6 @@ import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import java.io.IOException; import java.math.BigInteger; -import java.util.Arrays; import java.util.List; import java.util.concurrent.TimeUnit; import org.junit.BeforeClass; @@ -41,84 +40,86 @@ import org.onap.ccsdk.features.sdnr.wt.common.database.config.HostInfo; import org.onap.ccsdk.features.sdnr.wt.common.database.queries.QueryBuilders; import org.onap.ccsdk.features.sdnr.wt.common.database.requests.BaseRequest; import org.onap.ccsdk.features.sdnr.wt.dataprovider.data.ElasticSearchDataProvider; +import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.types.YangHelper2; import org.onap.ccsdk.features.sdnr.wt.dataprovider.test.util.HostInfoForTest; -import org.onap.ccsdk.features.sdnr.wt.dataprovider.yangtools.YangToolsMapper; +import org.onap.ccsdk.features.sdnr.wt.dataprovider.yangtools.YangToolsMapper2; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateMaintenanceInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateMaintenanceInputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateMaintenanceOutputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateMediatorServerInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateMediatorServerInputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateMediatorServerOutputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateNetworkElementConnectionInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateNetworkElementConnectionInputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateNetworkElementConnectionOutputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.DeleteMaintenanceInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.DeleteMaintenanceInputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.DeleteMediatorServerInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.DeleteMediatorServerInputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.DeleteNetworkElementConnectionInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.DeleteNetworkElementConnectionInputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Entity; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Faultlog; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.FaultlogEntity; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.GranularityPeriodType; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadConnectionlogListInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadConnectionlogListInputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadConnectionlogListOutputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadEventlogListInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadEventlogListInputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadEventlogListOutputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadFaultcurrentListInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadFaultcurrentListInputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadFaultcurrentListOutputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadFaultlogListInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadFaultlogListInputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadFaultlogListOutputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadInventoryListInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadInventoryListInputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadInventoryListOutputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadMaintenanceListInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadMaintenanceListInputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadMaintenanceListOutputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadMediatorServerListInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadMediatorServerListInputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadMediatorServerListOutputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadNetworkElementConnectionListInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadNetworkElementConnectionListInputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadNetworkElementConnectionListOutputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata15mDeviceListInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata15mDeviceListInputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata15mDeviceListOutputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata15mListInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata15mListInputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata15mListOutputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata15mLtpListInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata15mLtpListInputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata15mLtpListOutputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata24hDeviceListInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata24hDeviceListInputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata24hDeviceListOutputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata24hListInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata24hListInputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata24hListOutputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata24hLtpListInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata24hLtpListInputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata24hLtpListOutputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.SeverityType; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.UpdateMaintenanceInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.UpdateMaintenanceInputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.UpdateMaintenanceOutputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.UpdateMediatorServerInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.UpdateMediatorServerInputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.UpdateMediatorServerOutputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.UpdateNetworkElementConnectionInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.UpdateNetworkElementConnectionInputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.UpdateNetworkElementConnectionOutputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.entity.input.FilterBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.entity.input.Pagination; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.entity.input.PaginationBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.mediator.server.list.output.Data; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateMaintenanceInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateMaintenanceInputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateMaintenanceOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateMediatorServerInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateMediatorServerInputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateMediatorServerOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateNetworkElementConnectionInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateNetworkElementConnectionInputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateNetworkElementConnectionOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.DeleteMaintenanceInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.DeleteMaintenanceInputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.DeleteMediatorServerInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.DeleteMediatorServerInputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.DeleteNetworkElementConnectionInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.DeleteNetworkElementConnectionInputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Entity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Faultlog; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.FaultlogEntity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.GranularityPeriodType; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadConnectionlogListInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadConnectionlogListInputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadConnectionlogListOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadEventlogListInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadEventlogListInputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadEventlogListOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadFaultcurrentListInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadFaultcurrentListInputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadFaultcurrentListOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadFaultlogListInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadFaultlogListInputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadFaultlogListOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadInventoryListInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadInventoryListInputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadInventoryListOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadMaintenanceListInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadMaintenanceListInputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadMaintenanceListOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadMediatorServerListInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadMediatorServerListInputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadMediatorServerListOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadNetworkElementConnectionListInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadNetworkElementConnectionListInputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadNetworkElementConnectionListOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadPmdata15mDeviceListInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadPmdata15mDeviceListInputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadPmdata15mDeviceListOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadPmdata15mListInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadPmdata15mListInputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadPmdata15mListOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadPmdata15mLtpListInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadPmdata15mLtpListInputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadPmdata15mLtpListOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadPmdata24hDeviceListInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadPmdata24hDeviceListInputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadPmdata24hDeviceListOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadPmdata24hListInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadPmdata24hListInputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadPmdata24hListOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadPmdata24hLtpListInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadPmdata24hLtpListInputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadPmdata24hLtpListOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SeverityType; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.UpdateMaintenanceInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.UpdateMaintenanceInputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.UpdateMaintenanceOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.UpdateMediatorServerInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.UpdateMediatorServerInputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.UpdateMediatorServerOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.UpdateNetworkElementConnectionInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.UpdateNetworkElementConnectionInputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.UpdateNetworkElementConnectionOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.entity.input.FilterBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.entity.input.FilterKey; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.entity.input.Pagination; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.entity.input.PaginationBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.mediator.server.list.output.Data; public class TestCRUDforDatabase { @@ -151,21 +152,21 @@ public class TestCRUDforDatabase { //== CLEAR AND CREATE ================================ clearAndCreatefaultEntity("1", Entity.Faultcurrent.getName(), - "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateFaultcurrentInput", + "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateFaultcurrentInput", SeverityType.Critical); createFaultEntity("Lorem Ipsum", Entity.Faultcurrent.getName(), - "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateFaultcurrentInput", + "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateFaultcurrentInput", SeverityType.Major); createFaultEntity("3", Entity.Faultcurrent.getName(), - "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateFaultcurrentInput", + "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateFaultcurrentInput", SeverityType.Minor); createFaultEntity("4", Entity.Faultcurrent.getName(), - "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateFaultcurrentInput", + "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateFaultcurrentInput", SeverityType.Warning); //== READ ================================ - List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.status.output.Data> readOutput = + List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.status.output.Data> readOutput = dbProvider.readStatus().getData(); System.out.println(readOutput); @@ -226,7 +227,7 @@ public class TestCRUDforDatabase { // ==READ=========================== System.out.println("try to read entry"); ReadMediatorServerListInput readinput = new ReadMediatorServerListInputBuilder() - .setFilter(Arrays.asList(new FilterBuilder().setProperty("id").setFiltervalue(dbId).build())) + .setFilter(YangHelper2.getListOrMap(FilterKey.class,new FilterBuilder().setProperty("id").setFiltervalue(dbId).build())) .setPagination(getPagination(20, 1)).build(); ReadMediatorServerListOutputBuilder readoutput = dbProvider.readMediatorServerList(readinput); List<Data> data = readoutput.getData(); @@ -253,7 +254,7 @@ public class TestCRUDforDatabase { // ==READ============================ System.out.println("try to read entry"); readinput = new ReadMediatorServerListInputBuilder() - .setFilter(Arrays.asList(new FilterBuilder().setProperty("name").setFiltervalue(NAME2).build())) + .setFilter(YangHelper2.getListOrMap(FilterKey.class, new FilterBuilder().setProperty("name").setFiltervalue(NAME2).build())) .setPagination(getPagination(20, 1)).build(); readoutput = dbProvider.readMediatorServerList(readinput); data = readoutput.getData(); @@ -276,7 +277,7 @@ public class TestCRUDforDatabase { // ==READ/VERIFY DELETE============================ System.out.println("try to read entry"); readinput = new ReadMediatorServerListInputBuilder() - .setFilter(Arrays.asList(new FilterBuilder().setProperty("name").setFiltervalue(NAME2).build())) + .setFilter(YangHelper2.getListOrMap(FilterKey.class, new FilterBuilder().setProperty("name").setFiltervalue(NAME2).build())) .setPagination(getPagination(20, 1)).build(); readoutput = dbProvider.readMediatorServerList(readinput); data = readoutput.getData(); @@ -321,12 +322,12 @@ public class TestCRUDforDatabase { // ==READ=========================== ReadNetworkElementConnectionListInput readInput = new ReadNetworkElementConnectionListInputBuilder() - .setFilter(Arrays.asList(new FilterBuilder().setProperty("id").setFiltervalue(dbId).build())) + .setFilter(YangHelper2.getListOrMap(FilterKey.class, new FilterBuilder().setProperty("id").setFiltervalue(dbId).build())) .setPagination(getPagination(20, 1)).build(); ReadNetworkElementConnectionListOutputBuilder readOperation = dbProvider.readNetworkElementConnectionList(readInput); - List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.network.element.connection.list.output.Data> data = + List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.network.element.connection.list.output.Data> data = readOperation.getData(); assertNotNull(data); @@ -392,7 +393,7 @@ public class TestCRUDforDatabase { } readInput = new ReadNetworkElementConnectionListInputBuilder() - .setFilter(Arrays.asList(new FilterBuilder().setProperty("id").setFiltervalue(dbId).build())) + .setFilter(YangHelper2.getListOrMap(FilterKey.class, new FilterBuilder().setProperty("id").setFiltervalue(dbId).build())) .setPagination(getPagination(20, 1)).build(); readOperation = dbProvider.readNetworkElementConnectionList(readInput); data = readOperation.getData(); @@ -436,10 +437,10 @@ public class TestCRUDforDatabase { System.out.println("Try read..."); ReadMaintenanceListInput readinput = new ReadMaintenanceListInputBuilder() - .setFilter(Arrays.asList(new FilterBuilder().setProperty("id").setFiltervalue(dbId).build())) + .setFilter(YangHelper2.getListOrMap(FilterKey.class, new FilterBuilder().setProperty("id").setFiltervalue(dbId).build())) .setPagination(getPagination(20, 1)).build(); ReadMaintenanceListOutputBuilder readResult = dbProvider.readMaintenanceList(readinput); - List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.maintenance.list.output.Data> data = + List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.maintenance.list.output.Data> data = readResult.getData(); assertNotEquals(0, data.size()); @@ -494,14 +495,14 @@ public class TestCRUDforDatabase { System.out.println("Starting fault log tests..."); String dbId = clearAndCreatefaultEntity("1", Entity.Faultlog.getName(), - "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateFaultlogInput", + "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateFaultlogInput", SeverityType.Critical); // ==READ=========================== System.out.println("try to read entry"); ReadFaultlogListInput readinput = new ReadFaultlogListInputBuilder() - .setFilter(Arrays.asList(new FilterBuilder().setProperty("id").setFiltervalue(dbId).build())) + .setFilter(YangHelper2.getListOrMap(FilterKey.class, new FilterBuilder().setProperty("id").setFiltervalue(dbId).build())) .setPagination(getPagination(20, 1)).build(); ReadFaultlogListOutputBuilder readResult = null; @@ -512,7 +513,7 @@ public class TestCRUDforDatabase { fail("Fault log not read: " + e.getMessage()); } - List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.faultlog.list.output.Data> data = + List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.faultlog.list.output.Data> data = readResult.getData(); assertNotNull(data); @@ -529,7 +530,7 @@ public class TestCRUDforDatabase { System.out.println("try to search entry 1"); readinput = new ReadFaultlogListInputBuilder() - .setFilter(Arrays.asList(new FilterBuilder().setProperty("node-id").setFiltervalue("test").build())) + .setFilter(YangHelper2.getListOrMap(FilterKey.class, new FilterBuilder().setProperty("node-id").setFiltervalue("test").build())) .setPagination(getPagination(20, 1)).build(); //== VERIFY UPDATE ================================ @@ -544,7 +545,7 @@ public class TestCRUDforDatabase { System.out.println("try to search entry 2"); readinput = new ReadFaultlogListInputBuilder() - .setFilter(Arrays.asList(new FilterBuilder().setProperty("node-id").setFiltervalue("test*").build())) + .setFilter(YangHelper2.getListOrMap(FilterKey.class, new FilterBuilder().setProperty("node-id").setFiltervalue("test*").build())) .setPagination(getPagination(20, 1)).build(); readResult = dbProvider.readFaultLogList(readinput); @@ -579,7 +580,7 @@ public class TestCRUDforDatabase { System.out.println("Starting faultCurrent test..."); String dbId = null; dbId = clearAndCreatefaultEntity("1", Entity.Faultcurrent.getName(), - "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateFaultcurrentInput", + "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateFaultcurrentInput", SeverityType.NonAlarmed); assertEquals("1", dbId); @@ -588,7 +589,7 @@ public class TestCRUDforDatabase { ReadFaultcurrentListInput readinput = new ReadFaultcurrentListInputBuilder() - .setFilter(Arrays.asList(new FilterBuilder().setProperty("id").setFiltervalue(dbId).build())) + .setFilter(YangHelper2.getListOrMap(FilterKey.class, new FilterBuilder().setProperty("id").setFiltervalue(dbId).build())) .setPagination(getPagination(20, 1)).build(); ReadFaultcurrentListOutputBuilder readResult = null; @@ -599,7 +600,7 @@ public class TestCRUDforDatabase { fail("Fault log not read: " + e.getMessage()); } - List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.faultcurrent.list.output.Data> data = + List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.faultcurrent.list.output.Data> data = readResult.getData(); @@ -681,7 +682,7 @@ public class TestCRUDforDatabase { String dbId = null; String json = "{\n" + "\"timestamp\": \"2019-11-01T11:28:34.7Z\",\n" + "\"status\": \"Connecting\",\n" + "\"node-id\": \"sim2230\",\n" - + "\"implemented-interface\": \"org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateConnectionlogInput\"\n" + + "\"implemented-interface\": \"org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateConnectionlogInput\"\n" + "}"; dbId = dbRawProvider.doUpdateOrCreate(Entity.Connectionlog.getName(), initialDbId, json); @@ -692,7 +693,7 @@ public class TestCRUDforDatabase { System.out.println("Try read entry"); ReadConnectionlogListInput readinput = new ReadConnectionlogListInputBuilder() - .setFilter(Arrays.asList(new FilterBuilder().setProperty("id").setFiltervalue(dbId).build())) + .setFilter(YangHelper2.getListOrMap(FilterKey.class, new FilterBuilder().setProperty("id").setFiltervalue(dbId).build())) .setPagination(getPagination(20, 1)).build(); ReadConnectionlogListOutputBuilder readResult = null; @@ -703,7 +704,7 @@ public class TestCRUDforDatabase { fail("Connection log not read: " + e.getMessage()); } - List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.connectionlog.list.output.Data> data = + List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.connectionlog.list.output.Data> data = readResult.getData(); assertNotNull(data); @@ -721,7 +722,7 @@ public class TestCRUDforDatabase { System.out.println("Try read updated entry"); readinput = new ReadConnectionlogListInputBuilder() - .setFilter(Arrays.asList(new FilterBuilder().setProperty("status").setFiltervalue("Connected").build())) + .setFilter(YangHelper2.getListOrMap(FilterKey.class, new FilterBuilder().setProperty("status").setFiltervalue("Connected").build())) .setPagination(getPagination(20, 1)).build(); try { @@ -772,7 +773,7 @@ public class TestCRUDforDatabase { String dbId = null; String json = " {\n" + "\"timestamp\": \"2019-11-08T16:39:23.0Z\",\n" + "\"new-value\": \"done\",\n" + "\"object-id\": \"SDN-Controller-0\",\n" + "\"attribute-name\": \"startup\",\n" + "\"counter\": 0,\n" - + "\"implemented-interface\": \"org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Eventlog\",\n" + + "\"implemented-interface\": \"org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Eventlog\",\n" + "\"node-id\": \"SDN-Controller-0\"\n" + "}"; dbId = dbRawProvider.doUpdateOrCreate(Entity.Eventlog.getName(), "1", json); @@ -781,7 +782,7 @@ public class TestCRUDforDatabase { // ==READ=========================== ReadEventlogListInput readinput = new ReadEventlogListInputBuilder() - .setFilter(Arrays.asList(new FilterBuilder().setProperty("id").setFiltervalue(dbId).build())) + .setFilter(YangHelper2.getListOrMap(FilterKey.class, new FilterBuilder().setProperty("id").setFiltervalue(dbId).build())) .setPagination(getPagination(20, 1)).build(); ReadEventlogListOutputBuilder readResult = null; try { @@ -791,7 +792,7 @@ public class TestCRUDforDatabase { fail("problem reading eventlog"); } - List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.eventlog.list.output.Data> data = + List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.eventlog.list.output.Data> data = readResult.getData(); assertEquals(1, data.size()); @@ -839,7 +840,7 @@ public class TestCRUDforDatabase { + " \"contained-holder\": [ ],\n" + " \"manufacturer-name\": \"Lorem Ipsum\",\n" + " \"manufacturer-identifier\": \"ONF-Wireless-Transport\",\n" + " \"serial\": \"sd-dsa-eqw\",\n" + " \"date\": \"2008-10-21T00:00:00.0Z\",\n" - + "\"implemented-interface\": \"org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Inventory\",\n" + + "\"implemented-interface\": \"org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Inventory\",\n" + " \"version\": \"unknown\",\n" + " \"description\": \"WS/DS3\",\n" + " \"part-type-id\": \"unknown\",\n" + " \"model-identifier\": \"model-id-s3s\",\n" + " \"type-name\": \"p4.module\"}"; @@ -849,7 +850,7 @@ public class TestCRUDforDatabase { // ==READ=========================== ReadInventoryListInput readinput = new ReadInventoryListInputBuilder() - .setFilter(Arrays.asList(new FilterBuilder().setProperty("id").setFiltervalue(dbId).build())) + .setFilter(YangHelper2.getListOrMap(FilterKey.class, new FilterBuilder().setProperty("id").setFiltervalue(dbId).build())) .setPagination(getPagination(20, 1)).build(); ReadInventoryListOutputBuilder readResult = null; try { @@ -859,7 +860,7 @@ public class TestCRUDforDatabase { fail("Problem reading inventory list" + e.getMessage()); } - List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.inventory.list.output.Data> data = + List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.inventory.list.output.Data> data = readResult.getData(); assertEquals(1, data.size()); assertEquals("Lorem Ipsum", data.get(0).getManufacturerName()); @@ -978,7 +979,7 @@ public class TestCRUDforDatabase { //== VERIFY DELETE =========================== System.out.println("verify entries deleted"); - List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._15m.list.output.Data> data = + List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.pmdata._15m.list.output.Data> data = dbProvider .readPmdata15mList( new ReadPmdata15mListInputBuilder().setPagination(getPagination(20, 1)).build()) @@ -1014,7 +1015,7 @@ public class TestCRUDforDatabase { System.out.println("read list entries..."); ReadPmdata15mListInput read = new ReadPmdata15mListInputBuilder() - .setFilter(Arrays.asList(new FilterBuilder().setProperty("node-name").setFiltervalue("a2").build())) + .setFilter(YangHelper2.getListOrMap(FilterKey.class, new FilterBuilder().setProperty("node-name").setFiltervalue("a2").build())) .setPagination(getPagination(20, 1)).build(); ReadPmdata15mListOutputBuilder readResult = null; @@ -1025,7 +1026,7 @@ public class TestCRUDforDatabase { fail("Problem reading 15m data"); } - List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._15m.list.output.Data> data = + List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.pmdata._15m.list.output.Data> data = readResult.getData(); assertNotNull(data); @@ -1034,7 +1035,7 @@ public class TestCRUDforDatabase { System.out.println("read ltp entries with node name set..."); ReadPmdata15mLtpListInput readLtp = new ReadPmdata15mLtpListInputBuilder() - .setFilter(Arrays.asList(new FilterBuilder().setProperty("node-name").setFiltervalue("a2").build())) + .setFilter(YangHelper2.getListOrMap(FilterKey.class, new FilterBuilder().setProperty("node-name").setFiltervalue("a2").build())) .setPagination(getPagination(20, 1)).build(); ReadPmdata15mLtpListOutputBuilder readltpResult = null; @@ -1122,7 +1123,7 @@ public class TestCRUDforDatabase { fail("Problem reading 24h data"); } - List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._24h.list.output.Data> data = + List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.pmdata._24h.list.output.Data> data = readResult.getData(); assertNotNull(data); @@ -1132,7 +1133,7 @@ public class TestCRUDforDatabase { System.out.println("filter list entries..."); read = new ReadPmdata24hListInputBuilder() - .setFilter(Arrays.asList(new FilterBuilder().setProperty("node-name").setFiltervalue("a2").build())) + .setFilter(YangHelper2.getListOrMap(FilterKey.class, new FilterBuilder().setProperty("node-name").setFiltervalue("a2").build())) .setPagination(getPagination(20, 1)).build(); readResult = null; @@ -1151,7 +1152,7 @@ public class TestCRUDforDatabase { System.out.println("read ltp entries with node name set..."); ReadPmdata24hLtpListInput readLtp = new ReadPmdata24hLtpListInputBuilder() - .setFilter(Arrays.asList(new FilterBuilder().setProperty("node-name").setFiltervalue("a2").build())) + .setFilter(YangHelper2.getListOrMap(FilterKey.class, new FilterBuilder().setProperty("node-name").setFiltervalue("a2").build())) .setPagination(getPagination(20, 1)).build(); ReadPmdata24hLtpListOutputBuilder readltpResult = null; @@ -1298,7 +1299,7 @@ public class TestCRUDforDatabase { System.out.println("Test DoUpdateOrCreate doesn't create new database entry if null is passed"); String dbId = clearAndCreatefaultEntity(null, Entity.Faultlog.getName(), - "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateFaultlogInput", + "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateFaultlogInput", SeverityType.Critical); assertNull(dbId); } @@ -1308,7 +1309,7 @@ public class TestCRUDforDatabase { System.out.println("Starting faultCurrent test..."); String dbId = null; dbId = clearAndCreatefaultEntity("1", Entity.Faultcurrent.getName(), - "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateFaultcurrentInput", + "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateFaultcurrentInput", SeverityType.Critical); assertEquals("1", dbId); @@ -1325,7 +1326,7 @@ public class TestCRUDforDatabase { String expectedDbResult = - "{\"severity\":\"Critical\",\"node-id\":\"s1\",\"problem\":\"signalIsLost\",\"counter\":4340,\"object-id\":\"LP-MWPS-RADIO\",\"implemented-interface\":\"org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateFaultcurrentInput\",\"type\":\"ProblemNotificationXml\",\"timestamp\":\"2019-10-28T11:55:58.3Z\"}"; + "{\"severity\":\"Critical\",\"node-id\":\"s1\",\"problem\":\"signalIsLost\",\"counter\":4340,\"object-id\":\"LP-MWPS-RADIO\",\"implemented-interface\":\"org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateFaultcurrentInput\",\"type\":\"ProblemNotificationXml\",\"timestamp\":\"2019-10-28T11:55:58.3Z\"}"; System.out.println(readResult); assertNotNull(readResult); @@ -1355,14 +1356,14 @@ public class TestCRUDforDatabase { } @Test - public void testOutputCamelCase() { + public void testOutputCamelCase() throws ClassNotFoundException { try { String jsonString = "{\n" + "\"timestamp\": \"2020-02-20T09:31:22.3Z\",\n" + "\"object-id\": \"LP-MWPS-RADIO\",\n" + "\"severity\": \"Critical\",\n" + "\"counter\": 10,\n" - + "\"implemented-interface\": \"org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Faultlog\",\n" + + "\"implemented-interface\": \"org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Faultlog\",\n" + "\"source-type\": \"Netconf\",\n" + "\"node-id\": \"sim4\",\n" + "\"problem\": \"signalIsLost\"\n" + "}"; - YangToolsMapper yangtoolsMapper = new YangToolsMapper(); + YangToolsMapper2<Faultlog> yangtoolsMapper = new YangToolsMapper2<>(Faultlog.class,null); FaultlogEntity log = yangtoolsMapper.readValue(jsonString, Faultlog.class); System.out.println(log); System.out.println(yangtoolsMapper.writeValueAsString(log)); diff --git a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestDataMappings.java b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestDataMappings.java index f63beee43..6584d0503 100644 --- a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestDataMappings.java +++ b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestDataMappings.java @@ -24,7 +24,7 @@ package org.onap.ccsdk.features.sdnr.wt.dataprovider.test; import java.io.IOException; import org.junit.Test; import org.onap.ccsdk.features.sdnr.wt.dataprovider.yangtools.YangToolsMapper; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._15m.list.output.Data; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.pmdata._15m.list.output.Data; public class TestDataMappings { diff --git a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestEventService.java b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestEventService.java index ccb1ea53f..95abfdd58 100644 --- a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestEventService.java +++ b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestEventService.java @@ -42,26 +42,26 @@ import org.onap.ccsdk.features.sdnr.wt.dataprovider.data.entity.HtDatabaseEvents import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.types.NetconfTimeStampImpl; import org.onap.ccsdk.features.sdnr.wt.dataprovider.test.util.HostInfoForTest; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ConnectionLogStatus; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ConnectionlogBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ConnectionlogEntity; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Entity; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.EventlogBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.EventlogEntity; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.FaultcurrentBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.FaultcurrentEntity; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.FaultlogBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.FaultlogEntity; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.GranularityPeriodType; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Inventory; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.InventoryBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.NetworkElementConnectionBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.NetworkElementConnectionEntity; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.NetworkElementDeviceType; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.PmdataEntity; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.PmdataEntityBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.SeverityType; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.SourceType; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ConnectionLogStatus; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ConnectionlogBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ConnectionlogEntity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Entity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EventlogBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EventlogEntity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.FaultcurrentBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.FaultcurrentEntity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.FaultlogBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.FaultlogEntity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.GranularityPeriodType; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Inventory; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.InventoryBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.NetworkElementConnectionBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.NetworkElementConnectionEntity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.NetworkElementDeviceType; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.PmdataEntity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.PmdataEntityBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SeverityType; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SourceType; /** * @author Michael Dürre @@ -272,7 +272,7 @@ public class TestEventService { */ private Inventory createEquipment(String nodeId, String uuid) { return new InventoryBuilder().setNodeId(nodeId).setParentUuid("").setDescription("desc") - .setManufacturerName("manu").setUuid(uuid).build(); + .setManufacturerName("manu").setDate(NetconfTimeStampImpl.getConverter().getTimeStampAsNetconfString()).setUuid(uuid).build(); } /** diff --git a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestFilterConversion.java b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestFilterConversion.java index 717b7add6..68d367668 100644 --- a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestFilterConversion.java +++ b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestFilterConversion.java @@ -22,25 +22,23 @@ package org.onap.ccsdk.features.sdnr.wt.dataprovider.test; import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; - import java.util.Arrays; import java.util.List; - import org.junit.Test; import org.mockito.Mockito; -import org.mockito.stubbing.Answer; import org.onap.ccsdk.features.sdnr.wt.common.database.queries.QueryBuilder; -import org.onap.ccsdk.features.sdnr.wt.common.database.requests.SearchRequest; import org.onap.ccsdk.features.sdnr.wt.dataprovider.data.rpctypehelper.QueryByFilter; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.EntityInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.SortOrder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.entity.input.Filter; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.entity.input.FilterBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.entity.input.Sortorder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.entity.input.SortorderBuilder; +import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.types.YangHelper2; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EntityInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SortOrder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.entity.input.Filter; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.entity.input.FilterBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.entity.input.FilterKey; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.entity.input.Sortorder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.entity.input.SortorderBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.entity.input.SortorderKey; public class TestFilterConversion extends Mockito { @@ -52,7 +50,7 @@ public class TestFilterConversion extends Mockito { public void testQuestionMark1() { EntityInput input = mock(EntityInput.class); List<Filter> filters = Arrays.asList(new FilterBuilder().setProperty(PROPERTY).setFiltervalue("si?ba").build()); - when(input.getFilter()).thenReturn(filters); + when(input.getFilter()).thenReturn(YangHelper2.getListOrMap(FilterKey.class, filters)); QueryBuilder query = new QueryByFilter(input).getQueryBuilderByFilter(); System.out.println(query.toJSON()); @@ -66,7 +64,7 @@ public class TestFilterConversion extends Mockito { public void testQuestionMarkExcpetion() { EntityInput input = mock(EntityInput.class); List<Filter> filters = Arrays.asList(new FilterBuilder().setProperty(PROPERTY).setFiltervalue("si?ba").build()); - when(input.getFilter()).thenReturn(filters); + when(input.getFilter()).thenReturn(YangHelper2.getListOrMap(FilterKey.class, filters)); try { new QueryByFilter(input).getSearchRequestByFilter("test1", "test2", "test3", "test4"); fail(); @@ -81,7 +79,7 @@ public class TestFilterConversion extends Mockito { EntityInput input = mock(EntityInput.class); List<Filter> filters = Arrays.asList(new FilterBuilder().setProperty(PROPERTY).setFiltervalue("si?ba").build(), new FilterBuilder().setProperty(PROPERTY2).setFiltervalue("abc").build()); - when(input.getFilter()).thenReturn(filters); + when(input.getFilter()).thenReturn(YangHelper2.getListOrMap(FilterKey.class, filters)); QueryBuilder query = new QueryByFilter(input).getQueryBuilderByFilter(); System.out.println(query.toJSON()); assertNotNull(new QueryByFilter(input).getQueryBuilderByFilter(PROPERTY2)); @@ -94,8 +92,8 @@ public class TestFilterConversion extends Mockito { new FilterBuilder().setProperty(PROPERTY3).setFiltervalue("<2019-06-13T15:00:12.0Z").build()); List<Sortorder> sortorder = Arrays.asList(new SortorderBuilder().setProperty(PROPERTY).setSortorder(SortOrder.Ascending).build()); - when(input.getFilter()).thenReturn(filters); - when(input.getSortorder()).thenReturn(sortorder); + when(input.getFilter()).thenReturn(YangHelper2.getListOrMap(FilterKey.class, filters)); + when(input.getSortorder()).thenReturn(YangHelper2.getListOrMap(SortorderKey.class, sortorder)); assertNotNull(new QueryByFilter(input).getQueryBuilderByFilter(PROPERTY)); } @@ -105,7 +103,7 @@ public class TestFilterConversion extends Mockito { EntityInput input = mock(EntityInput.class); List<Sortorder> sortorder = Arrays .asList(new SortorderBuilder().setProperty("source-type").setSortorder(SortOrder.Ascending).build()); - when(input.getSortorder()).thenReturn(sortorder); + when(input.getSortorder()).thenReturn(YangHelper2.getListOrMap(SortorderKey.class, sortorder)); QueryBuilder query = new QueryByFilter(input).getQueryBuilderByFilter(); System.out.println(query.toJSON()); } diff --git a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestMaintenanceServiceData.java b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestMaintenanceServiceData.java index 897fcc8d0..b9516b363 100644 --- a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestMaintenanceServiceData.java +++ b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestMaintenanceServiceData.java @@ -36,9 +36,9 @@ import org.onap.ccsdk.features.sdnr.wt.common.database.requests.DeleteByQueryReq import org.onap.ccsdk.features.sdnr.wt.dataprovider.data.ElasticSearchDataProvider; import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.HtDatabaseMaintenance; import org.onap.ccsdk.features.sdnr.wt.dataprovider.test.util.HostInfoForTest; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Entity; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.MaintenanceBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.MaintenanceEntity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Entity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.MaintenanceBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.MaintenanceEntity; /** * - Handling of inital values for Maintenance mode. diff --git a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestMediatorServerService.java b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestMediatorServerService.java index 7afc5214c..5b4bc3e0f 100644 --- a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestMediatorServerService.java +++ b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestMediatorServerService.java @@ -35,9 +35,9 @@ import org.onap.ccsdk.features.sdnr.wt.common.database.requests.DeleteByQueryReq import org.onap.ccsdk.features.sdnr.wt.dataprovider.data.ElasticSearchDataProvider; import org.onap.ccsdk.features.sdnr.wt.dataprovider.data.MediatorServerDataProvider; import org.onap.ccsdk.features.sdnr.wt.dataprovider.test.util.HostInfoForTest; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateMediatorServerInputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateMediatorServerOutputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Entity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateMediatorServerInputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateMediatorServerOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Entity; /** * @author Michael Dürre diff --git a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestNuMappings.java b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestNuMappings.java index bcd2ea75d..76286c820 100644 --- a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestNuMappings.java +++ b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestNuMappings.java @@ -25,9 +25,9 @@ import static org.junit.Assert.assertTrue; import java.io.IOException; import org.junit.Test; import org.onap.ccsdk.features.sdnr.wt.dataprovider.yangtools.YangToolsMapper; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Faultcurrent; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.FaultcurrentBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.SeverityType; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Faultcurrent; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.FaultcurrentBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SeverityType; public class TestNuMappings { diff --git a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestTimestampFilter.java b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestTimestampFilter.java index b8fa5d668..ad525b910 100644 --- a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestTimestampFilter.java +++ b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestTimestampFilter.java @@ -24,170 +24,66 @@ package org.onap.ccsdk.features.sdnr.wt.dataprovider.test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; - import java.util.Arrays; import java.util.List; - import org.json.JSONObject; import org.junit.Test; import org.mockito.Mockito; import org.onap.ccsdk.features.sdnr.wt.common.database.queries.QueryBuilder; import org.onap.ccsdk.features.sdnr.wt.dataprovider.data.rpctypehelper.QueryByFilter; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.EntityInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.entity.input.Filter; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.entity.input.FilterBuilder; +import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.types.YangHelper2; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EntityInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.entity.input.Filter; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.entity.input.FilterBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.entity.input.FilterKey; public class TestTimestampFilter extends Mockito { @Test public void testTimestampRange() { final String PROPERTY_TIMESTAMP = "timestamp"; - List<Filter> filters = - Arrays.asList(new FilterBuilder().setProperty(PROPERTY_TIMESTAMP).setFiltervalue("2017*").build()); - EntityInput input = mock(EntityInput.class); - when(input.getFilter()).thenReturn(filters); - QueryBuilder query = new QueryByFilter(input).getQueryBuilderByFilter(); - assertRange(query.getInner(), PROPERTY_TIMESTAMP, "2017-01-01T00:00:00.0Z", "2018-01-01T00:00:00.0Z"); - - filters = Arrays.asList(new FilterBuilder().setProperty(PROPERTY_TIMESTAMP).setFiltervalue("2*").build()); - when(input.getFilter()).thenReturn(filters); - query = new QueryByFilter(input).getQueryBuilderByFilter(); - assertRange(query.getInner(), PROPERTY_TIMESTAMP, "2000-01-01T00:00:00.0Z", "3000-01-01T00:00:00.0Z"); - - filters = Arrays.asList(new FilterBuilder().setProperty(PROPERTY_TIMESTAMP).setFiltervalue("20*").build()); - when(input.getFilter()).thenReturn(filters); - query = new QueryByFilter(input).getQueryBuilderByFilter(); - assertRange(query.getInner(), PROPERTY_TIMESTAMP, "2000-01-01T00:00:00.0Z", "2100-01-01T00:00:00.0Z"); - - filters = Arrays.asList(new FilterBuilder().setProperty(PROPERTY_TIMESTAMP).setFiltervalue("205*").build()); - when(input.getFilter()).thenReturn(filters); - query = new QueryByFilter(input).getQueryBuilderByFilter(); - assertRange(query.getInner(), PROPERTY_TIMESTAMP, "2050-01-01T00:00:00.0Z", "2060-01-01T00:00:00.0Z"); - - filters = Arrays.asList(new FilterBuilder().setProperty(PROPERTY_TIMESTAMP).setFiltervalue("2050*").build()); - when(input.getFilter()).thenReturn(filters); - query = new QueryByFilter(input).getQueryBuilderByFilter(); - assertRange(query.getInner(), PROPERTY_TIMESTAMP, "2050-01-01T00:00:00.0Z", "2051-01-01T00:00:00.0Z"); - - filters = Arrays.asList(new FilterBuilder().setProperty(PROPERTY_TIMESTAMP).setFiltervalue("2050-*").build()); - when(input.getFilter()).thenReturn(filters); - query = new QueryByFilter(input).getQueryBuilderByFilter(); - assertRange(query.getInner(), PROPERTY_TIMESTAMP, "2050-01-01T00:00:00.0Z", "2051-01-01T00:00:00.0Z"); - - filters = Arrays.asList(new FilterBuilder().setProperty(PROPERTY_TIMESTAMP).setFiltervalue("2050-1*").build()); - when(input.getFilter()).thenReturn(filters); - query = new QueryByFilter(input).getQueryBuilderByFilter(); - assertRange(query.getInner(), PROPERTY_TIMESTAMP, "2050-10-01T00:00:00.0Z", "2051-01-01T00:00:00.0Z"); - - filters = Arrays.asList(new FilterBuilder().setProperty(PROPERTY_TIMESTAMP).setFiltervalue("2050-10*").build()); - when(input.getFilter()).thenReturn(filters); - query = new QueryByFilter(input).getQueryBuilderByFilter(); - assertRange(query.getInner(), PROPERTY_TIMESTAMP, "2050-10-01T00:00:00.0Z", "2050-11-01T00:00:00.0Z"); - - filters = - Arrays.asList(new FilterBuilder().setProperty(PROPERTY_TIMESTAMP).setFiltervalue("2050-10-*").build()); - when(input.getFilter()).thenReturn(filters); - query = new QueryByFilter(input).getQueryBuilderByFilter(); - assertRange(query.getInner(), PROPERTY_TIMESTAMP, "2050-10-01T00:00:00.0Z", "2050-11-01T00:00:00.0Z"); - - filters = - Arrays.asList(new FilterBuilder().setProperty(PROPERTY_TIMESTAMP).setFiltervalue("2050-10-0*").build()); - when(input.getFilter()).thenReturn(filters); - query = new QueryByFilter(input).getQueryBuilderByFilter(); - assertRange(query.getInner(), PROPERTY_TIMESTAMP, "2050-10-01T00:00:00.0Z", "2050-10-10T00:00:00.0Z"); - - filters = Arrays - .asList(new FilterBuilder().setProperty(PROPERTY_TIMESTAMP).setFiltervalue("2050-10-02*").build()); - when(input.getFilter()).thenReturn(filters); - query = new QueryByFilter(input).getQueryBuilderByFilter(); - assertRange(query.getInner(), PROPERTY_TIMESTAMP, "2050-10-02T00:00:00.0Z", "2050-10-03T00:00:00.0Z"); - - filters = Arrays - .asList(new FilterBuilder().setProperty(PROPERTY_TIMESTAMP).setFiltervalue("2050-10-14*").build()); - when(input.getFilter()).thenReturn(filters); - query = new QueryByFilter(input).getQueryBuilderByFilter(); - assertRange(query.getInner(), PROPERTY_TIMESTAMP, "2050-10-14T00:00:00.0Z", "2050-10-15T00:00:00.0Z"); - - filters = Arrays - .asList(new FilterBuilder().setProperty(PROPERTY_TIMESTAMP).setFiltervalue("2050-10-14T*").build()); - when(input.getFilter()).thenReturn(filters); - query = new QueryByFilter(input).getQueryBuilderByFilter(); - assertRange(query.getInner(), PROPERTY_TIMESTAMP, "2050-10-14T00:00:00.0Z", "2050-10-15T00:00:00.0Z"); - filters = Arrays - .asList(new FilterBuilder().setProperty(PROPERTY_TIMESTAMP).setFiltervalue("2050-10-14T1*").build()); - when(input.getFilter()).thenReturn(filters); - query = new QueryByFilter(input).getQueryBuilderByFilter(); - assertRange(query.getInner(), PROPERTY_TIMESTAMP, "2050-10-14T10:00:00.0Z", "2050-10-14T20:00:00.0Z"); - - filters = Arrays - .asList(new FilterBuilder().setProperty(PROPERTY_TIMESTAMP).setFiltervalue("2050-10-14T12*").build()); - when(input.getFilter()).thenReturn(filters); - query = new QueryByFilter(input).getQueryBuilderByFilter(); - assertRange(query.getInner(), PROPERTY_TIMESTAMP, "2050-10-14T12:00:00.0Z", "2050-10-14T13:00:00.0Z"); - - filters = Arrays - .asList(new FilterBuilder().setProperty(PROPERTY_TIMESTAMP).setFiltervalue("2050-10-14T12:*").build()); - when(input.getFilter()).thenReturn(filters); - query = new QueryByFilter(input).getQueryBuilderByFilter(); - assertRange(query.getInner(), PROPERTY_TIMESTAMP, "2050-10-14T12:00:00.0Z", "2050-10-14T13:00:00.0Z"); - - filters = Arrays - .asList(new FilterBuilder().setProperty(PROPERTY_TIMESTAMP).setFiltervalue("2050-10-14T12:4*").build()); - when(input.getFilter()).thenReturn(filters); - query = new QueryByFilter(input).getQueryBuilderByFilter(); - assertRange(query.getInner(), PROPERTY_TIMESTAMP, "2050-10-14T12:40:00.0Z", "2050-10-14T12:50:00.0Z"); - - filters = Arrays.asList( - new FilterBuilder().setProperty(PROPERTY_TIMESTAMP).setFiltervalue("2050-10-14T12:42*").build()); - when(input.getFilter()).thenReturn(filters); - query = new QueryByFilter(input).getQueryBuilderByFilter(); - assertRange(query.getInner(), PROPERTY_TIMESTAMP, "2050-10-14T12:42:00.0Z", "2050-10-14T12:43:00.0Z"); - - filters = Arrays.asList( - new FilterBuilder().setProperty(PROPERTY_TIMESTAMP).setFiltervalue("2050-10-14T12:42:*").build()); - when(input.getFilter()).thenReturn(filters); - query = new QueryByFilter(input).getQueryBuilderByFilter(); - assertRange(query.getInner(), PROPERTY_TIMESTAMP, "2050-10-14T12:42:00.0Z", "2050-10-14T12:43:00.0Z"); - - filters = Arrays.asList( - new FilterBuilder().setProperty(PROPERTY_TIMESTAMP).setFiltervalue("2050-10-14T12:42:5*").build()); - when(input.getFilter()).thenReturn(filters); - query = new QueryByFilter(input).getQueryBuilderByFilter(); - assertRange(query.getInner(), PROPERTY_TIMESTAMP, "2050-10-14T12:42:50.0Z", "2050-10-14T12:43:00.0Z"); - - filters = Arrays.asList( - new FilterBuilder().setProperty(PROPERTY_TIMESTAMP).setFiltervalue("2050-10-14T12:42:56*").build()); - when(input.getFilter()).thenReturn(filters); - query = new QueryByFilter(input).getQueryBuilderByFilter(); - assertRange(query.getInner(), PROPERTY_TIMESTAMP, "2050-10-14T12:42:56.0Z", "2050-10-14T12:42:57.0Z"); + testFilterValue(PROPERTY_TIMESTAMP,"2017*", "2017-01-01T00:00:00.0Z", "2018-01-01T00:00:00.0Z"); + testFilterValue(PROPERTY_TIMESTAMP,"2*", "2000-01-01T00:00:00.0Z", "3000-01-01T00:00:00.0Z"); + testFilterValue(PROPERTY_TIMESTAMP,"20*", "2000-01-01T00:00:00.0Z", "2100-01-01T00:00:00.0Z"); + testFilterValue(PROPERTY_TIMESTAMP,"205*", "2050-01-01T00:00:00.0Z", "2060-01-01T00:00:00.0Z"); + testFilterValue(PROPERTY_TIMESTAMP,"2050*", "2050-01-01T00:00:00.0Z", "2051-01-01T00:00:00.0Z"); + testFilterValue(PROPERTY_TIMESTAMP,"2050-*", "2050-01-01T00:00:00.0Z", "2051-01-01T00:00:00.0Z"); + testFilterValue(PROPERTY_TIMESTAMP,"2050-1*", "2050-10-01T00:00:00.0Z", "2051-01-01T00:00:00.0Z"); + testFilterValue(PROPERTY_TIMESTAMP,"2050-10*", "2050-10-01T00:00:00.0Z", "2050-11-01T00:00:00.0Z"); + testFilterValue(PROPERTY_TIMESTAMP,"2050-10-*", "2050-10-01T00:00:00.0Z", "2050-11-01T00:00:00.0Z"); + testFilterValue(PROPERTY_TIMESTAMP,"2050-10-0*", "2050-10-01T00:00:00.0Z", "2050-10-10T00:00:00.0Z"); + testFilterValue(PROPERTY_TIMESTAMP,"2050-10-02*", "2050-10-02T00:00:00.0Z", "2050-10-03T00:00:00.0Z"); + testFilterValue(PROPERTY_TIMESTAMP,"2050-10-14*", "2050-10-14T00:00:00.0Z", "2050-10-15T00:00:00.0Z"); + testFilterValue(PROPERTY_TIMESTAMP,"2050-10-14T*", "2050-10-14T00:00:00.0Z", "2050-10-15T00:00:00.0Z"); + testFilterValue(PROPERTY_TIMESTAMP,"2050-10-14T1*", "2050-10-14T10:00:00.0Z", "2050-10-14T20:00:00.0Z"); + testFilterValue(PROPERTY_TIMESTAMP,"2050-10-14T12*", "2050-10-14T12:00:00.0Z", "2050-10-14T13:00:00.0Z"); + testFilterValue(PROPERTY_TIMESTAMP,"2050-10-14T12:*", "2050-10-14T12:00:00.0Z", "2050-10-14T13:00:00.0Z"); + testFilterValue(PROPERTY_TIMESTAMP,"2050-10-14T12:4*", "2050-10-14T12:40:00.0Z", "2050-10-14T12:50:00.0Z"); + testFilterValue(PROPERTY_TIMESTAMP,"2050-10-14T12:42*", "2050-10-14T12:42:00.0Z", "2050-10-14T12:43:00.0Z"); + testFilterValue(PROPERTY_TIMESTAMP,"2050-10-14T12:42:*", "2050-10-14T12:42:00.0Z", "2050-10-14T12:43:00.0Z"); + testFilterValue(PROPERTY_TIMESTAMP,"2050-10-14T12:42:5*", "2050-10-14T12:42:50.0Z", "2050-10-14T12:43:00.0Z"); + testFilterValue(PROPERTY_TIMESTAMP,"2050-10-14T12:42:56*", "2050-10-14T12:42:56.0Z", "2050-10-14T12:42:57.0Z"); } @Test public void testExtra() { final String PROPERTY_TIMESTAMP = "end"; - EntityInput input = mock(EntityInput.class); - List<Filter> filters; - filters = Arrays - .asList(new FilterBuilder().setProperty(PROPERTY_TIMESTAMP).setFiltervalue("2020-02-19T*").build()); - when(input.getFilter()).thenReturn(filters); - QueryBuilder query = new QueryByFilter(input).getQueryBuilderByFilter(); - assertRange(query.getInner(), PROPERTY_TIMESTAMP, "2020-02-19T00:00:00.0Z", "2020-02-20T00:00:00.0Z"); - - filters = Arrays - .asList(new FilterBuilder().setProperty(PROPERTY_TIMESTAMP).setFiltervalue("2020-02-19*").build()); - when(input.getFilter()).thenReturn(filters); - query = new QueryByFilter(input).getQueryBuilderByFilter(); - assertRange(query.getInner(), PROPERTY_TIMESTAMP, "2020-02-19T00:00:00.0Z", "2020-02-20T00:00:00.0Z"); - - filters = Arrays.asList(new FilterBuilder().setProperty(PROPERTY_TIMESTAMP).setFiltervalue("2020*").build()); - when(input.getFilter()).thenReturn(filters); - query = new QueryByFilter(input).getQueryBuilderByFilter(); - assertRange(query.getInner(), PROPERTY_TIMESTAMP, "2020-01-01T00:00:00.0Z", "2021-01-01T00:00:00.0Z"); + testFilterValue(PROPERTY_TIMESTAMP,"2020-02-19T*", "2020-02-19T00:00:00.0Z", "2020-02-20T00:00:00.0Z"); + testFilterValue(PROPERTY_TIMESTAMP,"2020-02-19*", "2020-02-19T00:00:00.0Z", "2020-02-20T00:00:00.0Z"); + testFilterValue(PROPERTY_TIMESTAMP,"2020*", "2020-01-01T00:00:00.0Z", "2021-01-01T00:00:00.0Z"); } + private void testFilterValue(String property, String filterString, String starttime, String endtime) { + List<Filter> filters = + Arrays.asList(new FilterBuilder().setProperty(property).setFiltervalue(filterString).build()); + EntityInput input = mock(EntityInput.class); + when(input.getFilter()).thenReturn(YangHelper2.getListOrMap(FilterKey.class, filters)); + QueryBuilder query = new QueryByFilter(input).getQueryBuilderByFilter(); + assertRange(query.getInner(), property, starttime, endtime); + } private void assertRange(JSONObject rangeQuery, String property, String lower, String upper) { System.out.println("==test for " + rangeQuery.toString()); @@ -201,4 +97,6 @@ public class TestTimestampFilter extends Mockito { assertEquals(lower, o.getString("gte")); System.out.println("succeeded"); } + + } diff --git a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestTree.java b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestTree.java index 970816514..294dd436f 100644 --- a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestTree.java +++ b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestTree.java @@ -41,7 +41,7 @@ import org.onap.ccsdk.features.sdnr.wt.dataprovider.http.DataTreeHttpServlet.Fil import org.onap.ccsdk.features.sdnr.wt.dataprovider.http.DataTreeObject; import org.onap.ccsdk.features.sdnr.wt.dataprovider.impl.DataTreeProviderImpl; import org.onap.ccsdk.features.sdnr.wt.dataprovider.test.util.HostInfoForTest; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Entity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Entity; /** * @author Michael Dürre diff --git a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestYangGenSalMapping.java b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestYangGenSalMapping.java index d8d424174..f7ab7c383 100644 --- a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestYangGenSalMapping.java +++ b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestYangGenSalMapping.java @@ -45,19 +45,19 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev15 import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNodeBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.connection.parameters.OdlHelloMessageCapabilitiesBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.credentials.credentials.LoginPasswordBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateMediatorServerInputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Entity; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.EntityInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata15mListInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata15mListInputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata15mListOutputBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.SortOrder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.entity.input.Filter; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.entity.input.PaginationBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.entity.input.Sortorder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.pmdata15m.entity.PerformanceDataBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._15m.list.output.Data; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._15m.list.output.DataBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateMediatorServerInputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Entity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EntityInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadPmdata15mListInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadPmdata15mListInputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadPmdata15mListOutputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SortOrder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.entity.input.Filter; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.entity.input.PaginationBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.entity.input.Sortorder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.pmdata15m.entity.PerformanceDataBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.pmdata._15m.list.output.Data; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.pmdata._15m.list.output.DataBuilder; public class TestYangGenSalMapping { @@ -106,17 +106,17 @@ public class TestYangGenSalMapping { HostInfo[] hostInfo = HostInfoForTest.get(); HtDatabaseClient db = HtDatabaseClient.getClient(hostInfo); - EsDataObjectReaderWriter2<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.inventory.list.output.Data> dataRW = + EsDataObjectReaderWriter2<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.inventory.list.output.Data> dataRW = new EsDataObjectReaderWriter2<>(db, Entity.Inventoryequipment, - org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.inventory.list.output.Data.class); + org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.inventory.list.output.Data.class); if (!db.isExistsIndex(idx)) { db.createIndex(new CreateIndexRequest(idx)); } - org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.inventory.list.output.Data d1; + org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.inventory.list.output.Data d1; d1 = getInventoryDataBuilder("MyDescription", 23L).build(); String id = dataRW.write(d1, null); - org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.inventory.list.output.Data d2; + org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.inventory.list.output.Data d2; d2 = dataRW.read(id); out(d2.toString()); @@ -277,9 +277,9 @@ public class TestYangGenSalMapping { HostInfo[] hostInfo = HostInfoForTest.get(); HtDatabaseClient dbClient = HtDatabaseClient.getClient(hostInfo); - EsDataObjectReaderWriter2<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._15m.list.output.Data> pm15mRW = + EsDataObjectReaderWriter2<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.pmdata._15m.list.output.Data> pm15mRW = new EsDataObjectReaderWriter2<>(dbClient, Entity.Historicalperformance15min, - org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._15m.list.output.Data.class); + org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.pmdata._15m.list.output.Data.class); pm15mRW.setEsIdAttributeName("_nodeName"); ReadPmdata15mListInputBuilder inputBuilder = new ReadPmdata15mListInputBuilder(); @@ -298,7 +298,7 @@ public class TestYangGenSalMapping { QueryBuilder query = fromFilter(input.getFilter()).from((page - 1) * pageSize).size(pageSize); setSortOrder(query, input.getSortorder()); - SearchResult<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._15m.list.output.Data> result = + SearchResult<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.pmdata._15m.list.output.Data> result = pm15mRW.doReadAll(query); out("Found: " + result.getHits().size()); @@ -316,11 +316,11 @@ public class TestYangGenSalMapping { HostInfo[] hostInfo = HostInfoForTest.get(); HtDatabaseClient dbClient = HtDatabaseClient.getClient(hostInfo); - EsDataObjectReaderWriter2<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.mediator.server.list.output.Data> mediatorserverRW; + EsDataObjectReaderWriter2<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.mediator.server.list.output.Data> mediatorserverRW; mediatorserverRW = new EsDataObjectReaderWriter2<>(dbClient, Entity.MediatorServer, - org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.mediator.server.list.output.Data.class) + org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.mediator.server.list.output.Data.class) .setWriteInterface( - org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.MediatorServerEntity.class) + org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.MediatorServerEntity.class) .setEsIdAttributeName("_id"); CreateMediatorServerInputBuilder inputBuilder = new CreateMediatorServerInputBuilder(); @@ -356,10 +356,10 @@ public class TestYangGenSalMapping { return nameofCurrMethod; } - private org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.inventory.list.output.DataBuilder getInventoryDataBuilder( + private org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.inventory.list.output.DataBuilder getInventoryDataBuilder( String description, long treeLevel) { - org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.inventory.list.output.DataBuilder dataBuilder = - new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.inventory.list.output.DataBuilder(); + org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.inventory.list.output.DataBuilder dataBuilder = + new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.inventory.list.output.DataBuilder(); dataBuilder.setDescription(description); dataBuilder.setTreeLevel(treeLevel); return dataBuilder; @@ -427,8 +427,8 @@ public class TestYangGenSalMapping { private static void setPagination(ReadPmdata15mListOutputBuilder outputBuilder, long page, long pageSize, long totalSize) { - org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._15m.list.output.Pagination value = - new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._15m.list.output.PaginationBuilder() + org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.pmdata._15m.list.output.Pagination value = + new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.pmdata._15m.list.output.PaginationBuilder() .setPage(BigInteger.valueOf(page)).setSize(pageSize).setTotal(BigInteger.valueOf(totalSize)) .build(); outputBuilder.setPagination(value); diff --git a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestYangGenSalMappingOpenRoadm.java b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestYangGenSalMappingOpenRoadm.java new file mode 100644 index 000000000..0a195e03b --- /dev/null +++ b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestYangGenSalMappingOpenRoadm.java @@ -0,0 +1,80 @@ +/* + * ============LICENSE_START======================================================= + * ONAP : ccsdk features + * ================================================================================ + * 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.dataprovider.test; + +import java.io.IOException; +import org.jline.utils.Log; +import org.junit.Test; +import org.onap.ccsdk.features.sdnr.wt.dataprovider.yangtools.YangToolsMapper2; +import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.types.rev191129.PmDataType; +import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.types.rev191129.PmDataTypeBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.PmdataEntity; + +public class TestYangGenSalMappingOpenRoadm { + + @Test + public void testOpenroadmPM() throws IOException, ClassNotFoundException { + out(method()); + // @formatter:off + String jsonString = "{\n" + + " \"time-stamp\":\"2020-09-24T22:59:48.6Z\", \n" + + " \"node-name\":\"Rdm-1\",\n" + + " \"uuid-interface\":\"physical-link\",\n" + + " \"scanner-id\":\"ryyyyyyyryryr\",\n" + + " \"granularity-period\":\"Period24Hours\",\n" + + " \"performance-data\":{\n" + + " \"measurement\":[{\n" + + " \"pm-value\":{\"uint64\":1464170942461338033},\n" + + " \"pm-key\":\"org.opendaylight" + + ".yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.openroadm.pm.types.rev200413.OpticalPowerInputOSCMin\"\n" + + " }]\n" + + " }\n" + + "}\n"; + // @formatter:on + // Map to JSON String to Object + PmDataTypeBuilder builder = new PmDataTypeBuilder(); + builder.setInt64("10"); + PmDataType pmDataType = builder.build(); + out("Result is: "+pmDataType); + + YangToolsMapper2<PmdataEntity> mapper2 = new YangToolsMapper2<>(PmdataEntity.class, null); + out("Created mapper"); + PmdataEntity generatepmdNode = mapper2.readValue(jsonString.getBytes(), PmdataEntity.class); + out(generatepmdNode.toString()); // Print it with specified indentation + } + + /* + * --------------------------------- Private + */ + + private static String method() { + String nameofCurrMethod = new Throwable().getStackTrace()[1].getMethodName(); + return nameofCurrMethod; + } + + private static void out(String text) { + System.out.println("----------------------"); + System.out.println(text); + Log.info("Log: "+text); + } + +} diff --git a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestYangProvider.java b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestYangProvider.java index a2b90074e..f3171d3b1 100644 --- a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestYangProvider.java +++ b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestYangProvider.java @@ -21,11 +21,15 @@ */ package org.onap.ccsdk.features.sdnr.wt.dataprovider.test; -import static org.junit.Assert.*; - +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; import java.io.File; import java.io.IOException; -import java.io.StringWriter; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.attribute.FileAttribute; @@ -36,23 +40,17 @@ import java.text.SimpleDateFormat; import java.util.Comparator; import java.util.EnumSet; import java.util.Set; - import javax.servlet.ServletException; -import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; - import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; +import org.onap.ccsdk.features.sdnr.wt.common.test.ServletOutputStreamToStringWriter; import org.onap.ccsdk.features.sdnr.wt.dataprovider.http.yangschema.YangFileProvider; import org.onap.ccsdk.features.sdnr.wt.dataprovider.http.yangschema.YangFilename; import org.onap.ccsdk.features.sdnr.wt.dataprovider.http.yangschema.YangSchemaHttpServlet; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - public class TestYangProvider { private static final String TESTPATH = "cache/schema/"; @@ -129,14 +127,7 @@ public class TestYangProvider { HttpServletResponse resp = mock(HttpServletResponse.class); when(req.getRequestURI()).thenReturn("/yang-schema/module1"); - StringWriter out = new StringWriter(); - ServletOutputStream printOut = new ServletOutputStream() { - - @Override - public void write(int arg0) throws IOException { - out.write(arg0); - } - }; + ServletOutputStreamToStringWriter printOut = new ServletOutputStreamToStringWriter(); when(resp.getOutputStream()).thenReturn(printOut); servlet.doGet(req, resp); verify(resp).setStatus(200); @@ -151,14 +142,7 @@ public class TestYangProvider { HttpServletResponse resp = mock(HttpServletResponse.class); when(req.getRequestURI()).thenReturn("/yang-schema/module1/2020-01-01"); - StringWriter out = new StringWriter(); - ServletOutputStream printOut = new ServletOutputStream() { - - @Override - public void write(int arg0) throws IOException { - out.write(arg0); - } - }; + ServletOutputStreamToStringWriter printOut = new ServletOutputStreamToStringWriter(); when(resp.getOutputStream()).thenReturn(printOut); servlet.doGet(req, resp); verify(resp).sendError(HttpServletResponse.SC_NOT_FOUND); @@ -172,14 +156,7 @@ public class TestYangProvider { HttpServletResponse resp = mock(HttpServletResponse.class); when(req.getRequestURI()).thenReturn("/yang-schema/module2/2010-03-01"); - StringWriter out = new StringWriter(); - ServletOutputStream printOut = new ServletOutputStream() { - - @Override - public void write(int arg0) throws IOException { - out.write(arg0); - } - }; + ServletOutputStreamToStringWriter printOut = new ServletOutputStreamToStringWriter(); when(resp.getOutputStream()).thenReturn(printOut); servlet.doGet(req, resp); verify(resp).setStatus(200); diff --git a/sdnr/wt/data-provider/provider/src/test/resources/simplelogger.properties b/sdnr/wt/data-provider/provider/src/test/resources/simplelogger.properties index 056e91eda..85525bf4b 100644 --- a/sdnr/wt/data-provider/provider/src/test/resources/simplelogger.properties +++ b/sdnr/wt/data-provider/provider/src/test/resources/simplelogger.properties @@ -18,11 +18,17 @@ # ============LICENSE_END======================================================= # # +# SLF4J's SimpleLogger configuration file +# Simple implementation of Logger that sends all enabled log messages, for all defined loggers, to System.err. -org.slf4j.simpleLogger.defaultLogLevel=DEBUG +# Default logging detail level for all instances of SimpleLogger. +# Must be one of ("trace", "debug", "info", "warn", or "error"). +# If not specified, defaults to "info". +org.slf4j.simpleLogger.defaultLogLevel=debug org.slf4j.simpleLogger.showDateTime=true -#org.slf4j.simpleLogger.dateTimeFormat=yyyy-MM-dd HH:mm:ss:SSS Z -#org.slf4j.simpleLogger.showThreadName=true + +org.slf4j.simpleLogger.dateTimeFormat=yyyy-MM-dd HH:mm:ss:SSS Z +org.slf4j.simpleLogger.showThreadName=true org.slf4j.simpleLogger.showLogName=true org.slf4j.simpleLogger.showShortLogName=false org.slf4j.simpleLogger.org.onap.ccsdk.features.sdnr.wt.dataprovider=DEBUG diff --git a/sdnr/wt/data-provider/setup/pom.xml b/sdnr/wt/data-provider/setup/pom.xml index 06ca3d338..26e3cd407 100644 --- a/sdnr/wt/data-provider/setup/pom.xml +++ b/sdnr/wt/data-provider/setup/pom.xml @@ -62,9 +62,13 @@ <artifactId>commons-cli</artifactId> </dependency> <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-log4j12</artifactId> - </dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + </dependency> <dependency> <groupId>${project.groupId}</groupId> <artifactId>sdnr-wt-common</artifactId> @@ -81,7 +85,6 @@ <plugin> <groupId>com.github.alexcojocaru</groupId> <artifactId>elasticsearch-maven-plugin</artifactId> - <version>6.16</version> <configuration> <skip>${skipTests}</skip> <clusterName>testCluster</clusterName> |