summaryrefslogtreecommitdiffstats
path: root/core/sliapi
diff options
context:
space:
mode:
Diffstat (limited to 'core/sliapi')
-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
7 files changed, 178 insertions, 142 deletions
diff --git a/core/sliapi/model/swagger/src/main/json/sliapi.json b/core/sliapi/model/swagger/src/main/json/sliapi.json
index 3848cb551..9133f3379 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":"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
+{"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
diff --git a/core/sliapi/model/swagger/src/main/yaml/sliapi.yaml b/core/sliapi/model/swagger/src/main/yaml/sliapi.yaml
index b97b1325a..15da98dfd 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: "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,\
+ 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,\
\ 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.,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,\
+ \ 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\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: "ietf-inet-types,SLI-API,ietf-yang-types API"
+ title: "SLI-API,ietf-yang-types,ietf-inet-types API"
consumes:
- "application/json"
- "application/xml"
diff --git a/core/sliapi/provider/pom.xml b/core/sliapi/provider/pom.xml
index 5bccec9b6..b9d1c9a67 100755
--- a/core/sliapi/provider/pom.xml
+++ b/core/sliapi/provider/pom.xml
@@ -17,54 +17,58 @@
<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>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>
+
+ <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>
@@ -78,17 +82,27 @@
<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 a00131efb..449fc3822 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,8 +21,6 @@
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;
@@ -30,14 +28,19 @@ 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.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.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.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;
@@ -47,13 +50,14 @@ 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.concepts.ObjectRegistration;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.common.RpcError.ErrorType;
import org.opendaylight.yangtools.yang.common.RpcResult;
@@ -74,6 +78,9 @@ 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
@@ -85,17 +92,17 @@ import org.slf4j.LoggerFactory;
* 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
@@ -105,7 +112,7 @@ import org.slf4j.LoggerFactory;
* }
* };
* }
- *
+ *
* </pre>
*/
public class SliapiProvider implements AutoCloseable, SLIAPIService {
@@ -113,14 +120,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 RpcProviderService rpcRegistry;
+ protected RpcProviderRegistry rpcRegistry;
private SvcLogicService svcLogic;
- protected ObjectRegistration<SLIAPIService> rpcRegistration;
+ protected BindingAwareBroker.RpcRegistration<SLIAPIService> rpcRegistration;
private static String SLIAPI_NAMESPACE = "org:onap:ccsdk:sli:core:sliapi";
private static String SLIAPI_REVISION = "2016-11-10";
@@ -141,26 +148,25 @@ public class SliapiProvider implements AutoCloseable, SLIAPIService {
RESULTS_QNAME = QName.create(TEST_RESULT_QNAME, "results");
}
- public SliapiProvider(DOMDataBroker dataBroker, NotificationPublishService notificationPublishService,
- RpcProviderService rpcProviderRegistry) {
+ public SliapiProvider(DataBroker dataBroker, NotificationPublishService notificationPublishService,
+ RpcProviderRegistry rpcProviderRegistry) {
this(dataBroker, notificationPublishService, rpcProviderRegistry, findSvcLogicService());
}
- public SliapiProvider(DOMDataBroker dataBroker, NotificationPublishService notificationPublishService,
- RpcProviderService rpcProviderRegistry, SvcLogicService svcLogic) {
+ public SliapiProvider(DataBroker dataBroker, NotificationPublishService notificationPublishService,
+ RpcProviderRegistry 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.registerRpcImplementation(SLIAPIService.class, this);
+ rpcRegistration = rpcRegistry.addRpcImplementation(SLIAPIService.class, this);
sdncStatusFile = System.getenv(SDNC_STATUS_FILE);
LOG.info("SDNC STATUS FILE = " + sdncStatusFile);
@@ -180,9 +186,11 @@ public class SliapiProvider implements AutoCloseable, SLIAPIService {
LOG.info("Successfully closed provider for " + appName);
}
- public void setDataBroker(DOMDataBroker dataBroker) {
- domDataBroker = dataBroker;
-
+ public void setDataBroker(DataBroker dataBroker) {
+ this.dataBroker = dataBroker;
+ if (dataBroker instanceof AbstractForwardedDataBroker) {
+ domDataBroker = ((AbstractForwardedDataBroker) dataBroker).getDelegate();
+ }
if (LOG.isDebugEnabled()) {
LOG.debug("DataBroker set to " + (dataBroker == null ? "null" : NON_NULL) + ".");
}
@@ -195,7 +203,7 @@ public class SliapiProvider implements AutoCloseable, SLIAPIService {
}
}
- public void setRpcRegistry(RpcProviderService rpcRegistry) {
+ public void setRpcRegistry(RpcProviderRegistry rpcRegistry) {
this.rpcRegistry = rpcRegistry;
if (LOG.isDebugEnabled()) {
LOG.debug("RpcRegistry set to " + (rpcRegistry == null ? "null" : NON_NULL) + ".");
@@ -254,7 +262,7 @@ public class SliapiProvider implements AutoCloseable, SLIAPIService {
Properties parms = new Properties();
// Pass properties using names from sli-parameters
- for (SliParameter sliParm : input.getSliParameter().values()) {
+ for (SliParameter sliParm : input.getSliParameter()) {
String propValue = "";
@@ -446,8 +454,7 @@ public class SliapiProvider implements AutoCloseable, SLIAPIService {
return (Futures.immediateFuture(rpcResult));
}
- @Override
- public ListenableFuture<RpcResult<VlbcheckOutput>> vlbcheck(VlbcheckInput vlbInput) {
+ public ListenableFuture<RpcResult<VlbcheckOutput>> vlbcheck(VlbcheckInput vlbInput) {
RpcResult<VlbcheckOutput> rpcResult = null;
SvcLogicService svcLogic = getSvcLogicService();
@@ -571,12 +578,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(NodeIdentifierWithPredicates.of(TEST_RESULT_QNAME, resultNode.getIdentifier().asMap()));
+ .node(new NodeIdentifierWithPredicates(TEST_RESULT_QNAME, resultNode.getIdentifier().getKeyValues()));
int tries = 2;
while (true) {
try {
- DOMDataTreeWriteTransaction wtx = domDataBroker.newWriteOnlyTransaction();
+ DOMDataWriteTransaction wtx = domDataBroker.newWriteOnlyTransaction();
if (merge) {
LOG.info("Merging test identifier " + entry.getTestIdentifier());
wtx.merge(storeType, testResultPid, resultNode);
@@ -584,10 +591,10 @@ public class SliapiProvider implements AutoCloseable, SLIAPIService {
LOG.info("Putting test identifier " + entry.getTestIdentifier());
wtx.put(storeType, testResultPid, resultNode);
}
- wtx.commit().get();
+ wtx.submit().checkedGet();
LOG.trace("Update DataStore succeeded");
break;
- } catch (final InterruptedException | ExecutionException e) {
+ } catch (final TransactionCommitFailedException e) {
if (e instanceof OptimisticLockFailedException) {
if (--tries <= 0) {
LOG.trace("Got OptimisticLockFailedException on last try - failing ");
@@ -603,40 +610,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) {
@@ -657,8 +664,7 @@ 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(NodeIdentifierWithPredicates.of(TEST_RESULT_QNAME, TEST_ID_QNAME,
+ .withNodeIdentifier(new NodeIdentifierWithPredicates(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
new file mode 100644
index 000000000..875027e63
--- /dev/null
+++ b/core/sliapi/provider/src/main/resources/OSGI-INF/blueprint/sliapi-blueprint.xml
@@ -0,0 +1,28 @@
+<?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 8ec666d53..875027e63 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,13 +8,16 @@
<reference id="dataBroker"
- interface="org.opendaylight.mdsal.dom.api.DOMDataBroker" />
+ interface="org.opendaylight.controller.md.sal.binding.api.DataBroker"
+ odl:type="default" />
<reference id="notificationService"
- interface="org.opendaylight.mdsal.binding.api.NotificationPublishService" />
+ interface="org.opendaylight.controller.md.sal.binding.api.NotificationPublishService"
+ odl:type="default" />
<reference id="rpcRegistry"
- interface="org.opendaylight.mdsal.binding.api.RpcProviderService" />
+ 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" />
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 b731423c5..f48cf783b 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,30 +1,15 @@
-/*-
- * ============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.ArgumentMatchers.any;
+import static org.mockito.Matchers.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;
@@ -62,9 +47,10 @@ 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.mdsal.binding.api.NotificationPublishService;
-import org.opendaylight.mdsal.binding.api.RpcProviderService;
-import org.opendaylight.mdsal.dom.api.DOMDataBroker;
+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.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;
@@ -72,7 +58,6 @@ 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
@@ -114,12 +99,12 @@ public class TestSliapiProvider {
*/
@Before
public void setUp() throws Exception {
- DOMDataBroker dataBroker = mock(DOMDataBroker.class);
+ DataBroker dataBroker = mock(DataBroker.class);
NotificationPublishService notifyService = mock(NotificationPublishService.class);
- RpcProviderService rpcRegistry = mock(RpcProviderService.class);
- ObjectRegistration<SLIAPIService> rpcRegistration = mock(
- ObjectRegistration.class);
- when(rpcRegistry.registerRpcImplementation(any(Class.class), any(SLIAPIService.class))).thenReturn(rpcRegistration);
+ 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);
// Load svclogic.properties and get a SvcLogicStore
InputStream propStr = TestSliapiProvider.class.getResourceAsStream("/svclogic.properties");
@@ -187,8 +172,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");
@@ -208,7 +193,7 @@ public class TestSliapiProvider {
pList.add(pBuilder.build());
inputBuilder.setSliParameter(pList);
provider.executeGraph(inputBuilder.build());
-
+
assertTrue(provider.vlbcheck(mock(VlbcheckInput.class)) instanceof Future<?>);
}