summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rwxr-xr-xcore/dblib/provider/src/main/resources/OSGI-INF/blueprint/dblib-blueprint.xml18
-rw-r--r--core/features/ccsdk-dblib/pom.xml1
-rw-r--r--core/features/ccsdk-sli/pom.xml2
-rw-r--r--core/sli/provider-base/pom.xml3
-rwxr-xr-xcore/sli/provider/pom.xml21
-rwxr-xr-xcore/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelper.java89
-rw-r--r--core/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/PrintYangToProp.java1355
-rw-r--r--core/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicClassResolver.java21
-rw-r--r--core/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicService.java9
-rwxr-xr-xcore/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicServiceImpl.java2
-rw-r--r--core/sli/provider/src/main/resources/OSGI-INF/blueprint/sli-blueprint.xml36
-rwxr-xr-xcore/sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelperTest.java3
-rw-r--r--core/sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelperTesterUtil.java7
-rw-r--r--core/sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/PrintYangToPropTest.java64
-rw-r--r--core/sliPluginUtils/provider/src/main/resources/OSGI-INF/blueprint/slipluginutils-blueprint.xml13
-rw-r--r--core/sliapi/model/swagger/src/main/json/sliapi.json2
-rw-r--r--core/sliapi/model/swagger/src/main/yaml/sliapi.yaml18
-rwxr-xr-xcore/sliapi/provider/pom.xml70
-rw-r--r--core/sliapi/provider/src/main/java/org/onap/ccsdk/sli/core/sliapi/SliapiProvider.java148
-rw-r--r--core/sliapi/provider/src/main/resources/OSGI-INF/blueprint/sliapi-blueprint.xml28
-rw-r--r--core/sliapi/provider/src/main/resources/org/opendaylight/blueprint/sliapi-blueprint.xml9
-rw-r--r--core/sliapi/provider/src/test/java/org/onap/ccsdk/sli/core/sliapi/TestSliapiProvider.java45
22 files changed, 292 insertions, 1672 deletions
diff --git a/core/dblib/provider/src/main/resources/OSGI-INF/blueprint/dblib-blueprint.xml b/core/dblib/provider/src/main/resources/OSGI-INF/blueprint/dblib-blueprint.xml
deleted file mode 100755
index f1d5166db..000000000
--- a/core/dblib/provider/src/main/resources/OSGI-INF/blueprint/dblib-blueprint.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
- xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
- odl:use-default-for-reference-types="true">
-
- <bean id="provider" class="org.onap.ccsdk.sli.core.dblib.DBLIBResourceProvider" />
-
- <bean id="dbResourceManager" class="org.onap.ccsdk.sli.core.dblib.DBResourceManager">
- <argument ref="provider" />
- </bean>
- <service ref="dbResourceManager">
- <interfaces>
- <value>javax.sql.DataSource</value>
- <value>org.onap.ccsdk.sli.core.dblib.DbLibService</value>
- </interfaces>
- </service>
-
-</blueprint> \ No newline at end of file
diff --git a/core/features/ccsdk-dblib/pom.xml b/core/features/ccsdk-dblib/pom.xml
index f1164017a..96fe28bc0 100644
--- a/core/features/ccsdk-dblib/pom.xml
+++ b/core/features/ccsdk-dblib/pom.xml
@@ -31,6 +31,7 @@
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jdbc</artifactId>
+ <version>9.0.30</version>
</dependency>
<dependency>
<groupId>org.onap.ccsdk.sli.core</groupId>
diff --git a/core/features/ccsdk-sli/pom.xml b/core/features/ccsdk-sli/pom.xml
index c6fcfc808..c6e913c37 100644
--- a/core/features/ccsdk-sli/pom.xml
+++ b/core/features/ccsdk-sli/pom.xml
@@ -22,7 +22,7 @@
<artifactId>sli-common</artifactId>
<version>${project.version}</version>
</dependency>
-
+
<dependency>
<groupId>org.onap.ccsdk.sli.core</groupId>
<artifactId>sli-provider</artifactId>
diff --git a/core/sli/provider-base/pom.xml b/core/sli/provider-base/pom.xml
index fac9a7796..fce5db9dc 100644
--- a/core/sli/provider-base/pom.xml
+++ b/core/sli/provider-base/pom.xml
@@ -12,7 +12,8 @@
<groupId>org.onap.ccsdk.sli.core</groupId>
<artifactId>sli-provider-base</artifactId>
<version>1.2.0-SNAPSHOT</version>
-
+ <packaging>bundle</packaging>
+
<name>ccsdk-sli-core :: sli :: ${project.artifactId}</name>
<properties>
diff --git a/core/sli/provider/pom.xml b/core/sli/provider/pom.xml
index 1fde267e8..d45b2e0f4 100755
--- a/core/sli/provider/pom.xml
+++ b/core/sli/provider/pom.xml
@@ -58,15 +58,14 @@
<artifactId>commons-lang</artifactId>
<scope>compile</scope>
</dependency>
-
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-binding-api</artifactId>
+ <groupId> org.opendaylight.mdsal</groupId>
+ <artifactId>mdsal-binding-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
@@ -81,11 +80,19 @@
<optional>true</optional>
</dependency>
<dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-core-api</artifactId>
- <scope>provided</scope>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>mdsal-dom-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>yang-binding</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.findbugs</groupId>
+ <artifactId>annotations</artifactId>
</dependency>
- <!-- Testing Dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
diff --git a/core/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelper.java b/core/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelper.java
index d3ab6c33a..94e1425cb 100755
--- a/core/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelper.java
+++ b/core/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelper.java
@@ -32,8 +32,11 @@ import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.Enumeration;
import java.util.LinkedList;
import java.util.List;
+import java.util.Map;
import java.util.Properties;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Dscp;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
@@ -43,9 +46,15 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.RouteDistinguisher;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.RouteDistinguisherBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.RouteDistinguisher;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.RouteDistinguisherBuilder;
import org.opendaylight.yangtools.yang.binding.Identifier;
+import org.opendaylight.yangtools.yang.binding.ScalarTypeObject;
+import org.opendaylight.yangtools.yang.binding.TypeObject;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint64;
+import org.opendaylight.yangtools.yang.common.Uint8;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -56,11 +65,11 @@ public class MdsalHelper {
private static final String IP_ADDRESS="IpAddress";
private static final String IPV4_ADDRESS="Ipv4Address";
private static final String IPV6_ADDRESS="Ipv6Address";
-
+
private static final String IP_PREFIX="IpPrefix";
private static final String SETTING_PROPERTY="Setting property ";
private static final String BUILDER="-builder";
-
+
@Deprecated
public static void setProperties(Properties input) {
setYangMappingProperties(input);
@@ -130,7 +139,7 @@ public class MdsalHelper {
}
String simpleTypeName = fromObj.getClass().getTypeName();
simpleTypeName = simpleTypeName.substring(simpleTypeName.lastIndexOf(".") + 1);
-
+
if (classHasSpecialHandling(simpleTypeName)) {
try {
@@ -145,10 +154,14 @@ public class MdsalHelper {
if (IP_ADDRESS.equals(simpleTypeName) || IP_PREFIX.equals(simpleTypeName)
|| IPV4_ADDRESS.equals(simpleTypeName) || IPV6_ADDRESS.equals(simpleTypeName)) {
propVal = (String) retValue;
- } else if ("Dscp".equals(simpleTypeName)) {
+ }
+ else if(implementsInterface( fromObj.getClass(), ScalarTypeObject.class)) {
+ propVal = String.valueOf(((ScalarTypeObject)fromObj).getValue());
+ }
+ else if ("Dscp".equals(simpleTypeName)) {
propVal = String.valueOf((short) retValue);
} else if ("PortNumber".equals(simpleTypeName)) {
- propVal = String.valueOf((Integer) retValue);
+ propVal = String.valueOf(retValue);
}
LOG.debug(SETTING_PROPERTY + pfx + " to " + propVal);
props.setProperty(pfx, propVal);
@@ -165,7 +178,7 @@ public class MdsalHelper {
}
props.setProperty(pfx + "_length", Integer.toString(fromList.size()));
- } else if (isYangGenerated(fromClass)) {
+ } else if (isYangGenerated(fromClass)) {
// Class is yang generated.
String propNamePfx = null;
@@ -278,7 +291,7 @@ public class MdsalHelper {
}
} else if (returnType.equals(Class.class)) {
- } else if (List.class.isAssignableFrom(returnType)) {
+ } else if (List.class.isAssignableFrom(returnType) || Map.class.isAssignableFrom(returnType)) {
// This getter method returns a list.
try {
@@ -286,15 +299,19 @@ public class MdsalHelper {
if (!isAccessible) {
m.setAccessible(true);
}
- Object retList = m.invoke(fromObj);
- if (!isAccessible) {
- m.setAccessible(isAccessible);
+ Object retList = Map.class.isAssignableFrom(returnType)?new ArrayList(((Map) m.invoke(fromObj)).values()):m.invoke(fromObj);
+ //due duplicated getters with Map and List(deprecated) stop if already mapped
+ if(!hasAlreadyKeys(props,propNamePfx + "." + fieldName)) {
+
+ if (!isAccessible) {
+ m.setAccessible(isAccessible);
+ }
+ // Figure out what type of elements are stored in
+ // this array.
+ Type paramType = m.getGenericReturnType();
+ Type elementType = ((ParameterizedType) paramType).getActualTypeArguments()[Map.class.isAssignableFrom(returnType)?1:0];
+ toProperties(props, propNamePfx + "." + fieldName, retList, (Class) elementType, useLegacyEnumerationMapping);
}
- // Figure out what type of elements are stored in
- // this array.
- Type paramType = m.getGenericReturnType();
- Type elementType = ((ParameterizedType) paramType).getActualTypeArguments()[0];
- toProperties(props, propNamePfx + "." + fieldName, retList, (Class) elementType, useLegacyEnumerationMapping);
} catch (Exception e) {
LOG.error("Caught exception trying to convert List returned by " + fromClass.getName() + "."
+ m.getName() + "() to Properties entry", e);
@@ -343,7 +360,7 @@ public class MdsalHelper {
// End of method loop. If there was only one getter, named
// "getValue", then
// set value identified by "prefix" to that one value.
- if ((numGetters == 1) && ("getValue".equals(lastGetterName))) {
+ if ((numGetters == 1) && ("getValue".equals(lastGetterName)) || isYangScalarType(fromObj)) {// || isYangTypeObject(fromObj)) {
props.setProperty(propNamePfx, propVal);
}
} else {
@@ -368,6 +385,26 @@ public class MdsalHelper {
return (props);
}
+ private static boolean hasAlreadyKeys(Properties props, String key) {
+ Enumeration<Object> keys = props.keys();
+ while(keys.hasMoreElements()) {
+ if(String.valueOf(keys.nextElement()).startsWith(key)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private static boolean implementsInterface(Class<?> clazz, Class<?> ifClass) {
+// Class<?>[] ifs = clazz.getInterfaces();
+// for (Class<?> iff : ifs) {
+// if (iff.equals(ifClass)) {
+// return true;
+// }
+// }
+ return ifClass.isAssignableFrom(clazz);
+ }
+
public static Object toBuilder(Properties props, Object toObj) {
return (toBuilder(props, "", toObj));
@@ -609,7 +646,7 @@ public class MdsalHelper {
if (IPV4_ADDRESS.equals(simpleName) || IPV6_ADDRESS.equals(simpleName)
|| IP_ADDRESS.equals(simpleName)) {
-
+
if ((paramValue != null) && (paramValue.length() > 0)) {
try {
@@ -964,7 +1001,7 @@ public class MdsalHelper {
}
return false;
}
-
+
private static String getStringValueMethod(String simpleName){
if (IP_ADDRESS.equals(simpleName) || IP_PREFIX.equals(simpleName)) {
return("stringValue");
@@ -1067,6 +1104,18 @@ public class MdsalHelper {
return false;
}
+ private static boolean isYangScalarType(Object o) {
+ if (!implementsInterface(o.getClass(), ScalarTypeObject.class)) {
+ return false;
+ }
+ Object value = ((ScalarTypeObject) o).getValue();
+ Class valueCls = value.getClass();
+ return valueCls.isAssignableFrom(Uint64.class) || valueCls.isAssignableFrom(Uint32.class)
+ || valueCls.isAssignableFrom(Uint16.class) || valueCls.isAssignableFrom(Uint8.class)|| valueCls.isAssignableFrom(String.class);
+ }
+ private static boolean isYangTypeObject(Object o) {
+ return implementsInterface(o.getClass(),TypeObject.class);
+ }
public static boolean isIpPrefix(Class c) {
if (c == null) {
diff --git a/core/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/PrintYangToProp.java b/core/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/PrintYangToProp.java
deleted file mode 100644
index 992ed64d4..000000000
--- a/core/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/PrintYangToProp.java
+++ /dev/null
@@ -1,1355 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP : CCSDK
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- * reserved.
- * ================================================================================
- * Modifications Copyright (C) 2018 IBM.
- * ================================================================================
- * 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.sli.core.sli.provider;
-
-import java.io.PrintStream;
-import java.io.FileDescriptor;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Properties;
-import java.util.Arrays;
-import java.util.ArrayList;
-import java.io.*;
-import org.opendaylight.yangtools.yang.binding.Identifier;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressBuilder;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefixBuilder;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import com.google.common.base.Strings;
-
-
-public class PrintYangToProp {
-
- private static final Logger LOG = LoggerFactory.getLogger(PrintYangToProp.class);
- public static final String PROPERTIES_FILE="";
- private static Properties properties;
- private static final String BUILDER="-builder";
- private static final String IMPL="-impl";
- private static final String TO_PROPERTIES_STRING="() to Properties entry";
- private static final String CAUGHT_EXCEPTION_MSG="Caught exception trying to convert value returned by ";
- public static Properties prop = new Properties();
- public static ArrayList<String> propList = new ArrayList<>();
-
-
- public static Properties toProperties(Properties props, Object fromObj) {
- Class fromClass = null;
-
- if (fromObj != null)
- {
- fromClass = fromObj.getClass();
- }
- return (toProperties(props, "", fromObj, fromClass));
- }
-
- public static Properties toProperties(Properties props, String pfx, Object fromObj)
- {
- Class fromClass = null;
-
- if (fromObj != null)
- {
- fromClass = fromObj.getClass();
- }
-
- return(toProperties(props, pfx, fromObj, fromClass));
- }
-
- public static Properties toProperties(Properties props, String pfx,
- Object fromObj, Class fromClass) {
-
- if (fromObj == null) {
- return (props);
- }
-
-
- String simpleName = fromClass.getSimpleName();
-
- if (fromObj instanceof List) {
-
-
- List fromList = (List) fromObj;
-
- for (int i = 0; i < fromList.size(); i++) {
- toProperties(props, pfx + "[" + i + "]", fromList.get(i), fromClass);
- }
- props.setProperty(pfx + "_length", "" + fromList.size());
-
- } else if (isYangGenerated(fromClass)) {
-
- String propNamePfx = null;
-
- // If called from a list (so prefix ends in ']'), don't
- // add class name again
- if (pfx.endsWith("]")) {
- propNamePfx = pfx;
- } else {
- if ((pfx != null) && (pfx.length() > 0)) {
- propNamePfx = pfx ;
- } else {
- propNamePfx = toLowerHyphen(fromClass.getSimpleName());
- }
-
- if (propNamePfx.endsWith(BUILDER)) {
- propNamePfx = propNamePfx.substring(0, propNamePfx.length()
- - BUILDER.length());
- }
-
- if (propNamePfx.endsWith(IMPL)) {
- propNamePfx = propNamePfx.substring(0, propNamePfx.length()
- - IMPL.length());
- }
- }
-
- // Iterate through getter methods to figure out values we need to
- // save from
-
- for (Method m : fromClass.getMethods()) {
-
- if (isGetter(m)) {
-
- Class returnType = m.getReturnType();
- String fieldName = toLowerHyphen(m.getName().substring(3));
- if(m != null && m.getName().matches("^is[A-Z].*")){
- fieldName = toLowerHyphen(m.getName().substring(2));
- }
-
- if(Strings.isNullOrEmpty(fieldName)) fieldName = fieldName.substring(0, 1).toLowerCase()+ fieldName.substring(1);
-
-
- // Is the return type a yang generated class?
- if (isYangGenerated(returnType)) {
-
- // Is it an enum?
- if (returnType.isEnum()) {
- // Return type is a typedef. Save its value.
- try {
- boolean isAccessible = m.isAccessible();
- if (!isAccessible) {
- m.setAccessible(true);
- }
-
- Object retValue = m.invoke(fromObj);
-
- if (!isAccessible) {
- m.setAccessible(isAccessible);
- }
- if (retValue != null) {
- String propName = propNamePfx + "."
- + fieldName;
- String propVal = retValue.toString();
- String yangProp = "yang." + fieldName + "." + propVal;
- if ( properties.containsKey(yangProp)) {
- propVal = properties.getProperty(yangProp);
- }
- props.setProperty(propName, propVal);
- }
- } catch (Exception e) {
- LOG.error(
- "Caught exception trying to convert Yang-generated enum returned by "
- + fromClass.getName() + "."
- + m.getName()
- + TO_PROPERTIES_STRING, e);
- }
- } else if (isIpv4Address(returnType)) {
- // Save its value
- try {
- String propName = propNamePfx + "." + fieldName;
- boolean isAccessible = m.isAccessible();
- if (!isAccessible) {
- m.setAccessible(true);
- }
- Ipv4Address retValue = (Ipv4Address) m.invoke(fromObj);
- if (!isAccessible) {
- m.setAccessible(isAccessible);
- }
-
- if (retValue != null) {
- String propVal = retValue.getValue();
-
- props.setProperty(propName, propVal);
-
- }
- } catch (Exception e) {
- LOG.error(
- CAUGHT_EXCEPTION_MSG
- + fromClass.getName() + "."
- + m.getName()
- + TO_PROPERTIES_STRING, e);
- }
- } else if (isIpv6Address(returnType)) {
- // Save its value
- try {
- String propName = propNamePfx + "." + fieldName;
- boolean isAccessible = m.isAccessible();
- if (!isAccessible) {
- m.setAccessible(true);
- }
- Ipv6Address retValue = (Ipv6Address) m.invoke(fromObj);
- if (!isAccessible) {
- m.setAccessible(isAccessible);
- }
-
- if (retValue != null) {
- String propVal = retValue.getValue();
-
- props.setProperty(propName, propVal);
-
- }
- } catch (Exception e) {
- LOG.error(
- CAUGHT_EXCEPTION_MSG
- + fromClass.getName() + "."
- + m.getName()
- + TO_PROPERTIES_STRING, e);
- }
- } else if (isIpv4Prefix(returnType)) {
-
- // Save its value
- try {
- String propName = propNamePfx + "." + fieldName;
- boolean isAccessible = m.isAccessible();
- if (!isAccessible) {
- m.setAccessible(true);
- }
- Ipv4Prefix retValue = (Ipv4Prefix) m.invoke(fromObj);
- if (!isAccessible) {
- m.setAccessible(isAccessible);
- }
-
- if (retValue != null) {
- String propVal = retValue.getValue();
-
- props.setProperty(propName, propVal);
-
- }
- } catch (Exception e) {
- LOG.error(
- CAUGHT_EXCEPTION_MSG
- + fromClass.getName() + "."
- + m.getName()
- + TO_PROPERTIES_STRING, e);
- }
- } else if (isIpv6Prefix(returnType)) {
- //System.out.println("isIpv6Prefix");
- // Save its value
- try {
- String propName = propNamePfx + "." + fieldName;
- boolean isAccessible = m.isAccessible();
- if (!isAccessible) {
- m.setAccessible(true);
- }
- Ipv6Prefix retValue = (Ipv6Prefix) m.invoke(fromObj);
- if (!isAccessible) {
- m.setAccessible(isAccessible);
- }
-
- if (retValue != null) {
- String propVal = retValue.getValue().toString();
- //LOG.debug("Setting property " + propName
- // + " to " + propVal);
- props.setProperty(propName, propVal);
-
- }
- } catch (Exception e) {
- LOG.error(
- CAUGHT_EXCEPTION_MSG
- + fromClass.getName() + "."
- + m.getName()
- + TO_PROPERTIES_STRING, e);
- }
- } else {
- try {
- boolean isAccessible = m.isAccessible();
- if (!isAccessible) {
- m.setAccessible(true);
- }
- Object retValue = m.invoke(fromObj);
- if (!isAccessible) {
- m.setAccessible(isAccessible);
- }
- if (retValue != null) {
- toProperties(props, propNamePfx + "." + fieldName, retValue, returnType);
- }
- } catch (Exception e) {
- LOG.error(
- "Caught exception trying to convert Yang-generated class returned by"
- + fromClass.getName() + "."
- + m.getName()
- + TO_PROPERTIES_STRING, e);
- }
- }
- } else if (returnType.equals(Class.class)) {
-
- //LOG.debug(m.getName()
- // + " returns a Class object - not interested");
-
- } else if (List.class.isAssignableFrom(returnType)) {
-
- // This getter method returns a list.
- try {
- boolean isAccessible = m.isAccessible();
- if (!isAccessible) {
- m.setAccessible(true);
- }
- Object retList = m.invoke(fromObj);
- if (!isAccessible) {
- m.setAccessible(isAccessible);
- }
- // Figure out what type of elements are stored in this array.
- Type paramType = m.getGenericReturnType();
- Type elementType = ((ParameterizedType) paramType)
- .getActualTypeArguments()[0];
- toProperties(props, propNamePfx + "." + fieldName,
- retList, (Class)elementType);
- } catch (Exception e) {
- LOG.error(
- "Caught exception trying to convert List returned by "
- + fromClass.getName() + "."
- + m.getName()
- + TO_PROPERTIES_STRING, e);
- }
-
- } else {
-
- // Method returns something that is not a List and not
- // yang-generated.
- // Save its value
- try {
- String propName = propNamePfx + "." + fieldName;
- boolean isAccessible = m.isAccessible();
- if (!isAccessible) {
- m.setAccessible(true);
- }
- Object propValObj = m.invoke(fromObj);
- if (!isAccessible) {
- m.setAccessible(isAccessible);
- }
-
- if (propValObj != null) {
- String propVal = propValObj.toString();
- //LOG.debug("Setting property " + propName
- // + " to " + propVal);
- props.setProperty(propName, propVal);
-
- }
- } catch (Exception e) {
- LOG.error(
- CAUGHT_EXCEPTION_MSG
- + fromClass.getName() + "."
- + m.getName()
- + TO_PROPERTIES_STRING, e);
- }
- }
-
- }
- }
-
- } else {
- // Class is not yang generated and not a list
- // Do nothing.
-
- }
-
- return (props);
- }
-
- public static Object toBuilder(Properties props, Object toObj) {
-
- return (toBuilder(props, "", toObj));
- }
-
- public static List toList(Properties props, String pfx, List toObj,
- Class elemType) {
-
- int maxIdx = -1;
- boolean foundValue = false;
-
- //LOG.debug("Saving properties to List<" + elemType.getName()
- // + "> from " + pfx);
-
- // Figure out array size
- for (Object pNameObj : props.keySet()) {
- String key = (String) pNameObj;
-
- if (key.startsWith(pfx + "[")) {
- String idxStr = key.substring(pfx.length() + 1);
- int endloc = idxStr.indexOf("]");
- if (endloc != -1) {
- idxStr = idxStr.substring(0, endloc);
- }
-
- try {
- int curIdx = Integer.parseInt(idxStr);
- if (curIdx > maxIdx) {
- maxIdx = curIdx;
- }
- } catch (Exception e) {
- LOG.error("Illegal subscript in property " + key);
- }
-
- }
- }
-
- //LOG.debug(pfx + " has max index of " + maxIdx);
- for (int i = 0; i <= maxIdx; i++) {
-
- String curBase = pfx + "[" + i + "]";
-
- if (isYangGenerated(elemType)) {
- String builderName = elemType.getName() + "Builder";
- try {
- Class builderClass = Class.forName(builderName);
- Object builderObj = builderClass.newInstance();
- Method buildMethod = builderClass.getMethod("build");
- builderObj = toBuilder(props, curBase, builderObj, true);
- if (builderObj != null) {
- //LOG.debug("Calling " + builderObj.getClass().getName()
- // + "." + buildMethod.getName() + "()");
- Object builtObj = buildMethod.invoke(builderObj);
- toObj.add(builtObj);
- foundValue = true;
- }
-
- } catch (ClassNotFoundException e) {
- LOG.warn("Could not find builder class " + builderName, e);
- } catch (Exception e) {
- LOG.error("Caught exception trying to populate list from "
- + pfx);
- }
- }
-
- }
-
- if (foundValue) {
- return (toObj);
- } else {
- return (null);
- }
-
- }
-
- public static Object toBuilder(Properties props, String pfx, Object toObj) {
- return(toBuilder(props, pfx, toObj, false));
- }
-
- public static Object toBuilder(Properties props, String pfx, Object toObj, boolean preservePfx) {
- Class toClass = toObj.getClass();
- boolean foundValue = false;
-
- //LOG.debug("Saving properties to " + toClass.getName() + " class from "
- // + pfx);
-
- Ipv4Address addr;
-
- if (isYangGenerated(toClass)) {
- // Class is yang generated.
- //LOG.debug(toClass.getName() + " is a Yang-generated class");
-
- String propNamePfx = null;
- if (preservePfx) {
- propNamePfx = pfx;
- } else {
-
- if ((pfx != null) && (pfx.length() > 0)) {
- propNamePfx = pfx + "."
- + toLowerHyphen(toClass.getSimpleName());
- } else {
- propNamePfx = toLowerHyphen(toClass.getSimpleName());
- }
-
- if (propNamePfx.endsWith(BUILDER)) {
- propNamePfx = propNamePfx.substring(0, propNamePfx.length()
- - BUILDER.length());
- }
-
- if (propNamePfx.endsWith(IMPL)) {
- propNamePfx = propNamePfx.substring(0, propNamePfx.length()
- - IMPL.length());
- }
- }
-
- if (toObj instanceof Identifier) {
- //LOG.debug(toClass.getName() + " is a Key - skipping");
- return (toObj);
- }
-
- // Iterate through getter methods to figure out values we need to
- // set
-
- for (Method m : toClass.getMethods()) {
- // LOG.debug("Is " + m.getName() + " method a setter?");
- if (isSetter(m)) {
- // LOG.debug(m.getName() + " is a setter");
- Class paramTypes[] = m.getParameterTypes();
- Class paramClass = paramTypes[0];
-
- String fieldName = toLowerHyphen(m.getName().substring(3));
- fieldName = fieldName.substring(0, 1).toLowerCase()
- + fieldName.substring(1);
-
- String propName = propNamePfx + "." + fieldName;
-
- String paramValue = props.getProperty(propName);
- if (paramValue == null) {
- //LOG.debug(propName + " is unset");
- } else {
- //LOG.debug(propName + " = " + paramValue);
- }
-
- // Is the return type a yang generated class?
- if (isYangGenerated(paramClass)) {
- // Is it an enum?
- if (paramClass.isEnum()) {
-
- //LOG.debug(m.getName() + " expects an Enum");
- // Param type is a typedef.
- if (paramValue != null) {
- Object paramObj = null;
-
- try {
- paramObj = Enum.valueOf(paramClass,
- toUpperCamelCase(paramValue));
- } catch (Exception e) {
- LOG.error(
- "Caught exception trying to convert field "
- + propName + " to enum "
- + paramClass.getName(), e);
- }
-
- try {
- boolean isAccessible = m.isAccessible();
- if (!isAccessible) {
- m.setAccessible(true);
- }
-
- //LOG.debug("Calling "
- // + toObj.getClass().getName() + "."
- // + m.getName() + "(" + paramValue
- // + ")");
- m.invoke(toObj, paramObj);
-
- if (!isAccessible) {
- m.setAccessible(isAccessible);
- }
- foundValue = true;
-
- } catch (Exception e) {
- LOG.error(
- "Caught exception trying to create Yang-generated enum expected by"
- + toClass.getName()
- + "."
- + m.getName()
- + "() from Properties entry",
- e);
- }
- }
- } else {
-
- String simpleName = paramClass.getSimpleName();
- LOG.info("simpleName:" + simpleName);
-
- if ("Ipv4Address".equals(simpleName)
- || "Ipv6Address".equals(simpleName) || "Ipv4Prefix".equals(simpleName) || "Ipv6Prefix".equals(simpleName)) {
-
- if (paramValue != null) {
- if("Ipv4Address".equals(simpleName) || "Ipv6Address".equals(simpleName)){
- try {
- IpAddress ipAddr = IpAddressBuilder
- .getDefaultInstance(paramValue);
-
-
- if ("Ipv4Address".equals(simpleName))
- {
- m.invoke(toObj, ipAddr.getIpv4Address());
- }
- else
- {
- m.invoke(toObj, ipAddr.getIpv6Address());
-
- }
- foundValue = true;
- } catch (Exception e) {
- LOG.error(
- "Caught exception calling "
- + toClass.getName() + "."
- + m.getName() + "("
- + paramValue + ")", e);
-
- }
- }else if("Ipv4Prefix".equals(simpleName)|| "Ipv6Prefix".equals(simpleName)){
- try {
- IpPrefix ipPrefix = IpPrefixBuilder
- .getDefaultInstance(paramValue);
-
-
- if ("Ipv4Prefix".equals(simpleName))
- {
- m.invoke(toObj, ipPrefix.getIpv4Prefix());
- }
- else
- {
- m.invoke(toObj, ipPrefix.getIpv6Prefix());
-
- }
- foundValue = true;
- } catch (Exception e) {
- LOG.error(
- "Caught exception calling "
- + toClass.getName() + "."
- + m.getName() + "("
- + paramValue + ")", e);
-
- }
- }
- }
-
- } else {
- // setter expects a yang-generated class. Need
- // to
- // create a builder to set it.
-
- String builderName = paramClass.getName()
- + "Builder";
- Class builderClass = null;
- Object builderObj = null;
- Object paramObj = null;
-
- //LOG.debug(m.getName()
- // + " expects a yang-generated class - looking for builder "
- // + builderName);
- try {
- builderClass = Class.forName(builderName);
- builderObj = builderClass.newInstance();
- paramObj = toBuilder(props, propNamePfx,
- builderObj);
- } catch (ClassNotFoundException e) {
- Object constObj = null;
- try {
- // See if I can find a constructor I can
- // use
- Constructor[] constructors = paramClass
- .getConstructors();
- // Is there a String constructor?
- for (Constructor c : constructors) {
- Class[] cParms = c
- .getParameterTypes();
- if ((cParms != null)
- && (cParms.length == 1)) {
- if (String.class
- .isAssignableFrom(cParms[0])) {
- constObj = c
- .newInstance(paramValue);
- }
- }
- }
-
- if (constObj == null) {
- // Is there a Long constructor?
- for (Constructor c : constructors) {
- Class[] cParms = c
- .getParameterTypes();
- if ((cParms != null)
- && (cParms.length == 1)) {
- if (Long.class
- .isAssignableFrom(cParms[0])) {
- constObj = c
- .newInstance(Long
- .parseLong(paramValue));
- }
- }
- }
-
- }
-
- if (constObj != null) {
- try {
- m.invoke(toObj, constObj);
- foundValue = true;
- } catch (Exception e2) {
- LOG.error(
- "Caught exception trying to call "
- + m.getName(),
- e2);
- }
- }
- } catch (Exception e1) {
- LOG.warn(
- "Could not find a suitable constructor for "
- + paramClass.getName(),
- e1);
- }
-
- if (paramObj == null) {
- LOG.warn("Could not find builder class "
- + builderName
- + " and could not find a String or Long constructor - trying just to set passing paramValue");
-
- }
-
- } catch (Exception e) {
- LOG.error(
- "Caught exception trying to create builder "
- + builderName, e);
- }
-
- if (paramObj != null) {
-
- try {
-
- Method buildMethod = builderClass
- .getMethod("build");
- //LOG.debug("Calling "
- // + paramObj.getClass().getName()
- // + "." + buildMethod.getName()
- // + "()");
- Object builtObj = buildMethod
- .invoke(paramObj);
-
- boolean isAccessible = m.isAccessible();
- if (!isAccessible) {
- m.setAccessible(true);
- }
-
- //LOG.debug("Calling "
- // + toObj.getClass().getName()
- // + "." + m.getName() + "()");
- m.invoke(toObj, builtObj);
- if (!isAccessible) {
- m.setAccessible(isAccessible);
- }
- foundValue = true;
-
- } catch (Exception e) {
- LOG.error(
- "Caught exception trying to set Yang-generated class expected by"
- + toClass.getName()
- + "."
- + m.getName()
- + "() from Properties entry",
- e);
- }
- } else {
- try {
- boolean isAccessible = m.isAccessible();
- if (!isAccessible) {
- m.setAccessible(true);
- }
- //LOG.debug("Calling "
- // + toObj.getClass().getName()
- // + "." + m.getName() + "("
- // + paramValue + ")");
- m.invoke(toObj, paramValue);
- if (!isAccessible) {
- m.setAccessible(isAccessible);
- }
- foundValue = true;
-
- } catch (Exception e) {
- LOG.error(
- "Caught exception trying to convert value returned by"
- + toClass.getName()
- + "."
- + m.getName()
- + TO_PROPERTIES_STRING,
- e);
- }
- }
- }
- }
- }else {
-
- // Setter's argument is not a yang-generated class. See
- // if it is a List.
-
- if (List.class.isAssignableFrom(paramClass)) {
-
- //LOG.debug("Parameter class " + paramClass.getName()
- // + " is a List");
-
- // Figure out what type of args are in List and pass
- // that to toList().
-
- Type paramType = m.getGenericParameterTypes()[0];
- Type elementType = ((ParameterizedType) paramType)
- .getActualTypeArguments()[0];
- Object paramObj = new LinkedList();
- try {
- paramObj = toList(props, propName,
- (List) paramObj, (Class) elementType);
- } catch (Exception e) {
- LOG.error("Caught exception trying to create list expected as argument to "
- + toClass.getName() + "." + m.getName());
- }
-
- if (paramObj != null) {
- try {
- boolean isAccessible = m.isAccessible();
- if (!isAccessible) {
- m.setAccessible(true);
- }
- //LOG.debug("Calling "
- // + toObj.getClass().getName() + "."
- // + m.getName() + "(" + paramValue
- // + ")");
- m.invoke(toObj, paramObj);
- if (!isAccessible) {
- m.setAccessible(isAccessible);
- }
- foundValue = true;
-
- } catch (Exception e) {
- LOG.error(
- "Caught exception trying to convert List returned by"
- + toClass.getName() + "."
- + m.getName()
- + TO_PROPERTIES_STRING,
- e);
- }
- }
- } else {
-
- // Setter expects something that is not a List and
- // not yang-generated. Just pass the parameter value
-
- //LOG.debug("Parameter class "
- // + paramClass.getName()
- // + " is not a yang-generated class or a List");
-
- if (paramValue != null) {
-
- Object constObj = null;
-
- try {
- // See if I can find a constructor I can use
- Constructor[] constructors = paramClass
- .getConstructors();
- // Is there a String constructor?
- for (Constructor c : constructors) {
- Class[] cParms = c.getParameterTypes();
- if ((cParms != null)
- && (cParms.length == 1)) {
- if (String.class
- .isAssignableFrom(cParms[0])) {
- constObj = c
- .newInstance(paramValue);
- }
- }
- }
-
- if (constObj == null) {
- // Is there a Long constructor?
- for (Constructor c : constructors) {
- Class[] cParms = c
- .getParameterTypes();
- if ((cParms != null)
- && (cParms.length == 1)) {
- if (Long.class
- .isAssignableFrom(cParms[0])) {
- constObj = c
- .newInstance(Long
- .parseLong(paramValue));
- }
- }
- }
-
- }
-
- if (constObj != null) {
- try {
- //LOG.debug("Calling "
- // + toObj.getClass()
- // .getName() + "."
- // + m.getName() + "("
- // + constObj + ")");
- m.invoke(toObj, constObj);
- foundValue = true;
- } catch (Exception e2) {
- LOG.error(
- "Caught exception trying to call "
- + m.getName(), e2);
- }
- } else {
- try {
- boolean isAccessible = m
- .isAccessible();
- if (!isAccessible) {
- m.setAccessible(true);
- }
- //LOG.debug("Calling "
- // + toObj.getClass()
- // .getName() + "."
- // + m.getName() + "("
- // + paramValue + ")");
- m.invoke(toObj, paramValue);
- if (!isAccessible) {
- m.setAccessible(isAccessible);
- }
- foundValue = true;
-
- } catch (Exception e) {
- LOG.error(
- "Caught exception trying to convert value returned by"
- + toClass.getName()
- + "."
- + m.getName()
- + TO_PROPERTIES_STRING,
- e);
- }
- }
- } catch (Exception e1) {
- LOG.warn(
- "Could not find a suitable constructor for "
- + paramClass.getName(), e1);
- }
-
- /*
- * try { boolean isAccessible =
- * m.isAccessible(); if (!isAccessible) {
- * m.setAccessible(true); } LOG.debug("Calling "
- * + toObj.getClass().getName() + "." +
- * m.getName() + "(" + paramValue + ")");
- * m.invoke(toObj, paramValue); if
- * (!isAccessible) {
- * m.setAccessible(isAccessible); } foundValue =
- * true;
- *
- * } catch (Exception e) { LOG.error(
- * "Caught exception trying to convert value returned by"
- * + toClass.getName() + "." + m.getName() +
- * "() to Properties entry", e); }
- */
- }
- }
- }
- } // End of section handling "setter" method
- } // End of loop through Methods
- } // End of section handling yang-generated class
-
- if (foundValue) {
- return (toObj);
- } else {
- return (null);
- }
- }
-
- public static Properties getProperties(PrintStream pstr, String pfx,
- Class toClass) {
- boolean foundValue = false;
-
- //LOG.debug("Analyzing " + toClass.getName() + " class : pfx " + pfx);
-
- if (isYangGenerated(toClass)
- && (!Identifier.class.isAssignableFrom(toClass))) {
- // Class is yang generated.
- //LOG.debug(toClass.getName() + " is a Yang-generated class");
-
- if (toClass.getName().endsWith("Key")) {
- if (Identifier.class.isAssignableFrom(toClass)) {
- //LOG.debug(Identifier.class.getName()
- // + " is assignable from " + toClass.getName());
- } else {
-
- //LOG.debug(Identifier.class.getName()
- // + " is NOT assignable from " + toClass.getName());
- }
- }
-
- String propNamePfx = null;
- if (pfx.endsWith("]")) {
- propNamePfx = pfx;
- }else if(pfx.indexOf(".CLASS_FOUND") != -1){
- pfx = pfx.replace(".CLASS_FOUND","");
- propNamePfx = pfx + "."
- + toLowerHyphen(toClass.getSimpleName());
- } else {
-
- if ((pfx != null) && (pfx.length() > 0)) {
- propNamePfx = pfx + "."
- + toLowerHyphen(toClass.getSimpleName());
- } else {
- propNamePfx = toLowerHyphen(toClass.getSimpleName());
- }
-
- if (propNamePfx.endsWith(BUILDER)) {
- propNamePfx = propNamePfx.substring(0, propNamePfx.length()
- - BUILDER.length());
- }
-
- if (propNamePfx.endsWith(IMPL)) {
- propNamePfx = propNamePfx.substring(0, propNamePfx.length()
- - IMPL.length());
- }
- }
-
- // Iterate through getter methods to figure out values we need to
- // set
-
- for (Method m : toClass.getMethods()) {
- //LOG.debug("Is " + m.getName() + " method a getter?");
- if (isGetter(m)) {
- // LOG.debug(m.getName() + " is a getter");
- Class returnClass = m.getReturnType();
-
- String fieldName = toLowerHyphen(m.getName().substring(3));
- if(m != null && m.getName().matches("^is[A-Z].*")){
- fieldName = toLowerHyphen(m.getName().substring(2));
- }
- fieldName = fieldName.substring(0, 1).toLowerCase()
- + fieldName.substring(1);
-
- String propName = propNamePfx + "." + fieldName;
- //System.out.println("****" + propName);
-
- // Is the return type a yang generated class?
- if (isYangGenerated(returnClass)) {
- // Is it an enum?
- if (returnClass.isEnum()) {
-
- //LOG.debug(m.getName() + " is an Enum");
- //pstr.print("\n" + propName);
- //pstr.print("\n" + propName + ":Enum:" + Arrays.asList(returnClass.getEnumConstants()) + "\n");
- pstr.print("\"" + propName + ":Enum:" + Arrays.asList(returnClass.getEnumConstants()) + "\",");
- prop.setProperty(propName,"");
- propList.add(propName);
-
- } else {
-
- String simpleName = returnClass.getSimpleName();
- //System.out.println("simpleName:" + simpleName);
-
- if ("Ipv4Address".equals(simpleName) || "Ipv6Address".equals(simpleName) || "IpAddress".equals(simpleName) || "Ipv4Prefix".equals(simpleName) || "Ipv6Prefix".equals(simpleName) || "IpPrefix".equals(simpleName)) {
- //LOG.debug(m.getName()+" is an "+simpleName);
- //pstr.print("\n" + propName);
- //pstr.print("\n" + propName + ":" + simpleName + "\n");
- pstr.print("\"" + propName + ":" + simpleName + "\",");
- prop.setProperty(propName,"");
- propList.add(propName);
- } else {
- boolean isString = false;
- boolean isNumber = false;
- boolean isBoolean = false;
- boolean isIdentifier = false;
- //System.out.println("simpleName:" + simpleName);
- //System.out.println("propName:" + propName);
- for(Method mthd : returnClass.getMethods()){
- String methodName = mthd.getName();
- //System.out.println("methodName:" + methodName);
- if(methodName.equals("getValue")){
- Class retType = mthd.getReturnType();
- //System.out.println("retType:" + retType);
- isString = String.class.isAssignableFrom(retType);
- isNumber = Number.class.isAssignableFrom(retType);
- isBoolean = Boolean.class.isAssignableFrom(retType);
- isIdentifier = Identifier.class.isAssignableFrom(retType);
- //System.out.println("isString:" + isString);
- //System.out.println("isNumber:" + isNumber);
- //System.out.println("isNumber:" + isNumber);
- break;
- }
- }
-
- if(isString){
- pstr.print("\"" + propName + ":String\",");
- prop.setProperty(propName,"");
- propList.add(propName);
- }else if(isNumber){
- pstr.print("\"" + propName + ":Number\",");
- prop.setProperty(propName,"");
- propList.add(propName);
- }else if(isBoolean){
- pstr.print("\"" + propName + ":Boolean\",");
- prop.setProperty(propName,"");
- propList.add(propName);
- }else if(isIdentifier){
- //System.out.println("isIdentifier");
- //isIdentifer so skipping
- continue;
- }else{
- /*
- System.out.println("fieldName:" + fieldName);
- System.out.println("simpleName:" + simpleName);
- System.out.println("returnClass:" + returnClass);
- System.out.println("pstr:" + pstr);
- System.out.println("propNamePfx:" + propNamePfx);
- */
- getProperties(pstr, propNamePfx + ".CLASS_FOUND", returnClass);
- }
- }
-
- }
- } else {
-
- // Setter's argument is not a yang-generated class. See
- // if it is a List.
-
- if (List.class.isAssignableFrom(returnClass)) {
-
- //LOG.debug("Parameter class "
- // + returnClass.getName() + " is a List");
-
- // Figure out what type of args are in List and pass
- // that to toList().
-
- Type returnType = m.getGenericReturnType();
- Type elementType = ((ParameterizedType) returnType)
- .getActualTypeArguments()[0];
- Class elementClass = (Class) elementType;
- //LOG.debug("Calling printPropertyList on list type ("
- //+ elementClass.getName()
- // + "), pfx is ("
- // + pfx
- // + "), toClass is ("
- // + toClass.getName() + ")");
- //System.out.println("List propNamePfx:" + propNamePfx+ "." + toLowerHyphen(elementClass.getSimpleName()) + "[]");
- if(String.class.isAssignableFrom(elementClass)){
- pstr.print("\"" + propName + ":[String,String,...]\",");
- prop.setProperty(propName,"");
- propList.add(propName);
- }else if(Number.class.isAssignableFrom(elementClass)){
- pstr.print("\"" + propName + ":[Number,Number,...]\",");
- prop.setProperty(propName,"");
- propList.add(propName);
- }else if(Boolean.class.isAssignableFrom(elementClass)){
- pstr.print("\"" + propName + ":[Boolean,Boolean,...]\",");
- prop.setProperty(propName,"");
- propList.add(propName);
- }else if(Identifier.class.isAssignableFrom(elementClass)){
- continue;
- }else{
- getProperties(
- pstr,
- propNamePfx
- + "."
- + toLowerHyphen(elementClass
- .getSimpleName()) + "[]",
- elementClass);
- }
-
- } else if (!returnClass.equals(Class.class)) {
-
- // Setter expects something that is not a List and
- // not yang-generated. Just pass the parameter value
-
- //LOG.debug("Parameter class "
- // + returnClass.getName()
- // + " is not a yang-generated class or a List");
-
- //pstr.print("\n" + propName);
- String className=returnClass.getName();
- int nClassNameIndex = className.lastIndexOf('.');
- String nClassName = className;
- if(nClassNameIndex != -1){
- nClassName=className.substring(nClassNameIndex+1);
- }
- boolean isString = String.class.isAssignableFrom(returnClass);
- boolean isNumber = Number.class.isAssignableFrom(returnClass);
- boolean isBoolean = Boolean.class.isAssignableFrom(returnClass);
- //pstr.print("\n" + propName +":" + nClassName +"\n");
- boolean isIdentifier = Identifier.class.isAssignableFrom(returnClass);
- if(!isIdentifier && !nClassName.equals("[C")){
- if(isNumber){
- pstr.print("\"" + propName +":Number\",");
- }else if(isBoolean){
- pstr.print("\"" + propName +":Boolean\",");
- }else{
- if(nClassName.equals("[B")){
- pstr.print("\"" + propName +":Binary\",");
- }else{
- pstr.print("\"" + propName +":" + nClassName +"\",");
- }
- }
- prop.setProperty(propName,"");
- propList.add(propName);
- }
-
- }
- }
- } // End of section handling "setter" method
- } // End of loop through Methods
- } // End of section handling yang-generated class
-
- return prop;
- }
-
- public static boolean isYangGenerated(Class c) {
- if (c == null) {
- return (false);
- } else {
- //System.out.println(c.getName());
- return (c.getName().startsWith("org.opendaylight.yang.gen."));
- }
- }
-
- public static boolean isIpv4Address(Class c) {
-
- if (c == null ) {
- return (false);
- }
- String simpleName = c.getSimpleName();
- return ("Ipv4Address".equals(simpleName)) ;
- }
-
- public static boolean isIpv6Address(Class c) {
-
- if (c == null ) {
- return (false);
- }
- String simpleName = c.getSimpleName();
- return ("Ipv6Address".equals(simpleName)) ;
- }
- public static boolean isIpv4Prefix(Class c) {
-
- if (c == null ) {
- return (false);
- }
- String simpleName = c.getSimpleName();
- //System.out.println("simpleName:" + simpleName);
- return ("Ipv4Prefix".equals(simpleName)) ;
- }
-
- public static boolean isIpv6Prefix(Class c) {
-
- if (c == null ) {
- return (false);
- }
- String simpleName = c.getSimpleName();
- //System.out.println("simpleName:" + simpleName);
- return ("Ipv6Prefix".equals(simpleName)) ;
- }
-
- public static String toLowerHyphen(String inStr) {
- if (inStr == null) {
- return (null);
- }
-
- String str = inStr.substring(0, 1).toLowerCase();
- if (inStr.length() > 1) {
- str = str + inStr.substring(1);
- }
-
- String regex = "([a-z0-9A-Z])(?=[A-Z])";
- String replacement = "$1-";
-
- String retval = str.replaceAll(regex, replacement).toLowerCase();
-
- //LOG.debug("Converting " + inStr + " => " + str + " => " + retval);
- return (retval);
- }
-
- public static String toUpperCamelCase(String inStr) {
- if (inStr == null) {
- return (null);
- }
-
- String[] terms = inStr.split("-");
- StringBuffer sbuff = new StringBuffer();
- // Check if string begins with a digit
- if (Character.isDigit(inStr.charAt(0))) {
- sbuff.append('_');
- }
- for (String term : terms) {
- sbuff.append(term.substring(0, 1).toUpperCase());
- if (term.length() > 1) {
- sbuff.append(term.substring(1));
- }
- }
- return (sbuff.toString());
-
- }
-
- public static boolean isGetter(Method m) {
- //System.out.println(m);
- if (m == null) {
- return (false);
- }
-
- if (Modifier.isPublic(m.getModifiers())
- && (m.getParameterTypes().length == 0)) {
- if ((m.getName().matches("^is[A-Z].*") || m.getName().matches("^get[A-Z].*"))
- && m.getReturnType().equals(Boolean.class)) {
- return (true);
- }
- if (m.getName().matches("^get[A-Z].*")
- && !m.getReturnType().equals(void.class)) {
- return (true);
- }
-
- }
-
- return (false);
- }
-
- public static boolean isSetter(Method m) {
- if (m == null) {
- return (false);
- }
-
- if (Modifier.isPublic(m.getModifiers())
- && (m.getParameterTypes().length == 1)) {
- if (m.getName().matches("^set[A-Z].*")) {
- Class[] paramTypes = m.getParameterTypes();
- if (paramTypes[0].isAssignableFrom(Identifier.class)
- || Identifier.class.isAssignableFrom(paramTypes[0])) {
- return (false);
- } else {
- return (true);
- }
- }
-
- }
-
- return (false);
- }
-
- public static void main(String[] args){
-
- try(PrintStream ps = new PrintStream(new FileOutputStream(FileDescriptor.out))){
- PrintYangToProp printYangToProp = new PrintYangToProp();
- String className = args[0];
- //ClassLoader classLoader = PrintYangToProp.class.getClassLoader();
- //Class aClass = classLoader.loadClass(className);
- Class cl = Class.forName(className);
- //printPropertyList(ps,"",cl);
- //JsonObject jsonObj = Json.createObjectBuilder().build();
- Properties p = getProperties(ps,"",cl);
- //System.out.println(p);
-
- }catch(Exception e){
- e.printStackTrace();
- }
- }
-
-
-}
diff --git a/core/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicClassResolver.java b/core/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicClassResolver.java
index 08e957f1d..82670375f 100644
--- a/core/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicClassResolver.java
+++ b/core/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicClassResolver.java
@@ -1,3 +1,24 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * onap
+ * ================================================================================
+ * Copyright (C) 2016 - 2017 ONAP
+ * Modifications Copyright (C) 2018 IBM.
+ * ================================================================================
+ * 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.sli.core.sli.provider;
import java.util.HashMap;
diff --git a/core/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicService.java b/core/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicService.java
index a23594ee3..630c29018 100644
--- a/core/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicService.java
+++ b/core/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicService.java
@@ -8,9 +8,9 @@
* 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.
@@ -22,15 +22,16 @@
package org.onap.ccsdk.sli.core.sli.provider;
import java.util.Properties;
-
import org.onap.ccsdk.sli.core.sli.SvcLogicException;
import org.onap.ccsdk.sli.core.sli.provider.base.SvcLogicServiceBase;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
+import org.opendaylight.mdsal.dom.api.DOMDataBroker;
+
public interface SvcLogicService extends SvcLogicServiceBase {
String NAME = "org.onap.ccsdk.sli.core.sli.provider.SvcLogicService";
+ @Override
@Deprecated
Properties execute(String module, String rpc, String version, String mode, Properties parms) throws SvcLogicException;
diff --git a/core/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicServiceImpl.java b/core/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicServiceImpl.java
index 92c2aa49a..35a299323 100755
--- a/core/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicServiceImpl.java
+++ b/core/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicServiceImpl.java
@@ -33,7 +33,7 @@ import org.onap.ccsdk.sli.core.sli.SvcLogicStoreFactory;
import org.onap.ccsdk.sli.core.sli.provider.base.SvcLogicPropertiesProvider;
import org.onap.ccsdk.sli.core.sli.provider.base.SvcLogicResolver;
import org.onap.ccsdk.sli.core.sli.provider.base.SvcLogicServiceImplBase;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
+import org.opendaylight.mdsal.dom.api.DOMDataBroker;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/core/sli/provider/src/main/resources/OSGI-INF/blueprint/sli-blueprint.xml b/core/sli/provider/src/main/resources/OSGI-INF/blueprint/sli-blueprint.xml
deleted file mode 100644
index fb3ab9a03..000000000
--- a/core/sli/provider/src/main/resources/OSGI-INF/blueprint/sli-blueprint.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
- xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
- odl:use-default-for-reference-types="true">
-
- <bean id="propProvider" class="org.onap.ccsdk.sli.core.sli.provider.SvcLogicPropertiesProviderImpl" />
- <reference id="dblibService" interface="org.onap.ccsdk.sli.core.dblib.DbLibService" />
- <bean id="svcLogicClassResolver" class="org.onap.ccsdk.sli.core.sli.provider.SvcLogicClassResolver" />
-
- <bean id="svcLogicService" class="org.onap.ccsdk.sli.core.sli.provider.SvcLogicServiceImpl">
- <argument ref="propProvider" />
- <argument ref="dblibService" />
- <argument ref="svcLogicClassResolver" />
- </bean>
-
- <service ref="svcLogicService">
- <interfaces>
- <value>org.onap.ccsdk.sli.core.sli.provider.SvcLogicService</value>
- </interfaces>
- </service>
-
- <bean id="fileRecorder" class="org.onap.ccsdk.sli.core.sli.recording.FileRecorder" />
- <!-- Implementation name was chosen over interface name due to the fact that this Service
- was previously registered using the implementation name rather than the interface name.
- To ensure backwards compatibility with abstractions polling the Service Registry for the
- fileRecorder, the implementation name was chosen here. -->
- <service ref="fileRecorder" interface="org.onap.ccsdk.sli.core.sli.recording.FileRecorder" />
-
- <bean id="slf4jRecorder" class="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder" />
- <!-- Implementation name was chosen over interface name due to the fact that this Service
- was previously registered using the implementation name rather than the interface name.
- To ensure backwards compatibility with abstractions polling the Service Registry for the
- slf4jRecorder, the implementation name was chosen here. -->
- <service ref="slf4jRecorder" interface="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder" />
-
-</blueprint>
diff --git a/core/sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelperTest.java b/core/sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelperTest.java
index 93d9931d0..9d2ae2385 100755
--- a/core/sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelperTest.java
+++ b/core/sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelperTest.java
@@ -72,6 +72,7 @@ public class MdsalHelperTest extends TestCase {
private static final Logger LOG = LoggerFactory.getLogger(MdsalHelperTest.class);
public static final String pathToSdnPropertiesFile = "src/test/resources/l3sdn.properties";
+
public void testSdnProperties() {
MdsalHelperTesterUtil.loadProperties(pathToSdnPropertiesFile);
@@ -156,7 +157,7 @@ public class MdsalHelperTest extends TestCase {
props.setProperty("execute-graph-input.rpc", "do-it-now");
props.setProperty("execute-graph-input.sli-parameter[0].parameter-name", "bool-parm");
props.setProperty("execute-graph-input.sli-parameter[0].boolean-value", "true");
- props.setProperty("execute-graph-input,sli-parameter[1].parameter-name", "int-param");
+ props.setProperty("execute-graph-input.sli-parameter[1].parameter-name", "int-param");
props.setProperty("execute-graph-input.sli-parameter[1].int-value", "1");
props.setProperty("execute-graph-input.sli-parameter[2].parameter-name", "str-param");
props.setProperty("execute-graph-input.sli-parameter[2].str-value", "hello");
diff --git a/core/sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelperTesterUtil.java b/core/sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelperTesterUtil.java
index 2167b8101..0e1ae5e83 100644
--- a/core/sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelperTesterUtil.java
+++ b/core/sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelperTesterUtil.java
@@ -8,9 +8,9 @@
* 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.
@@ -21,14 +21,13 @@
package org.onap.ccsdk.sli.core.sli.provider;
-import org.onap.ccsdk.sli.core.sli.provider.MdsalHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class MdsalHelperTesterUtil extends MdsalHelper {
private static final Logger LOG = LoggerFactory.getLogger(MdsalHelperTesterUtil.class);
-
+
//Normally static init of classes goes here for some weird classloader thing
static {
String str = "Hello World!";
diff --git a/core/sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/PrintYangToPropTest.java b/core/sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/PrintYangToPropTest.java
index 50b7926a0..10bbbd91a 100644
--- a/core/sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/PrintYangToPropTest.java
+++ b/core/sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/PrintYangToPropTest.java
@@ -26,9 +26,7 @@ import java.util.Enumeration;
import java.util.LinkedList;
import java.util.List;
import java.util.Properties;
-
import org.junit.Test;
-import org.onap.ccsdk.sli.core.sli.provider.PrintYangToProp;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ExecuteGraphInput.Mode;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ExecuteGraphInputBuilder;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.TestResultsBuilder;
@@ -62,31 +60,31 @@ public class PrintYangToPropTest {
List<SliParameter> pList = new LinkedList<>();
SliParameterBuilder pBuilder = new SliParameterBuilder();
- pBuilder.setParameterName("string-param");
- pBuilder.setStringValue("hi");
- pList.add(pBuilder.build());
- pBuilder.setParameterName("int-param");
- pBuilder.setIntValue(1);
- pBuilder.setStringValue(null);
- pList.add(pBuilder.build());
- pBuilder.setParameterName("bool-param");
- pBuilder.setIntValue(null);
- pBuilder.setBooleanValue(true);
- pList.add(pBuilder.build());
- pBuilder.setParameterName("ipaddress-value1");
- pBuilder.setBooleanValue(null);
- pBuilder.setIpaddressValue(IpAddressBuilder.getDefaultInstance("127.0.0.1"));
- pList.add(pBuilder.build());
- pBuilder.setParameterName("ipaddress-value1");
- pBuilder.setIpaddressValue(IpAddressBuilder.getDefaultInstance("::1"));
- pList.add(pBuilder.build());
- pBuilder.setParameterName("ipprefix-value1");
- pBuilder.setIpaddressValue(null);
- pBuilder.setIpprefixValue(IpPrefixBuilder.getDefaultInstance("192.168.0.0/16"));
- pList.add(pBuilder.build());
- pBuilder.setParameterName("ipprefix-value2");
- pBuilder.setIpprefixValue(IpPrefixBuilder.getDefaultInstance("2001:db8:3c4d::/48"));
- pList.add(pBuilder.build());
+ pBuilder.setParameterName("string-param");
+ pBuilder.setStringValue("hi");
+ pList.add(pBuilder.build());
+ pBuilder.setParameterName("int-param");
+ pBuilder.setIntValue(1);
+ pBuilder.setStringValue(null);
+ pList.add(pBuilder.build());
+ pBuilder.setParameterName("bool-param");
+ pBuilder.setIntValue(null);
+ pBuilder.setBooleanValue(true);
+ pList.add(pBuilder.build());
+ pBuilder.setParameterName("ipaddress-value1");
+ pBuilder.setBooleanValue(null);
+ pBuilder.setIpaddressValue(IpAddressBuilder.getDefaultInstance("127.0.0.1"));
+ pList.add(pBuilder.build());
+ pBuilder.setParameterName("ipaddress-value2");
+ pBuilder.setIpaddressValue(IpAddressBuilder.getDefaultInstance("::1"));
+ pList.add(pBuilder.build());
+ pBuilder.setParameterName("ipprefix-value1");
+ pBuilder.setIpaddressValue(null);
+ pBuilder.setIpprefixValue(IpPrefixBuilder.getDefaultInstance("192.168.0.0/16"));
+ pList.add(pBuilder.build());
+ pBuilder.setParameterName("ipprefix-value2");
+ pBuilder.setIpprefixValue(IpPrefixBuilder.getDefaultInstance("2001:db8:3c4d::/48"));
+ pList.add(pBuilder.build());
@@ -94,7 +92,7 @@ public class PrintYangToPropTest {
// Generate properties
- props = PrintYangToProp.toProperties(props, egBuilder);
+ props = MdsalHelper.toProperties(props, egBuilder);
Enumeration propNames = props.propertyNames();
@@ -104,11 +102,11 @@ public class PrintYangToPropTest {
}
// Generate builder from properties just generated
- PrintYangToProp.toBuilder(props, pBuilder);
-
+ MdsalHelper.toBuilder(props, pBuilder);
+
}
-
+
@Test
public void testWithList() {
TestResultsBuilder resultsBuilder = new TestResultsBuilder();
@@ -125,7 +123,7 @@ public class PrintYangToPropTest {
// Generate properties
Properties props = new Properties();
- props = PrintYangToProp.toProperties(props, resultsBuilder);
+ props = MdsalHelper.toProperties(props, resultsBuilder);
Enumeration propNames = props.propertyNames();
@@ -135,7 +133,7 @@ public class PrintYangToPropTest {
}
// Generate builder from properties just generated
- PrintYangToProp.toBuilder(props, resultsBuilder);
+ MdsalHelper.toBuilder(props, resultsBuilder);
}
diff --git a/core/sliPluginUtils/provider/src/main/resources/OSGI-INF/blueprint/slipluginutils-blueprint.xml b/core/sliPluginUtils/provider/src/main/resources/OSGI-INF/blueprint/slipluginutils-blueprint.xml
deleted file mode 100644
index 534b92c93..000000000
--- a/core/sliPluginUtils/provider/src/main/resources/OSGI-INF/blueprint/slipluginutils-blueprint.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
- xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
- odl:use-default-for-reference-types="true">
-
- <bean id="sliPluginUtils" class="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" />
- <service ref="sliPluginUtils"
- interface="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" />
-
- <bean id="sliStringUtils" class="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" />
- <service ref="sliStringUtils"
- interface="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" />
-</blueprint>
diff --git a/core/sliapi/model/swagger/src/main/json/sliapi.json b/core/sliapi/model/swagger/src/main/json/sliapi.json
index 9133f3379..3848cb551 100644
--- a/core/sliapi/model/swagger/src/main/json/sliapi.json
+++ b/core/sliapi/model/swagger/src/main/json/sliapi.json
@@ -1 +1 @@
-{"swagger":"2.0","info":{"description":"Defines API to service logic interpreter,This module contains a collection of generally useful derived\nYANG data types.\n\nCopyright (c) 2013 IETF Trust and the persons identified as\nauthors of the code. All rights reserved.\n\nRedistribution and use in source and binary forms, with or\nwithout modification, is permitted pursuant to, and subject\nto the license terms contained in, the Simplified BSD License\nset forth in Section 4.c of the IETF Trust's Legal Provisions\nRelating to IETF Documents\n(http://trustee.ietf.org/license-info).\n\nThis version of this YANG module is part of RFC 6991; see\nthe RFC itself for full legal notices.,This module contains a collection of generally useful derived\nYANG data types for Internet addresses and related things.\n\nCopyright (c) 2013 IETF Trust and the persons identified as\nauthors of the code. All rights reserved.\n\nRedistribution and use in source and binary forms, with or\nwithout modification, is permitted pursuant to, and subject\nto the license terms contained in, the Simplified BSD License\nset forth in Section 4.c of the IETF Trust's Legal Provisions\nRelating to IETF Documents\n(http://trustee.ietf.org/license-info).\n\nThis version of this YANG module is part of RFC 6991; see\nthe RFC itself for full legal notices.","version":"1.2.0-SNAPSHOT","title":"SLI-API,ietf-yang-types,ietf-inet-types API"},"consumes":["application/json","application/xml"],"produces":["application/json","application/xml"],"paths":{"/config/SLI-API:test-results/":{"get":{"tags":["SLI-API"],"description":"returns sli.api.TestResults","parameters":[],"responses":{"400":{"description":"Internal error"},"200":{"description":"sli.api.TestResults","responseSchema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"},"schema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"}}}},"post":{"tags":["SLI-API"],"description":"creates sli.api.TestResults","parameters":[{"in":"body","name":"sli.api.TestResults.body-param","description":"sli.api.TestResults to be added to list","required":false,"schema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"}}],"responses":{"400":{"description":"Internal error"},"201":{"description":"Object created"},"409":{"description":"Object already exists"}}},"put":{"tags":["SLI-API"],"description":"creates or updates sli.api.TestResults","parameters":[{"in":"body","name":"sli.api.TestResults.body-param","description":"sli.api.TestResults to be added or updated","required":false,"schema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"}}],"responses":{"400":{"description":"Internal error"},"201":{"description":"Object created"},"204":{"description":"Object modified"}}},"delete":{"tags":["SLI-API"],"description":"removes sli.api.TestResults","parameters":[],"responses":{"400":{"description":"Internal error"},"204":{"description":"Object deleted"}}}},"/config/SLI-API:test-results/SLI-API:test-result/":{"post":{"description":"creates sli.api.testresults.TestResult","parameters":[{"in":"body","name":"sli.api.testresults.TestResult.body-param","description":"sli.api.testresults.TestResult to be added to list","required":false,"schema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}],"responses":{"400":{"description":"Internal error"},"201":{"description":"Object created"},"409":{"description":"Object already exists"}}}},"/config/SLI-API:test-results/SLI-API:test-result/{test-identifier}/":{"get":{"tags":["SLI-API"],"description":"returns sli.api.testresults.TestResult","parameters":[{"name":"test-identifier","in":"path","description":"Id of test-result","required":true,"type":"string"}],"responses":{"400":{"description":"Internal error"},"200":{"description":"sli.api.testresults.TestResult","responseSchema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"},"schema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}}},"post":{"tags":["SLI-API"],"description":"creates sli.api.testresults.TestResult","parameters":[{"name":"test-identifier","in":"path","description":"Id of test-result","required":true,"type":"string"},{"in":"body","name":"sli.api.testresults.TestResult.body-param","description":"sli.api.testresults.TestResult to be added to list","required":false,"schema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}],"responses":{"400":{"description":"Internal error"},"201":{"description":"Object created"},"409":{"description":"Object already exists"}}},"put":{"tags":["SLI-API"],"description":"creates or updates sli.api.testresults.TestResult","parameters":[{"name":"test-identifier","in":"path","description":"Id of test-result","required":true,"type":"string"},{"in":"body","name":"sli.api.testresults.TestResult.body-param","description":"sli.api.testresults.TestResult to be added or updated","required":false,"schema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}],"responses":{"400":{"description":"Internal error"},"201":{"description":"Object created"},"204":{"description":"Object modified"}}},"delete":{"tags":["SLI-API"],"description":"removes sli.api.testresults.TestResult","parameters":[{"name":"test-identifier","in":"path","description":"Id of test-result","required":true,"type":"string"}],"responses":{"400":{"description":"Internal error"},"204":{"description":"Object deleted"}}}},"/operational/SLI-API:test-results/":{"get":{"tags":["SLI-API"],"description":"returns sli.api.TestResults","parameters":[],"responses":{"400":{"description":"Internal error"},"200":{"description":"sli.api.TestResults","responseSchema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"},"schema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"}}}}},"/operational/SLI-API:test-results/SLI-API:test-result/{test-identifier}/":{"get":{"tags":["SLI-API"],"description":"returns sli.api.testresults.TestResult","parameters":[{"name":"test-identifier","in":"path","description":"Id of test-result","required":true,"type":"string"}],"responses":{"400":{"description":"Internal error"},"200":{"description":"sli.api.testresults.TestResult","responseSchema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"},"schema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}}}},"/operations/SLI-API:execute-graph/":{"post":{"tags":["SLI-API"],"parameters":[{"in":"body","name":"sli.api.executegraph.Input.body-param","required":false,"schema":{"properties":{"input":{"originalRef":"#/definitions/sli.api.executegraph.Input","$ref":"#/definitions/sli.api.executegraph.Input"}}}}],"responses":{"400":{"description":"Internal error"},"200":{"description":"Correct response","responseSchema":{"originalRef":"#/definitions/sli.api.ExecuteGraph","$ref":"#/definitions/sli.api.ExecuteGraph"},"schema":{"originalRef":"#/definitions/sli.api.ExecuteGraph","$ref":"#/definitions/sli.api.ExecuteGraph"}},"201":{"description":"No response"}}}},"/operations/SLI-API:healthcheck/":{"post":{"tags":["SLI-API"],"parameters":[],"responses":{"400":{"description":"Internal error"},"200":{"description":"Correct response","responseSchema":{"originalRef":"#/definitions/sli.api.Healthcheck","$ref":"#/definitions/sli.api.Healthcheck"},"schema":{"originalRef":"#/definitions/sli.api.Healthcheck","$ref":"#/definitions/sli.api.Healthcheck"}},"201":{"description":"No response"}}}},"/operations/SLI-API:vlbcheck/":{"post":{"tags":["SLI-API"],"parameters":[],"responses":{"400":{"description":"Internal error"},"200":{"description":"Correct response","responseSchema":{"originalRef":"#/definitions/sli.api.Vlbcheck","$ref":"#/definitions/sli.api.Vlbcheck"},"schema":{"originalRef":"#/definitions/sli.api.Vlbcheck","$ref":"#/definitions/sli.api.Vlbcheck"}},"201":{"description":"No response"}}}}},"definitions":{"sli.api.ExecuteGraph":{"type":"object","properties":{"output":{"originalRef":"#/definitions/sli.api.ResponseFields","$ref":"#/definitions/sli.api.ResponseFields"}}},"sli.api.Healthcheck":{"type":"object","properties":{"output":{"originalRef":"#/definitions/sli.api.ResponseFields","$ref":"#/definitions/sli.api.ResponseFields"}}},"sli.api.ModeEnumeration":{"type":"string","enum":["sync","async"]},"sli.api.ParameterSetting":{"type":"object","properties":{"string-value":{"type":"string"},"boolean-value":{"type":"boolean"},"parameter-name":{"type":"string","description":"Parameter name"},"int-value":{"type":"integer","format":"int32"}}},"sli.api.ResponseFields":{"type":"object","properties":{"response-code":{"type":"string"},"response-message":{"type":"string"},"context-memory-json":{"type":"string"},"ack-final-indicator":{"type":"string"}}},"sli.api.TestResults":{"type":"object","properties":{"test-result":{"type":"array","items":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}}},"sli.api.Vlbcheck":{"type":"object","properties":{"output":{"originalRef":"#/definitions/sli.api.ResponseFields","$ref":"#/definitions/sli.api.ResponseFields"}}},"sli.api.executegraph.Input":{"type":"object","properties":{"mode":{"originalRef":"#/definitions/sli.api.ModeEnumeration","$ref":"#/definitions/sli.api.ModeEnumeration"},"module-name":{"type":"string"},"sli-parameter":{"type":"array","items":{"originalRef":"#/definitions/sli.api.ParameterSetting","$ref":"#/definitions/sli.api.ParameterSetting"}},"rpc-name":{"type":"string"}}},"sli.api.testresults.TestResult":{"type":"object","properties":{"results":{"type":"array","items":{"type":"string"}},"test-identifier":{"type":"string"}}}}} \ No newline at end of file
+{"swagger":"2.0","info":{"description":"This module contains a collection of generally useful derived\nYANG data types for Internet addresses and related things.\n\nCopyright (c) 2013 IETF Trust and the persons identified as\nauthors of the code. All rights reserved.\n\nRedistribution and use in source and binary forms, with or\nwithout modification, is permitted pursuant to, and subject\nto the license terms contained in, the Simplified BSD License\nset forth in Section 4.c of the IETF Trust's Legal Provisions\nRelating to IETF Documents\n(http://trustee.ietf.org/license-info).\n\nThis version of this YANG module is part of RFC 6991; see\nthe RFC itself for full legal notices.,Defines API to service logic interpreter,This module contains a collection of generally useful derived\nYANG data types.\n\nCopyright (c) 2013 IETF Trust and the persons identified as\nauthors of the code. All rights reserved.\n\nRedistribution and use in source and binary forms, with or\nwithout modification, is permitted pursuant to, and subject\nto the license terms contained in, the Simplified BSD License\nset forth in Section 4.c of the IETF Trust's Legal Provisions\nRelating to IETF Documents\n(http://trustee.ietf.org/license-info).\n\nThis version of this YANG module is part of RFC 6991; see\nthe RFC itself for full legal notices.","version":"1.2.0-SNAPSHOT","title":"ietf-inet-types,SLI-API,ietf-yang-types API"},"consumes":["application/json","application/xml"],"produces":["application/json","application/xml"],"paths":{"/config/SLI-API:test-results/":{"get":{"tags":["SLI-API"],"description":"returns sli.api.TestResults","parameters":[],"responses":{"400":{"description":"Internal error"},"200":{"description":"sli.api.TestResults","responseSchema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"},"schema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"}}}},"post":{"tags":["SLI-API"],"description":"creates sli.api.TestResults","parameters":[{"in":"body","name":"sli.api.TestResults.body-param","description":"sli.api.TestResults to be added to list","required":false,"schema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"}}],"responses":{"400":{"description":"Internal error"},"201":{"description":"Object created"},"409":{"description":"Object already exists"}}},"put":{"tags":["SLI-API"],"description":"creates or updates sli.api.TestResults","parameters":[{"in":"body","name":"sli.api.TestResults.body-param","description":"sli.api.TestResults to be added or updated","required":false,"schema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"}}],"responses":{"400":{"description":"Internal error"},"201":{"description":"Object created"},"204":{"description":"Object modified"}}},"delete":{"tags":["SLI-API"],"description":"removes sli.api.TestResults","parameters":[],"responses":{"400":{"description":"Internal error"},"204":{"description":"Object deleted"}}}},"/config/SLI-API:test-results/SLI-API:test-result/":{"post":{"description":"creates sli.api.testresults.TestResult","parameters":[{"in":"body","name":"sli.api.testresults.TestResult.body-param","description":"sli.api.testresults.TestResult to be added to list","required":false,"schema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}],"responses":{"400":{"description":"Internal error"},"201":{"description":"Object created"},"409":{"description":"Object already exists"}}}},"/config/SLI-API:test-results/SLI-API:test-result/{test-identifier}/":{"get":{"tags":["SLI-API"],"description":"returns sli.api.testresults.TestResult","parameters":[{"name":"test-identifier","in":"path","description":"Id of test-result","required":true,"type":"string"}],"responses":{"400":{"description":"Internal error"},"200":{"description":"sli.api.testresults.TestResult","responseSchema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"},"schema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}}},"post":{"tags":["SLI-API"],"description":"creates sli.api.testresults.TestResult","parameters":[{"name":"test-identifier","in":"path","description":"Id of test-result","required":true,"type":"string"},{"in":"body","name":"sli.api.testresults.TestResult.body-param","description":"sli.api.testresults.TestResult to be added to list","required":false,"schema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}],"responses":{"400":{"description":"Internal error"},"201":{"description":"Object created"},"409":{"description":"Object already exists"}}},"put":{"tags":["SLI-API"],"description":"creates or updates sli.api.testresults.TestResult","parameters":[{"name":"test-identifier","in":"path","description":"Id of test-result","required":true,"type":"string"},{"in":"body","name":"sli.api.testresults.TestResult.body-param","description":"sli.api.testresults.TestResult to be added or updated","required":false,"schema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}],"responses":{"400":{"description":"Internal error"},"201":{"description":"Object created"},"204":{"description":"Object modified"}}},"delete":{"tags":["SLI-API"],"description":"removes sli.api.testresults.TestResult","parameters":[{"name":"test-identifier","in":"path","description":"Id of test-result","required":true,"type":"string"}],"responses":{"400":{"description":"Internal error"},"204":{"description":"Object deleted"}}}},"/operational/SLI-API:test-results/":{"get":{"tags":["SLI-API"],"description":"returns sli.api.TestResults","parameters":[],"responses":{"400":{"description":"Internal error"},"200":{"description":"sli.api.TestResults","responseSchema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"},"schema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"}}}}},"/operational/SLI-API:test-results/SLI-API:test-result/{test-identifier}/":{"get":{"tags":["SLI-API"],"description":"returns sli.api.testresults.TestResult","parameters":[{"name":"test-identifier","in":"path","description":"Id of test-result","required":true,"type":"string"}],"responses":{"400":{"description":"Internal error"},"200":{"description":"sli.api.testresults.TestResult","responseSchema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"},"schema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}}}},"/operations/SLI-API:execute-graph/":{"post":{"tags":["SLI-API"],"parameters":[{"in":"body","name":"sli.api.executegraph.Input.body-param","required":false,"schema":{"properties":{"input":{"originalRef":"#/definitions/sli.api.executegraph.Input","$ref":"#/definitions/sli.api.executegraph.Input"}}}}],"responses":{"400":{"description":"Internal error"},"200":{"description":"Correct response","responseSchema":{"originalRef":"#/definitions/sli.api.ExecuteGraph","$ref":"#/definitions/sli.api.ExecuteGraph"},"schema":{"originalRef":"#/definitions/sli.api.ExecuteGraph","$ref":"#/definitions/sli.api.ExecuteGraph"}},"201":{"description":"No response"}}}},"/operations/SLI-API:healthcheck/":{"post":{"tags":["SLI-API"],"parameters":[],"responses":{"400":{"description":"Internal error"},"200":{"description":"Correct response","responseSchema":{"originalRef":"#/definitions/sli.api.Healthcheck","$ref":"#/definitions/sli.api.Healthcheck"},"schema":{"originalRef":"#/definitions/sli.api.Healthcheck","$ref":"#/definitions/sli.api.Healthcheck"}},"201":{"description":"No response"}}}},"/operations/SLI-API:vlbcheck/":{"post":{"tags":["SLI-API"],"parameters":[],"responses":{"400":{"description":"Internal error"},"200":{"description":"Correct response","responseSchema":{"originalRef":"#/definitions/sli.api.Vlbcheck","$ref":"#/definitions/sli.api.Vlbcheck"},"schema":{"originalRef":"#/definitions/sli.api.Vlbcheck","$ref":"#/definitions/sli.api.Vlbcheck"}},"201":{"description":"No response"}}}}},"definitions":{"sli.api.ExecuteGraph":{"type":"object","properties":{"output":{"originalRef":"#/definitions/sli.api.ResponseFields","$ref":"#/definitions/sli.api.ResponseFields"}}},"sli.api.Healthcheck":{"type":"object","properties":{"output":{"originalRef":"#/definitions/sli.api.ResponseFields","$ref":"#/definitions/sli.api.ResponseFields"}}},"sli.api.ModeEnumeration":{"type":"string","enum":["sync","async"]},"sli.api.ParameterSetting":{"type":"object","properties":{"string-value":{"type":"string"},"boolean-value":{"type":"boolean"},"parameter-name":{"type":"string","description":"Parameter name"},"int-value":{"type":"integer","format":"int32"}}},"sli.api.ResponseFields":{"type":"object","properties":{"response-code":{"type":"string"},"response-message":{"type":"string"},"context-memory-json":{"type":"string"},"ack-final-indicator":{"type":"string"}}},"sli.api.TestResults":{"type":"object","properties":{"test-result":{"type":"array","items":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}}},"sli.api.Vlbcheck":{"type":"object","properties":{"output":{"originalRef":"#/definitions/sli.api.ResponseFields","$ref":"#/definitions/sli.api.ResponseFields"}}},"sli.api.executegraph.Input":{"type":"object","properties":{"mode":{"originalRef":"#/definitions/sli.api.ModeEnumeration","$ref":"#/definitions/sli.api.ModeEnumeration"},"module-name":{"type":"string"},"sli-parameter":{"type":"array","items":{"originalRef":"#/definitions/sli.api.ParameterSetting","$ref":"#/definitions/sli.api.ParameterSetting"}},"rpc-name":{"type":"string"}}},"sli.api.testresults.TestResult":{"type":"object","properties":{"results":{"type":"array","items":{"type":"string"}},"test-identifier":{"type":"string"}}}}} \ No newline at end of file
diff --git a/core/sliapi/model/swagger/src/main/yaml/sliapi.yaml b/core/sliapi/model/swagger/src/main/yaml/sliapi.yaml
index 15da98dfd..b97b1325a 100644
--- a/core/sliapi/model/swagger/src/main/yaml/sliapi.yaml
+++ b/core/sliapi/model/swagger/src/main/yaml/sliapi.yaml
@@ -1,25 +1,25 @@
---
swagger: "2.0"
info:
- description: "Defines API to service logic interpreter,This module contains a collection\
- \ of generally useful derived\nYANG data types.\n\nCopyright (c) 2013 IETF Trust\
- \ and the persons identified as\nauthors of the code. All rights reserved.\n\n\
- Redistribution and use in source and binary forms, with or\nwithout modification,\
+ description: "This module contains a collection of generally useful derived\nYANG\
+ \ data types for Internet addresses and related things.\n\nCopyright (c) 2013\
+ \ IETF Trust and the persons identified as\nauthors of the code. All rights reserved.\n\
+ \nRedistribution and use in source and binary forms, with or\nwithout modification,\
\ is permitted pursuant to, and subject\nto the license terms contained in, the\
\ Simplified BSD License\nset forth in Section 4.c of the IETF Trust's Legal Provisions\n\
Relating to IETF Documents\n(http://trustee.ietf.org/license-info).\n\nThis version\
\ of this YANG module is part of RFC 6991; see\nthe RFC itself for full legal\
- \ notices.,This module contains a collection of generally useful derived\nYANG\
- \ data types for Internet addresses and related things.\n\nCopyright (c) 2013\
- \ IETF Trust and the persons identified as\nauthors of the code. All rights reserved.\n\
- \nRedistribution and use in source and binary forms, with or\nwithout modification,\
+ \ notices.,Defines API to service logic interpreter,This module contains a collection\
+ \ of generally useful derived\nYANG data types.\n\nCopyright (c) 2013 IETF Trust\
+ \ and the persons identified as\nauthors of the code. All rights reserved.\n\n\
+ Redistribution and use in source and binary forms, with or\nwithout modification,\
\ is permitted pursuant to, and subject\nto the license terms contained in, the\
\ Simplified BSD License\nset forth in Section 4.c of the IETF Trust's Legal Provisions\n\
Relating to IETF Documents\n(http://trustee.ietf.org/license-info).\n\nThis version\
\ of this YANG module is part of RFC 6991; see\nthe RFC itself for full legal\
\ notices."
version: "1.2.0-SNAPSHOT"
- title: "SLI-API,ietf-yang-types,ietf-inet-types API"
+ title: "ietf-inet-types,SLI-API,ietf-yang-types API"
consumes:
- "application/json"
- "application/xml"
diff --git a/core/sliapi/provider/pom.xml b/core/sliapi/provider/pom.xml
index b9d1c9a67..5bccec9b6 100755
--- a/core/sliapi/provider/pom.xml
+++ b/core/sliapi/provider/pom.xml
@@ -17,58 +17,54 @@
<name>ccsdk-sli-core :: sliapi :: ${project.artifactId}</name>
<dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>dblib-provider</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
- </dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>sliapi-model-yang</artifactId>
- <version>${project.version}</version>
- </dependency>
+ <dependencies>
+ <dependency>
+ <groupId>org.onap.ccsdk.sli.core</groupId>
+ <artifactId>dblib-provider</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+ <dependencies>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-binding-api</artifactId>
+ <scope>provided</scope>
</dependency>
-
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-binding-api</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-binding-broker-impl</artifactId>
- </dependency>
-
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-binding-dom-adapter</artifactId>
+ <scope>provided</scope>
</dependency>
-
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>yang-binding</artifactId>
+ <scope>provided</scope>
</dependency>
-
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>sal-common-util</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yang-data-impl</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ <scope>provided</scope>
</dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
- <scope>provided</scope>
- </dependency>
<dependency>
<groupId>org.onap.ccsdk.sli.core</groupId>
+ <artifactId>sliapi-model-yang</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.ccsdk.sli.core</groupId>
<artifactId>sli-common</artifactId>
<version>${project.version}</version>
</dependency>
@@ -82,27 +78,17 @@
<artifactId>sli-provider-base</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-core-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-data-impl</artifactId>
- </dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
-
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
-
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
diff --git a/core/sliapi/provider/src/main/java/org/onap/ccsdk/sli/core/sliapi/SliapiProvider.java b/core/sliapi/provider/src/main/java/org/onap/ccsdk/sli/core/sliapi/SliapiProvider.java
index 449fc3822..a00131efb 100644
--- a/core/sliapi/provider/src/main/java/org/onap/ccsdk/sli/core/sliapi/SliapiProvider.java
+++ b/core/sliapi/provider/src/main/java/org/onap/ccsdk/sli/core/sliapi/SliapiProvider.java
@@ -21,6 +21,8 @@
package org.onap.ccsdk.sli.core.sliapi;
+import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.ListenableFuture;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
@@ -28,19 +30,14 @@ import java.io.IOException;
import java.util.Enumeration;
import java.util.LinkedList;
import java.util.Properties;
-
+import java.util.concurrent.ExecutionException;
import org.onap.ccsdk.sli.core.sli.provider.SvcLogicService;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
-import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
-import org.opendaylight.controller.md.sal.binding.impl.AbstractForwardedDataBroker;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.OptimisticLockFailedException;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
-import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
+import org.opendaylight.mdsal.binding.api.NotificationPublishService;
+import org.opendaylight.mdsal.binding.api.RpcProviderService;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.OptimisticLockFailedException;
+import org.opendaylight.mdsal.dom.api.DOMDataBroker;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ExecuteGraphInput;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ExecuteGraphInput.Mode;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ExecuteGraphInputBuilder;
@@ -50,14 +47,13 @@ import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.Hea
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.HealthcheckOutput;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.HealthcheckOutputBuilder;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.SLIAPIService;
-import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.TestResults;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.VlbcheckInput;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.VlbcheckOutput;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.VlbcheckOutputBuilder;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.execute.graph.input.SliParameter;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.test.results.TestResult;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.test.results.TestResultBuilder;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.concepts.ObjectRegistration;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.common.RpcError.ErrorType;
import org.opendaylight.yangtools.yang.common.RpcResult;
@@ -78,9 +74,6 @@ import org.osgi.framework.ServiceReference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.google.common.util.concurrent.Futures;
-import com.google.common.util.concurrent.ListenableFuture;
-
/**
* Defines a base implementation for your provider. This class extends from a
* helper class which provides storage for the most commonly used components of
@@ -92,17 +85,17 @@ import com.google.common.util.concurrent.ListenableFuture;
* src/main/java in this project (created only once during first compilation):
*
* <pre>
- *
+ *
* &#64;Override
* public java.lang.AutoCloseable createInstance() {
- *
+ *
* final SliapiProvider provider = new SliapiProvider();
* provider.setDataBroker(getDataBrokerDependency());
* provider.setNotificationService(getNotificationServiceDependency());
* provider.setRpcRegistry(getRpcRegistryDependency());
* provider.initialize();
* return new AutoCloseable() {
- *
+ *
* &#64;Override
* public void close() throws Exception {
* // TODO: CLOSE ANY REGISTRATION OBJECTS CREATED USING ABOVE
@@ -112,7 +105,7 @@ import com.google.common.util.concurrent.ListenableFuture;
* }
* };
* }
- *
+ *
* </pre>
*/
public class SliapiProvider implements AutoCloseable, SLIAPIService {
@@ -120,14 +113,14 @@ public class SliapiProvider implements AutoCloseable, SLIAPIService {
private static final Logger LOG = LoggerFactory.getLogger(SliapiProvider.class);
private static final String appName = "slitester";
- protected DataBroker dataBroker;
+ //protected DataBroker dataBroker;
protected DOMDataBroker domDataBroker;
protected NotificationPublishService notificationService;
- protected RpcProviderRegistry rpcRegistry;
+ protected RpcProviderService rpcRegistry;
private SvcLogicService svcLogic;
- protected BindingAwareBroker.RpcRegistration<SLIAPIService> rpcRegistration;
+ protected ObjectRegistration<SLIAPIService> rpcRegistration;
private static String SLIAPI_NAMESPACE = "org:onap:ccsdk:sli:core:sliapi";
private static String SLIAPI_REVISION = "2016-11-10";
@@ -148,25 +141,26 @@ public class SliapiProvider implements AutoCloseable, SLIAPIService {
RESULTS_QNAME = QName.create(TEST_RESULT_QNAME, "results");
}
- public SliapiProvider(DataBroker dataBroker, NotificationPublishService notificationPublishService,
- RpcProviderRegistry rpcProviderRegistry) {
+ public SliapiProvider(DOMDataBroker dataBroker, NotificationPublishService notificationPublishService,
+ RpcProviderService rpcProviderRegistry) {
this(dataBroker, notificationPublishService, rpcProviderRegistry, findSvcLogicService());
}
- public SliapiProvider(DataBroker dataBroker, NotificationPublishService notificationPublishService,
- RpcProviderRegistry rpcProviderRegistry, SvcLogicService svcLogic) {
+ public SliapiProvider(DOMDataBroker dataBroker, NotificationPublishService notificationPublishService,
+ RpcProviderService rpcProviderRegistry, SvcLogicService svcLogic) {
this.LOG.info("Creating provider for " + appName);
- this.dataBroker = dataBroker;
+ //this.dataBroker = dataBroker;
this.notificationService = notificationPublishService;
this.rpcRegistry = rpcProviderRegistry;
this.svcLogic = svcLogic;
+ this.domDataBroker = dataBroker;
initialize();
}
public void initialize() {
LOG.info("Initializing provider for " + appName);
// initialization code goes here.
- rpcRegistration = rpcRegistry.addRpcImplementation(SLIAPIService.class, this);
+ rpcRegistration = rpcRegistry.registerRpcImplementation(SLIAPIService.class, this);
sdncStatusFile = System.getenv(SDNC_STATUS_FILE);
LOG.info("SDNC STATUS FILE = " + sdncStatusFile);
@@ -186,11 +180,9 @@ public class SliapiProvider implements AutoCloseable, SLIAPIService {
LOG.info("Successfully closed provider for " + appName);
}
- public void setDataBroker(DataBroker dataBroker) {
- this.dataBroker = dataBroker;
- if (dataBroker instanceof AbstractForwardedDataBroker) {
- domDataBroker = ((AbstractForwardedDataBroker) dataBroker).getDelegate();
- }
+ public void setDataBroker(DOMDataBroker dataBroker) {
+ domDataBroker = dataBroker;
+
if (LOG.isDebugEnabled()) {
LOG.debug("DataBroker set to " + (dataBroker == null ? "null" : NON_NULL) + ".");
}
@@ -203,7 +195,7 @@ public class SliapiProvider implements AutoCloseable, SLIAPIService {
}
}
- public void setRpcRegistry(RpcProviderRegistry rpcRegistry) {
+ public void setRpcRegistry(RpcProviderService rpcRegistry) {
this.rpcRegistry = rpcRegistry;
if (LOG.isDebugEnabled()) {
LOG.debug("RpcRegistry set to " + (rpcRegistry == null ? "null" : NON_NULL) + ".");
@@ -262,7 +254,7 @@ public class SliapiProvider implements AutoCloseable, SLIAPIService {
Properties parms = new Properties();
// Pass properties using names from sli-parameters
- for (SliParameter sliParm : input.getSliParameter()) {
+ for (SliParameter sliParm : input.getSliParameter().values()) {
String propValue = "";
@@ -454,7 +446,8 @@ public class SliapiProvider implements AutoCloseable, SLIAPIService {
return (Futures.immediateFuture(rpcResult));
}
- public ListenableFuture<RpcResult<VlbcheckOutput>> vlbcheck(VlbcheckInput vlbInput) {
+ @Override
+ public ListenableFuture<RpcResult<VlbcheckOutput>> vlbcheck(VlbcheckInput vlbInput) {
RpcResult<VlbcheckOutput> rpcResult = null;
SvcLogicService svcLogic = getSvcLogicService();
@@ -578,12 +571,12 @@ public class SliapiProvider implements AutoCloseable, SLIAPIService {
YangInstanceIdentifier testResultsPid = YangInstanceIdentifier.builder().node(TEST_RESULTS_QNAME)
.node(QName.create(TEST_RESULTS_QNAME, "test-result")).build();
YangInstanceIdentifier testResultPid = testResultsPid
- .node(new NodeIdentifierWithPredicates(TEST_RESULT_QNAME, resultNode.getIdentifier().getKeyValues()));
+ .node(NodeIdentifierWithPredicates.of(TEST_RESULT_QNAME, resultNode.getIdentifier().asMap()));
int tries = 2;
while (true) {
try {
- DOMDataWriteTransaction wtx = domDataBroker.newWriteOnlyTransaction();
+ DOMDataTreeWriteTransaction wtx = domDataBroker.newWriteOnlyTransaction();
if (merge) {
LOG.info("Merging test identifier " + entry.getTestIdentifier());
wtx.merge(storeType, testResultPid, resultNode);
@@ -591,10 +584,10 @@ public class SliapiProvider implements AutoCloseable, SLIAPIService {
LOG.info("Putting test identifier " + entry.getTestIdentifier());
wtx.put(storeType, testResultPid, resultNode);
}
- wtx.submit().checkedGet();
+ wtx.commit().get();
LOG.trace("Update DataStore succeeded");
break;
- } catch (final TransactionCommitFailedException e) {
+ } catch (final InterruptedException | ExecutionException e) {
if (e instanceof OptimisticLockFailedException) {
if (--tries <= 0) {
LOG.trace("Got OptimisticLockFailedException on last try - failing ");
@@ -610,40 +603,40 @@ public class SliapiProvider implements AutoCloseable, SLIAPIService {
}
- private void SaveTestResult(final TestResult entry, boolean merge, LogicalDatastoreType storeType)
- throws IllegalStateException {
- // Each entry will be identifiable by a unique key, we have to create that
- // identifier
-
- InstanceIdentifier.InstanceIdentifierBuilder<TestResult> testResultIdBuilder = InstanceIdentifier
- .<TestResults>builder(TestResults.class).child(TestResult.class, entry.key());
- InstanceIdentifier<TestResult> path = testResultIdBuilder.build();
- int tries = 2;
- while (true) {
- try {
- WriteTransaction tx = dataBroker.newWriteOnlyTransaction();
- if (merge) {
- tx.merge(storeType, path, entry);
- } else {
- tx.put(storeType, path, entry);
- }
- tx.submit().checkedGet();
- LOG.trace("Update DataStore succeeded");
- break;
- } catch (final TransactionCommitFailedException e) {
- if (e instanceof OptimisticLockFailedException) {
- if (--tries <= 0) {
- LOG.trace("Got OptimisticLockFailedException on last try - failing ");
- throw new IllegalStateException(e);
- }
- LOG.trace("Got OptimisticLockFailedException - trying again ");
- } else {
- LOG.trace("Update DataStore failed");
- throw new IllegalStateException(e);
- }
- }
- }
- }
+// private void SaveTestResult(final TestResult entry, boolean merge, LogicalDatastoreType storeType)
+// throws IllegalStateException {
+// // Each entry will be identifiable by a unique key, we have to create that
+// // identifier
+//
+// InstanceIdentifier.InstanceIdentifierBuilder<TestResult> testResultIdBuilder = InstanceIdentifier
+// .<TestResults>builder(TestResults.class).child(TestResult.class, entry.key());
+// InstanceIdentifier<TestResult> path = testResultIdBuilder.build();
+// int tries = 2;
+// while (true) {
+// try {
+// WriteTransaction tx = dataBroker.newWriteOnlyTransaction();
+// if (merge) {
+// tx.merge(storeType, path, entry);
+// } else {
+// tx.put(storeType, path, entry);
+// }
+// tx.submit().checkedGet();
+// LOG.trace("Update DataStore succeeded");
+// break;
+// } catch (final TransactionCommitFailedException e) {
+// if (e instanceof OptimisticLockFailedException) {
+// if (--tries <= 0) {
+// LOG.trace("Got OptimisticLockFailedException on last try - failing ");
+// throw new IllegalStateException(e);
+// }
+// LOG.trace("Got OptimisticLockFailedException - trying again ");
+// } else {
+// LOG.trace("Update DataStore failed");
+// throw new IllegalStateException(e);
+// }
+// }
+// }
+// }
private MapEntryNode toMapEntryNode(TestResult testResult) {
@@ -664,7 +657,8 @@ public class SliapiProvider implements AutoCloseable, SLIAPIService {
// Construct test result ContainerNode with 2 children - test-identifier leaf
// and results leaf-set
MapEntryNode testResultNode = ImmutableNodes.mapEntryBuilder()
- .withNodeIdentifier(new NodeIdentifierWithPredicates(TEST_RESULT_QNAME, TEST_ID_QNAME,
+
+ .withNodeIdentifier(NodeIdentifierWithPredicates.of(TEST_RESULT_QNAME, TEST_ID_QNAME,
testResult.getTestIdentifier()))
.withChild(ImmutableNodes.leafNode(TEST_ID_QNAME, testResult.getTestIdentifier()))
.withChild(resultsNode).build();
diff --git a/core/sliapi/provider/src/main/resources/OSGI-INF/blueprint/sliapi-blueprint.xml b/core/sliapi/provider/src/main/resources/OSGI-INF/blueprint/sliapi-blueprint.xml
deleted file mode 100644
index 875027e63..000000000
--- a/core/sliapi/provider/src/main/resources/OSGI-INF/blueprint/sliapi-blueprint.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
- xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
- odl:use-default-for-reference-types="true">
-
- <reference id="svcLogicService"
- interface="org.onap.ccsdk.sli.core.sli.provider.SvcLogicService" />
-
-
- <reference id="dataBroker"
- interface="org.opendaylight.controller.md.sal.binding.api.DataBroker"
- odl:type="default" />
-
- <reference id="notificationService"
- interface="org.opendaylight.controller.md.sal.binding.api.NotificationPublishService"
- odl:type="default" />
-
- <reference id="rpcRegistry"
- interface="org.opendaylight.controller.sal.binding.api.RpcProviderRegistry"
- odl:type="default" />
-
- <bean id="provider" class="org.onap.ccsdk.sli.core.sliapi.SliapiProvider">
- <argument ref="dataBroker" />
- <argument ref="notificationService" />
- <argument ref="rpcRegistry" />
-
- </bean>
-</blueprint> \ No newline at end of file
diff --git a/core/sliapi/provider/src/main/resources/org/opendaylight/blueprint/sliapi-blueprint.xml b/core/sliapi/provider/src/main/resources/org/opendaylight/blueprint/sliapi-blueprint.xml
index 875027e63..8ec666d53 100644
--- a/core/sliapi/provider/src/main/resources/org/opendaylight/blueprint/sliapi-blueprint.xml
+++ b/core/sliapi/provider/src/main/resources/org/opendaylight/blueprint/sliapi-blueprint.xml
@@ -8,16 +8,13 @@
<reference id="dataBroker"
- interface="org.opendaylight.controller.md.sal.binding.api.DataBroker"
- odl:type="default" />
+ interface="org.opendaylight.mdsal.dom.api.DOMDataBroker" />
<reference id="notificationService"
- interface="org.opendaylight.controller.md.sal.binding.api.NotificationPublishService"
- odl:type="default" />
+ interface="org.opendaylight.mdsal.binding.api.NotificationPublishService" />
<reference id="rpcRegistry"
- interface="org.opendaylight.controller.sal.binding.api.RpcProviderRegistry"
- odl:type="default" />
+ interface="org.opendaylight.mdsal.binding.api.RpcProviderService" />
<bean id="provider" class="org.onap.ccsdk.sli.core.sliapi.SliapiProvider">
<argument ref="dataBroker" />
diff --git a/core/sliapi/provider/src/test/java/org/onap/ccsdk/sli/core/sliapi/TestSliapiProvider.java b/core/sliapi/provider/src/test/java/org/onap/ccsdk/sli/core/sliapi/TestSliapiProvider.java
index f48cf783b..b731423c5 100644
--- a/core/sliapi/provider/src/test/java/org/onap/ccsdk/sli/core/sliapi/TestSliapiProvider.java
+++ b/core/sliapi/provider/src/test/java/org/onap/ccsdk/sli/core/sliapi/TestSliapiProvider.java
@@ -1,15 +1,30 @@
-/**
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : CCSDK
+ * ================================================================================
+ * Copyright (C) 2018 IBM. 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.sli.core.sliapi;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
-
import java.io.InputStream;
import java.net.URL;
import java.util.HashMap;
@@ -47,10 +62,9 @@ import org.onap.ccsdk.sli.core.sli.provider.base.SetNodeExecutor;
import org.onap.ccsdk.sli.core.sli.provider.base.SwitchNodeExecutor;
import org.onap.ccsdk.sli.core.sli.provider.base.UpdateNodeExecutor;
import org.onap.ccsdk.sli.core.sli.provider.base.WhileNodeExecutor;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
-import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
+import org.opendaylight.mdsal.binding.api.NotificationPublishService;
+import org.opendaylight.mdsal.binding.api.RpcProviderService;
+import org.opendaylight.mdsal.dom.api.DOMDataBroker;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ExecuteGraphInput;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ExecuteGraphInputBuilder;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.HealthcheckInput;
@@ -58,6 +72,7 @@ import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.SLI
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.VlbcheckInput;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.execute.graph.input.SliParameter;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.execute.graph.input.SliParameterBuilder;
+import org.opendaylight.yangtools.concepts.ObjectRegistration;
/**
* @author dt5972
@@ -99,12 +114,12 @@ public class TestSliapiProvider {
*/
@Before
public void setUp() throws Exception {
- DataBroker dataBroker = mock(DataBroker.class);
+ DOMDataBroker dataBroker = mock(DOMDataBroker.class);
NotificationPublishService notifyService = mock(NotificationPublishService.class);
- RpcProviderRegistry rpcRegistry = mock(RpcProviderRegistry.class);
- BindingAwareBroker.RpcRegistration<SLIAPIService> rpcRegistration = (BindingAwareBroker.RpcRegistration<SLIAPIService>) mock(
- BindingAwareBroker.RpcRegistration.class);
- when(rpcRegistry.addRpcImplementation(any(Class.class), any(SLIAPIService.class))).thenReturn(rpcRegistration);
+ RpcProviderService rpcRegistry = mock(RpcProviderService.class);
+ ObjectRegistration<SLIAPIService> rpcRegistration = mock(
+ ObjectRegistration.class);
+ when(rpcRegistry.registerRpcImplementation(any(Class.class), any(SLIAPIService.class))).thenReturn(rpcRegistration);
// Load svclogic.properties and get a SvcLogicStore
InputStream propStr = TestSliapiProvider.class.getResourceAsStream("/svclogic.properties");
@@ -172,8 +187,8 @@ public class TestSliapiProvider {
pList.add(pBuilder.build());
inputBuilder.setSliParameter(pList);
provider.executeGraph(inputBuilder.build());
-
-
+
+
// Invalid test - graph does not exist
inputBuilder.setMode(ExecuteGraphInput.Mode.Sync);
inputBuilder.setModuleName("sli");
@@ -193,7 +208,7 @@ public class TestSliapiProvider {
pList.add(pBuilder.build());
inputBuilder.setSliParameter(pList);
provider.executeGraph(inputBuilder.build());
-
+
assertTrue(provider.vlbcheck(mock(VlbcheckInput.class)) instanceof Future<?>);
}