diff options
32 files changed, 753 insertions, 1447 deletions
diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 000000000..3797dc8bb --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,20 @@ +--- +# .readthedocs.yml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details +# Required +version: 2 + +formats: + - htmlzip + +build: + image: latest + +python: + version: 3.7 + install: + - requirements: docs/requirements-docs.txt + +sphinx: + configuration: docs/conf.py diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 000000000..43ca5b671 --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1,3 @@ +/.tox +/_build/* +/__pycache__/* diff --git a/docs/_static/css/ribbon.css b/docs/_static/css/ribbon.css new file mode 100644 index 000000000..6008cb1a0 --- /dev/null +++ b/docs/_static/css/ribbon.css @@ -0,0 +1,63 @@ +.ribbon { + z-index: 1000; + background-color: #a00; + overflow: hidden; + white-space: nowrap; + position: fixed; + top: 25px; + right: -50px; + -webkit-transform: rotate(45deg); + -moz-transform: rotate(45deg); + -ms-transform: rotate(45deg); + -o-transform: rotate(45deg); + transform: rotate(45deg); + -webkit-box-shadow: 0 0 10px #888; + -moz-box-shadow: 0 0 10px #888; + box-shadow: 0 0 10px #888; + +} + +.ribbon a { + border: 1px solid #faa; + color: #fff; + display: block; + font: bold 81.25% 'Helvetica Neue', Helvetica, Arial, sans-serif; + margin: 1px 0; + padding: 10px 50px; + text-align: center; + text-decoration: none; + text-shadow: 0 0 5px #444; + transition: 0.5s; +} + +.ribbon a:hover { + background: #c11; + color: #fff; +} + + +/* override table width restrictions */ +@media screen and (min-width: 767px) { + + .wy-table-responsive table td, .wy-table-responsive table th { + /* !important prevents the common CSS stylesheets from overriding + this as on RTD they are loaded after this stylesheet */ + white-space: normal !important; + } + + .wy-table-responsive { + overflow: visible !important; + } +} + +@media screen and (max-width: 767px) { + .wy-table-responsive table td { + white-space: nowrap; + } +} + +/* fix width of the screen */ + +.wy-nav-content { + max-width: none; +} diff --git a/docs/_static/favicon.ico b/docs/_static/favicon.ico Binary files differnew file mode 100755 index 000000000..cb712ebd2 --- /dev/null +++ b/docs/_static/favicon.ico diff --git a/docs/_static/logo_onap_2017.png b/docs/_static/logo_onap_2017.png Binary files differnew file mode 100644 index 000000000..5d064f431 --- /dev/null +++ b/docs/_static/logo_onap_2017.png diff --git a/docs/conf.py b/docs/conf.py index 5cab846ce..8f40e8b81 100755..100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,496 +1,15 @@ -# -*- coding: utf-8 -*- -# -# ONAP documentation build configuration file, created by -# sphinx-quickstart on Wed Jul 19 16:25:31 2017. -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. +from docs_conf.conf import * -import sys -import os -import shlex -#import sphinx_bootstrap_theme - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -#sys.path.insert(0, os.path.abspath('.')) - -# -- General configuration ------------------------------------------------ - -# If your documentation needs a minimal Sphinx version, state it here. -needs_sphinx = '1.5.3' - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - 'sphinx.ext.autodoc', - 'sphinx.ext.doctest', - 'sphinx.ext.graphviz', - 'sphinx.ext.todo', - 'sphinx.ext.imgmath', - 'sphinx.ext.viewcode', - 'sphinxcontrib.blockdiag', - 'sphinxcontrib.needs', - 'sphinxcontrib.nwdiag', - 'sphinxcontrib.seqdiag', - 'sphinx.ext.ifconfig', - 'sphinx.ext.todo', - 'sphinxcontrib.plantuml', - 'sphinxcontrib.swaggerdoc' -] - -# Font path for seqdiag -seqdiag_fontpath = '/usr/share/fonts/truetype/dejavu/DejaVuSansCondensed.ttf' -nwdiag_fontpath = '/usr/share/fonts/truetype/dejavu/DejaVuSansCondensed.ttf' - -# Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] - -# The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -# source_suffix = ['.rst', '.md'] -source_suffix = '.rst' - -# The encoding of source files. -#source_encoding = 'utf-8-sig' - -# The master toctree document. +branch = 'latest' master_doc = 'index' -# General information about the project. -project = u'' -copyright = u'2019 ONAP. Licensed under Creative Commons Attribution 4.0 International License' - - -author = u'Open Network Automation Platform' - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# The short X.Y version. -version = 'master branch' -# The full version, including alpha/beta/rc tags. -release = 'master branch' - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -#today = '' -# Else, today_fmt is used as the format for a strftime call. -#today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = [ - '_build' - ] - -# The reST default role (used for this markup: `text`) to use for all -# documents. -#default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -#add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -#add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -#show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' - -# A list of ignored prefixes for module index sorting. -#modindex_common_prefix = [] - -# If true, keep warnings as "system message" paragraphs in the built documents. -#keep_warnings = False - -# If true, `todo` and `todoList` produce output, else they produce nothing. -todo_include_todos = True - - -# -- Options for HTML output ---------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -#html_theme = 'classic' -html_theme = 'sphinx_rtd_theme' - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -html_theme_options = { - 'style_nav_header_background': 'white', - 'sticky_navigation': False - } - -# Add any paths that contain custom themes here, relative to this directory. -#html_theme_path = sphinx_bootstrap_theme.get_html_theme_path() - -# The name for this set of Sphinx documents. If None, it defaults to -# "<project> v<release> documentation". -#html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -#html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -html_logo = '_static/logo_onap_2017.png' - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -html_favicon = '_static/favicon.ico' - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] - -# Add any extra paths that contain custom files (such as robots.txt or -# .htaccess) here, relative to this directory. These files are copied -# directly to the root of the documentation. -#html_extra_path = [] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -html_last_updated_fmt = '%d-%b-%y %H:%M' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -#html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -#html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -#html_additional_pages = {} - -# If false, no module index is generated. -#html_domain_indices = True - -# If false, no index is generated. -#html_use_index = True - -# If true, the index is split into individual pages for each letter. -#html_split_index = False - -# If true, links to the reST sources are added to the pages. -#html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -html_show_sphinx = False - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -#html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a <link> tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -#html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -#html_file_suffix = None - -# Language to be used for generating the HTML full-text search index. -# Sphinx supports the following languages: -# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' -# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' -#html_search_language = 'en' - -# A dictionary with options for the search language support, empty by default. -# Now only 'ja' uses this config value -#html_search_options = {'type': 'default'} - -# The name of a javascript file (relative to the configuration directory) that -# implements a search results scorer. If empty, the default will be used. -#html_search_scorer = 'scorer.js' - -# Output file base name for HTML help builder. -htmlhelp_basename = 'ONAPdoc' - -# -- Options for LaTeX output --------------------------------------------- - -latex_elements = { -# The paper size ('letterpaper' or 'a4paper'). -#'papersize': 'letterpaper', - -# The font size ('10pt', '11pt' or '12pt'). -#'pointsize': '10pt', - -# Additional stuff for the LaTeX preamble. -#'preamble': '', - -# Latex figure (float) alignment -#'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - (master_doc, 'ONAP.tex', u'ONAP Documentation', - u'ONAP Contributors', 'manual'), -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -#latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -#latex_use_parts = False - -# If true, show page references after internal links. -#latex_show_pagerefs = False - -# If true, show URL addresses after external links. -#latex_show_urls = False - -# Documents to append as an appendix to all manuals. -#latex_appendices = [] - -# If false, no module index is generated. -#latex_domain_indices = True - - -# -- Options for manual page output --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - (master_doc, 'onap', u'ONAP Documentation', - [author], 1) -] - -# If true, show URL addresses after external links. -#man_show_urls = False - - -# -- Options for Texinfo output ------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - (master_doc, 'ONAP', u'ONAP Documentation', - author, 'ONAP', 'Open Network Automation Platform', - 'Platform'), -] - -# Documents to append as an appendix to all manuals. -#texinfo_appendices = [] - -# If false, no module index is generated. -#texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -#texinfo_show_urls = 'footnote' - -# If true, do not generate a @detailmenu in the "Top" node's menu. -#texinfo_no_detailmenu = False - - -# -- Options for Epub output ---------------------------------------------- - -# Bibliographic Dublin Core info. -epub_title = project -epub_author = author -epub_publisher = author -epub_copyright = copyright - -# The basename for the epub file. It defaults to the project name. -#epub_basename = project - -# The HTML theme for the epub output. Since the default themes are not optimized -# for small screen space, using the same theme for HTML and epub output is -# usually not wise. This defaults to 'epub', a theme designed to save visual -# space. -#epub_theme = 'epub' - -# The language of the text. It defaults to the language option -# or 'en' if the language is not set. -#epub_language = '' - -# The scheme of the identifier. Typical schemes are ISBN or URL. -#epub_scheme = '' - -# The unique identifier of the text. This can be a ISBN number -# or the project homepage. -#epub_identifier = '' - -# A unique identification for the text. -#epub_uid = '' - -# A tuple containing the cover image and cover page html template filenames. -#epub_cover = () - -# A sequence of (type, uri, title) tuples for the guide element of content.opf. -#epub_guide = () - -# HTML files that should be inserted before the pages created by sphinx. -# The format is a list of tuples containing the path and title. -#epub_pre_files = [] - -# HTML files shat should be inserted after the pages created by sphinx. -# The format is a list of tuples containing the path and title. -#epub_post_files = [] - -# A list of files that should not be packed into the epub file. -epub_exclude_files = ['search.html'] - -# The depth of the table of contents in toc.ncx. -#epub_tocdepth = 3 - -# Allow duplicate toc entries. -#epub_tocdup = True - -# Choose between 'default' and 'includehidden'. -#epub_tocscope = 'default' - -# Fix unsupported image types using the Pillow. -#epub_fix_images = False - -# Scale large images. -#epub_max_image_width = 0 - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -#epub_show_urls = 'inline' - -# If false, no index is generated. -#epub_use_index = True - -# Patterns to ignore in linkcheck builder linkcheck_ignore = [ - r'http://$', - r'http:/$', - r'http://10\.', - r'http://127\.', - r'http://172\.[123]', - r'http://app_host:port/', - r'http://app-host:port/', - r'http://ESR_SERVICE_IP', - r'http://ESR_SERVER_IP', - r'http://hostIP:\d+/', - r'http://load-balanced-address:\d+/', - r'http://localhost', - r'http://\$msb_address/', - r'http://\$MSB_SERVER_IP:\d+/', - r'http://msb_docker_host_ip:\d+/', - r'http://MSB_IP:MSB_PORT/', - r'http://msb.onap.org', - r'http://MSB_SERVER_IP:\d+/', - r'http://org.openecomp.', - r'http://{PDP_URL}:\d+/', - r'http://servername.domain.com', - r'http://.*simpledemo.openecomp.org', - r'http://.*simpledemo.onap.org', - r'http://.*test.att.com:\d+/', - r'http://we-are-data-router.us', - r'http://we-are-message-router.us:\d+/' - r'http://www.\[host\]:\[port\]/', - r'http://yourhostname', - r'https://$', - r'https:/$', - r'https://10\.', - r'https://127\.', - r'https://172\.[123]', - r'https://aaf.onap.org', - r'https://\$CBAM_IP', - r'https://ESR_SERVICE_IP', - r'https://ESR_SERVER_IP', - r'https://msb.onap.org', - r'https://my-subscriber-app.dcae', - r'https://\$CBAM_IP:\d+/', - r'https://load-balanced-address:\d+/', - r'https://prov.datarouternew.com:8443', - r'https://.*simpledemo.openecomp.org', - r'https://.*simpledemo.onap.org', - r'https://.*test.att.com:\d+/', - r'https://we-are-data-router.us', - r'https://we-are-message-router.us:\d+/' - ] - -from docutils.parsers.rst import directives - -needs_extra_options = { - "target": directives.unchanged, - "keyword": directives.unchanged, - "introduced": directives.unchanged, - "updated": directives.unchanged, - "impacts": directives.unchanged, - "validation_mode": directives.unchanged, - "validated_by": directives.unchanged, - "test": directives.unchanged, - "test_case": directives.unchanged, - "test_file": directives.unchanged, - "notes": directives.unchanged, -} - -needs_id_regex = "^[A-Z0-9]+-[A-Z0-9]+" -needs_id_required = True -needs_title_optional = True - -needs_template_collapse = """ -.. _{{id}}: - -{% if hide == false -%} -.. role:: needs_tag -.. role:: needs_status -.. role:: needs_type -.. role:: needs_id -.. role:: needs_title - -.. rst-class:: need -.. rst-class:: need_{{type_name}} - -.. container:: need - - `{{id}}` - {{content|indent(4)}} - - .. container:: toggle - - .. container:: header + 'http://localhost', +] - Details +intersphinx_mapping = {} -{% if status and status|upper != "NONE" and not hide_status %} | status: :needs_status:`{{status}}`{% endif %} -{% if tags and not hide_tags %} | tags: :needs_tag:`{{tags|join("` :needs_tag:`")}}`{% endif %} -{% if keyword %} | keyword: `{{keyword}}` {% endif %} -{% if target %} | target: `{{target}}` {% endif %} -{% if introduced %} | introduced: `{{introduced}}` {% endif %} -{% if updated %} | updated: `{{updated}}` {% endif %} -{% if impacts %} | impacts: `{{impacts}}` {% endif %} -{% if validation_mode %} | validation mode: `{{validation_mode}}` {% endif %} -{% if validated_by %} | validated by: `{{validated_by}}` {% endif %} -{% if test %} | test: `{{test}}` {% endif %} -{% if test_case %} | test case: {{test_case}} {% endif %} -{% if test_file %} | test file: `{{test_file}}` {% endif %} -{% if notes %} | notes: `{{notes}}` {% endif %} - | children: :need_incoming:`{{id}}` - | parents: :need_outgoing:`{{id}}` -{% endif -%} -""" +html_last_updated_fmt = '%d-%b-%y %H:%M' def setup(app): - app.add_stylesheet("css/ribbon.css") + app.add_stylesheet("css/ribbon_onap.css") diff --git a/docs/conf.yaml b/docs/conf.yaml new file mode 100644 index 000000000..ab5928131 --- /dev/null +++ b/docs/conf.yaml @@ -0,0 +1,7 @@ +--- +project_cfg: onap +project: onap + +# Change this to ReleaseBranchName to modify the header +default-version: latest +# diff --git a/docs/requirements-docs.txt b/docs/requirements-docs.txt new file mode 100644 index 000000000..b3188ddd3 --- /dev/null +++ b/docs/requirements-docs.txt @@ -0,0 +1,15 @@ +tox +Sphinx +doc8 +docutils +setuptools +six +sphinx_rtd_theme>=0.4.3 +sphinxcontrib-blockdiag +sphinxcontrib-needs>=0.2.3 +sphinxcontrib-nwdiag +sphinxcontrib-seqdiag +sphinxcontrib-swaggerdoc +sphinxcontrib-plantuml +sphinx_bootstrap_theme +lfdocs-conf diff --git a/docs/tox.ini b/docs/tox.ini new file mode 100644 index 000000000..edac8c35f --- /dev/null +++ b/docs/tox.ini @@ -0,0 +1,22 @@ +[tox] +minversion = 1.6 +envlist = docs, +skipsdist = true + +[testenv:docs] +basepython = python3 +deps = -r{toxinidir}/requirements-docs.txt +commands = + sphinx-build -b html -n -d {envtmpdir}/doctrees ./ {toxinidir}/_build/html + echo "Generated docs available in {toxinidir}/_build/html" +whitelist_externals = + echo + git + sh + +[testenv:docs-linkcheck] +basepython = python3 +#deps = -r{toxinidir}/requirements-docs.txt +commands = echo "Link Checking not enforced" +#commands = sphinx-build -b linkcheck -d {envtmpdir}/doctrees ./ {toxinidir}/_build/linkcheck +whitelist_externals = echo diff --git a/sdnr/wt/devicemanager-gran/provider/pom.xml b/sdnr/wt/devicemanager-gran/provider/pom.xml index b8ef8637f..6cd317f01 100644 --- a/sdnr/wt/devicemanager-gran/provider/pom.xml +++ b/sdnr/wt/devicemanager-gran/provider/pom.xml @@ -131,29 +131,6 @@ </excludes> </configuration> </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>exec-maven-plugin</artifactId> - <executions> - <execution> - <id>generateDTOs</id> - <phase>generate-sources</phase> - <goals> - <goal>exec</goal> - </goals> - <configuration> - <executable>bash</executable> - <arguments> - <argument>${basedir}/../../data-provider/provider/src/main/resources/es-init.sh - </argument> - <argument>initfile</argument> - <argument>-f</argument> - <argument>${project.build.directory}/EsInit.script</argument> - </arguments> - </configuration> - </execution> - </executions> - </plugin> </plugins> </build> </project> diff --git a/sdnr/wt/devicemanager-gran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/GRanNetworkElement.java b/sdnr/wt/devicemanager-gran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/GRanNetworkElement.java index d4932b93e..0f7266061 100644 --- a/sdnr/wt/devicemanager-gran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/GRanNetworkElement.java +++ b/sdnr/wt/devicemanager-gran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/GRanNetworkElement.java @@ -52,10 +52,12 @@ public class GRanNetworkElement implements NetworkElement { @Override public void deregister() { + log.info("deRegister actions should be here"); } @Override public void warmstart() { + log.info("Warmstart actions should be here"); } @Override diff --git a/sdnr/wt/devicemanager-gran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/impl/DeviceManagerGRanImpl.java b/sdnr/wt/devicemanager-gran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/impl/DeviceManagerGRanImpl.java index d85515bb4..961a9b7ff 100644 --- a/sdnr/wt/devicemanager-gran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/impl/DeviceManagerGRanImpl.java +++ b/sdnr/wt/devicemanager-gran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/impl/DeviceManagerGRanImpl.java @@ -17,7 +17,6 @@ ******************************************************************************/ package org.onap.ccsdk.features.sdnr.wt.devicemanager.gran.impl; -import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider; import org.onap.ccsdk.features.sdnr.wt.devicemanager.gran.GRanNetworkElementFactory; import org.onap.ccsdk.features.sdnr.wt.devicemanager.ne.factory.FactoryRegistration; import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.NetconfNetworkElementService; @@ -28,12 +27,10 @@ public class DeviceManagerGRanImpl implements AutoCloseable { private static final Logger LOG = LoggerFactory.getLogger(DeviceManagerGRanImpl.class); private static final String APPLICATION_NAME = "DeviceManagerGRan"; - private static final String CONFIGURATIONFILE = "etc/devicemanager-gran.properties"; - + private NetconfNetworkElementService netconfNetworkElementService; private Boolean devicemanagerInitializationOk; - private DataProvider dataProvider; private FactoryRegistration<GRanNetworkElementFactory> factoryRegistration; // Blueprint 1 @@ -43,7 +40,7 @@ public class DeviceManagerGRanImpl implements AutoCloseable { netconfNetworkElementService = null; factoryRegistration = null; - dataProvider = null; + } public void setNetconfNetworkElementService(NetconfNetworkElementService netconfNetworkElementService) { this.netconfNetworkElementService = netconfNetworkElementService; @@ -54,8 +51,6 @@ public class DeviceManagerGRanImpl implements AutoCloseable { LOG.info("Session Initiated start {}", APPLICATION_NAME); // Intialization factoryRegistration = netconfNetworkElementService.registerNetworkElementFactory(new GRanNetworkElementFactory()); - dataProvider = netconfNetworkElementService.getServiceProvider().getDataProvider(); - netconfNetworkElementService.writeToEventLog(APPLICATION_NAME, "startup", "done"); this.devicemanagerInitializationOk = true; diff --git a/sdnr/wt/devicemanager-gran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/test/TestDeviceManagerGRanImpl.java b/sdnr/wt/devicemanager-gran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/test/TestDeviceManagerGRanImpl.java index bf0a098d8..c008986e0 100644 --- a/sdnr/wt/devicemanager-gran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/test/TestDeviceManagerGRanImpl.java +++ b/sdnr/wt/devicemanager-gran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/test/TestDeviceManagerGRanImpl.java @@ -17,24 +17,14 @@ ******************************************************************************/ package org.onap.ccsdk.features.sdnr.wt.devicemanager.gran.test; -import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -import org.eclipse.jdt.annotation.NonNull; import org.junit.Test; -import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider; import org.onap.ccsdk.features.sdnr.wt.devicemanager.gran.GRanNetworkElementFactory; import org.onap.ccsdk.features.sdnr.wt.devicemanager.gran.impl.DeviceManagerGRanImpl; -import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.AaiService; import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider; -import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.EquipmentService; -import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.EventHandlingService; -import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.FaultService; -import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.MaintenanceService; import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.NetconfNetworkElementService; -import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.NotificationService; -import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.PerformanceManager; public class TestDeviceManagerGRanImpl { GRanNetworkElementFactory factory = new GRanNetworkElementFactory(); diff --git a/sdnr/wt/devicemanager-gran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/test/TestGRanNetworkElement.java b/sdnr/wt/devicemanager-gran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/test/TestGRanNetworkElement.java index 1b381ee00..ac232a008 100644 --- a/sdnr/wt/devicemanager-gran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/test/TestGRanNetworkElement.java +++ b/sdnr/wt/devicemanager-gran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/test/TestGRanNetworkElement.java @@ -39,9 +39,9 @@ public class TestGRanNetworkElement { when(netconfAccessor.getNodeId()).thenReturn(new NodeId(NODEID)); GRanNetworkElement gRanNe = new GRanNetworkElement(netconfAccessor, databaseService); - assertEquals(gRanNe.getDeviceType().getIntValue(), 3); - assertEquals(gRanNe.getDeviceType().getName(), "RAN3GPP"); - assertEquals(gRanNe.getNodeId().getValue(), NODEID); + assertEquals(3, gRanNe.getDeviceType().getIntValue()); + assertEquals("RAN3GPP", gRanNe.getDeviceType().getName()); + assertEquals(NODEID, gRanNe.getNodeId().getValue()); gRanNe.register(); gRanNe.deregister(); diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/ExtendedEquipment.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/ExtendedEquipment.java index 18e3c0b10..4993b5e4a 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/ExtendedEquipment.java +++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/ExtendedEquipment.java @@ -82,13 +82,13 @@ public class ExtendedEquipment { // General inventoryBuilder.setNodeId(getNodeId()); inventoryBuilder.setParentUuid(getParentUuid()); - inventoryBuilder.setTreeLevel(new Long(getTreeLevel())); + inventoryBuilder.setTreeLevel(Long.valueOf(getTreeLevel())); - if (equipment != null) { - inventoryBuilder.setUuid(equipment.getUuid().getValue()); + if (getEquipment() != null) { + inventoryBuilder.setUuid(getEquipment().getUuid().getValue()); // -- String list with ids of holders List<String> containerHolderKeyList = new ArrayList<>(); - List<ContainedHolder> containerHolderList = equipment.getContainedHolder(); + List<ContainedHolder> containerHolderList = getEquipment().getContainedHolder(); if (containerHolderList != null) { for (ContainedHolder containerHolder : containerHolderList) { containerHolderKeyList.add(containerHolder.getUuid().getValue()); @@ -97,7 +97,7 @@ public class ExtendedEquipment { inventoryBuilder.setContainedHolder(containerHolderKeyList); // -- Manufacturer related things - ManufacturedThing mThing = equipment.getManufacturedThing(); + ManufacturedThing mThing = getEquipment().getManufacturedThing(); if (mThing != null) { ManufacturerProperties mProperties = mThing.getManufacturerProperties(); if (mProperties != null) { @@ -117,7 +117,7 @@ public class ExtendedEquipment { String manufacturedDateString = mInstance.getManufactureDate(); if (manufacturedDateString != null && !manufacturedDateString.isEmpty()) { try { - inventoryBuilder.setDate(mInstance.getManufactureDate()); + inventoryBuilder.setDate(manufacturedDateString); } catch (IllegalArgumentException e) { LOG.debug("Format problem", e); } diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/ONFCoreNetworkElement12Equipment.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/ONFCoreNetworkElement12Equipment.java index b2d4404c8..c67efe3df 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/ONFCoreNetworkElement12Equipment.java +++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/ONFCoreNetworkElement12Equipment.java @@ -63,11 +63,11 @@ public class ONFCoreNetworkElement12Equipment { private final @NonNull List<ExtendedEquipment> globalEquipmentList; public ONFCoreNetworkElement12Equipment(NetconfAccessor acessor, NetworkElementCoreData coreData, Capabilities capabilities) { - LOG.debug("Initialize " + ONFCoreNetworkElement12Equipment.class.getName()); + LOG.debug("Initialize class: {} " + ONFCoreNetworkElement12Equipment.class.getName()); this.acessor = acessor; this.coreData = coreData; if (capabilities.isSupportingNamespaceAndRevision(WrapperEquipmentPacRev170402.QNAME)) { - this.equipmentPac = new WrapperEquipmentPacRev170402(acessor, coreData); + this.equipmentPac = new WrapperEquipmentPacRev170402(acessor); LOG.debug("Equipement pac supported {}", WrapperEquipmentPacRev170402.QNAME); } else { this.equipmentPac = null; @@ -264,10 +264,9 @@ public class ONFCoreNetworkElement12Equipment { InstanceIdentifier<Equipment> equipmentIID = InstanceIdentifier.builder(Equipment.class, new EquipmentKey(interfacePacUuid)).build(); - Equipment res = getGenericTransactionUtils().readData(coreData.getDataBroker(), LogicalDatastoreType.OPERATIONAL, + return getGenericTransactionUtils().readData(coreData.getDataBroker(), LogicalDatastoreType.OPERATIONAL, equipmentIID); - return res; } /** @@ -285,10 +284,9 @@ public class ONFCoreNetworkElement12Equipment { InstanceIdentifier<Equipment> equipmentIID = InstanceIdentifier.builder(Equipment.class).build(); - Equipment res = getGenericTransactionUtils().readData(coreData.getDataBroker(), LogicalDatastoreType.OPERATIONAL, + return getGenericTransactionUtils().readData(coreData.getDataBroker(), LogicalDatastoreType.OPERATIONAL, equipmentIID); - return res; } /** diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/WrapperEquipmentPacRev170402.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/WrapperEquipmentPacRev170402.java index 6da673766..229f88cfa 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/WrapperEquipmentPacRev170402.java +++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/WrapperEquipmentPacRev170402.java @@ -45,7 +45,7 @@ public class WrapperEquipmentPacRev170402 implements OnfInterfacePac { private final NetconfAccessor acessor; - public WrapperEquipmentPacRev170402(NetconfAccessor acessor, NetworkElementCoreData coreData) { + public WrapperEquipmentPacRev170402(NetconfAccessor acessor) { this.acessor = acessor; } @@ -67,9 +67,7 @@ public class WrapperEquipmentPacRev170402 implements OnfInterfacePac { final Class<EquipmentPac> clazzPac = EquipmentPac.class; final Class<EquipmentPacKey> clazzPacKey = EquipmentPacKey.class; final Class<EquipmentCurrentProblems> clazzProblems = EquipmentCurrentProblems.class; - // final Class<ContainerCurrentProblemTypeG> clazzProblem = - // ContainerCurrentProblemTypeG.class; - + LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(), acessor.getNodeId(), interfacePacUuid.getValue()); @@ -83,7 +81,7 @@ public class WrapperEquipmentPacRev170402 implements OnfInterfacePac { EquipmentCurrentProblems problems = getGenericTransactionUtils().readData(acessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL, interfaceIID); if (problems == null) { - LOG.debug("DBRead Id {} no {}", interfacePacUuid, clazzProblems, clazzProblems.getName()); + LOG.debug("DBRead Id {} no {} name {}", interfacePacUuid, clazzProblems, clazzProblems.getName()); } else { // -- Specific part 3 for (CurrentProblemTypeG problem : problems.nonnullCurrentProblemList()) { diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/Helper.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/Helper.java index fc321a5e1..d200530fc 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/Helper.java +++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/Helper.java @@ -29,10 +29,10 @@ import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.g._874._1.model.r */ public class Helper { - private static @NonNull UniversalId DEFAULT_UniversalId = new UniversalId("Default"); - private static @NonNull LayerProtocolName DEFAULT_LayerProtocolName = new LayerProtocolName("default"); - private static @NonNull GranularityPeriodType DEFAULT_GranularityPeriodType = GranularityPeriodType.Unknown; - private static @NonNull String DEFAULT_String = ""; + private static final @NonNull UniversalId DEFAULT_UniversalId = new UniversalId("Default"); + private static final @NonNull LayerProtocolName DEFAULT_LayerProtocolName = new LayerProtocolName("default"); + private static final @NonNull GranularityPeriodType DEFAULT_GranularityPeriodType = GranularityPeriodType.Unknown; + private static final @NonNull String DEFAULT_String = ""; public static @NonNull UniversalId nnGetUniversalId(@Nullable UniversalId x) { return x == null ? DEFAULT_UniversalId : x; diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev170324.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev170324.java index 79124969c..08783ecef 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev170324.java +++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev170324.java @@ -86,7 +86,6 @@ public class WrapperMicrowaveModelRev170324 implements OnfMicrowaveModel, Microw public static final QName QNAME = MwAirInterfacePac.QNAME; - //private NetworkElementCoreData coreData; private final NotificationService microwaveModelListener; private final NetconfAccessor acessor; private final TransactionUtils genericTransactionUtils; @@ -129,19 +128,19 @@ public class WrapperMicrowaveModelRev170324 implements OnfMicrowaveModel, Microw FaultData resultList) { switch (lpName) { - case MWAirInterface: + case MWAIRINTERFACE: readTheFaultsOfMwAirInterfacePac(uuid, resultList); break; - case EthernetContainer12: + case ETHERNETCONTAINER12: readTheFaultsOfMwEthernetContainerPac(uuid, resultList); break; - case TDMContainer: + case TDMCONTAINER: readTheFaultsOfMwTdmContainerPac(uuid, resultList); break; - case Structure: + case STRUCTURE: if (lpClass == MwHybridMwStructurePac.class) { readTheFaultsOfMwHybridMwStructurePac(uuid, resultList); @@ -155,10 +154,10 @@ public class WrapperMicrowaveModelRev170324 implements OnfMicrowaveModel, Microw LOG.warn("Unassigned lp model {} class {}", lpName, lpClass); } break; - case Ethernet: + case ETHERNET: // No alarms supported break; - case EthernetContainer10: + case ETHERNETCONTAINER10: default: LOG.warn("Unassigned or not expected lp in model {}", lpName); } @@ -167,31 +166,12 @@ public class WrapperMicrowaveModelRev170324 implements OnfMicrowaveModel, Microw @Override public @NonNull PerformanceDataLtp getLtpHistoricalPerformanceData(@NonNull ONFLayerProtocolName lpName, @NonNull Lp lp) { PerformanceDataLtp res = new PerformanceDataLtp(); - res = readAirInterfacePerformanceData(lp, res); - res = readEthernetContainerPerformanceData(lp, res); + readAirInterfacePerformanceData(lp, res); + readEthernetContainerPerformanceData(lp, res); return res; } -// @Override -// public @NonNull List<? extends OtnHistoryDataG> readTheHistoricalPerformanceData(@NonNull ONFLayerProtocolName lpName, @NonNull Lp lp) { -// switch (lpName) { -// case MWAirInterface: -// return readTheHistoricalPerformanceDataOfMwAirInterfacePac(lp); -// -// case EthernetContainer12: -// return readTheHistoricalPerformanceDataOfEthernetContainer(lp); -// -// case EthernetContainer10: -// case EthernetPhysical: -// case Ethernet: -// case TDMContainer: -// case Structure: -// case Unknown: -// LOG.debug("Do not read HistoricalPM data for {} {}", lpName, getUuid(lp)); -// break; -// } -// return new ArrayList<>(); -// } + @Override public Class<?> getClassForLtpExtension(QName qName) { Class<?> res = null; @@ -266,12 +246,7 @@ public class WrapperMicrowaveModelRev170324 implements OnfMicrowaveModel, Microw private FaultData readTheFaultsOfMwAirInterfacePac(UniversalId interfacePacUuid, FaultData resultList) { final Class<MwAirInterfacePac> clazzPac = MwAirInterfacePac.class; - // final Class<MwAirInterfacePacKey> clazzPacKey = MwAirInterfacePacKey.class; - // final Class<AirInterfaceCurrentProblems> clazzProblems = - // AirInterfaceCurrentProblems.class; - // final Class<AirInterfaceCurrentProblemTypeG> clazzProblem = - // AirInterfaceCurrentProblemTypeG.class; - + String mountpointId = acessor.getNodeId().getValue(); LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(), mountpointId, interfacePacUuid.getValue()); @@ -306,13 +281,7 @@ public class WrapperMicrowaveModelRev170324 implements OnfMicrowaveModel, Microw private FaultData readTheFaultsOfMwEthernetContainerPac(UniversalId interfacePacUuid, FaultData resultList) { final Class<MwEthernetContainerPac> clazzPac = MwEthernetContainerPac.class; - // final Class<MwEthernetContainerPacKey> clazzPacKey = - // MwEthernetContainerPacKey.class; - // final Class<EthernetContainerCurrentProblems> clazzProblems = - // EthernetContainerCurrentProblems.class; - // final Class<ContainerCurrentProblemTypeG> clazzProblem = - // ContainerCurrentProblemTypeG.class; - + String mountpointId = acessor.getNodeId().getValue(); LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(), mountpointId, interfacePacUuid.getValue()); @@ -344,12 +313,8 @@ public class WrapperMicrowaveModelRev170324 implements OnfMicrowaveModel, Microw FaultData resultList) { final Class<MwAirInterfaceDiversityPac> clazzPac = MwAirInterfaceDiversityPac.class; - // final Class<MwAirInterfaceDiversityPacKey> clazzPacKey = - // MwAirInterfaceDiversityPacKey.class; final Class<AirInterfaceDiversityCurrentProblems> clazzProblems = AirInterfaceDiversityCurrentProblems.class; - // final Class<AirInterfaceDiversityCurrentProblemTypeG> clazzProblem = - // AirInterfaceDiversityCurrentProblemTypeG.class; - + String mountpointId = acessor.getNodeId().getValue(); LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(), mountpointId, interfacePacUuid.getValue()); @@ -380,12 +345,8 @@ public class WrapperMicrowaveModelRev170324 implements OnfMicrowaveModel, Microw FaultData resultList) { final Class<MwPureEthernetStructurePac> clazzPac = MwPureEthernetStructurePac.class; - // final Class<MwPureEthernetStructurePacKey> clazzPacKey = - // MwPureEthernetStructurePacKey.class; final Class<PureEthernetStructureCurrentProblems> clazzProblems = PureEthernetStructureCurrentProblems.class; - // final Class<StructureCurrentProblemTypeG> clazzProblem = - // StructureCurrentProblemTypeG.class; - + String mountpointId = acessor.getNodeId().getValue(); LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(), mountpointId, interfacePacUuid.getValue()); @@ -415,12 +376,8 @@ public class WrapperMicrowaveModelRev170324 implements OnfMicrowaveModel, Microw private FaultData readTheFaultsOfMwHybridMwStructurePac(UniversalId interfacePacUuid, FaultData resultList) { final Class<MwHybridMwStructurePac> clazzPac = MwHybridMwStructurePac.class; - // final Class<MwHybridMwStructurePacKey> clazzPacKey = - // MwHybridMwStructurePacKey.class; final Class<HybridMwStructureCurrentProblems> clazzProblems = HybridMwStructureCurrentProblems.class; - // final Class<HybridMwStructureCurrentProblemsG> clazzProblem = - // HybridMwStructureCurrentProblemsG.class; - + String mountpointId = acessor.getNodeId().getValue(); LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(), mountpointId, interfacePacUuid.getValue()); @@ -460,9 +417,7 @@ public class WrapperMicrowaveModelRev170324 implements OnfMicrowaveModel, Microw final Class<MwTdmContainerPac> clazzPac = MwTdmContainerPac.class; final Class<MwTdmContainerPacKey> clazzPacKey = MwTdmContainerPacKey.class; final Class<TdmContainerCurrentProblems> clazzProblems = TdmContainerCurrentProblems.class; - // final Class<ContainerCurrentProblemTypeG> clazzProblem = - // ContainerCurrentProblemTypeG.class; - + String mountpointId = acessor.getNodeId().getValue(); LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(), mountpointId, interfacePacUuid.getValue()); @@ -492,63 +447,7 @@ public class WrapperMicrowaveModelRev170324 implements OnfMicrowaveModel, Microw return resultList; } - /*----------------------------------------------------------------------------- - * Performance related data - */ - -// /** -// * PM MwAirInterfacePac -// * -// * @param lp -// * @return -// */ -// private @NonNull List<ExtendedAirInterfaceHistoricalPerformanceType12> readTheHistoricalPerformanceDataOfMwAirInterfacePac( -// Lp lp) { -// -// List<ExtendedAirInterfaceHistoricalPerformanceType12> resultList = new ArrayList<>(); -// LOG.debug("DBRead Get {} MWAirInterfacePac: {}", coreData.getMountpoint(), lp.getUuid()); -// // ---- -// UniversalId mwAirInterfacePacuuId = lp.getUuid(); -// // Step 2.1: construct data and the relative iid -// InstanceIdentifier<AirInterfaceConfiguration> mwAirInterfaceConfigurationIID = InstanceIdentifier -// .builder(MwAirInterfacePac.class, new MwAirInterfacePacKey(mwAirInterfacePacuuId)) -// .child(AirInterfaceConfiguration.class).build(); -// AirInterfaceConfiguration airConfiguration = genericTransactionUtils.readData(coreData.getDataBroker(), -// LogicalDatastoreType.OPERATIONAL, mwAirInterfaceConfigurationIID); -// -// if (airConfiguration == null) { -// LOG.debug("DBRead MWAirInterfacePac Id {} no AirInterfaceConfiguration", mwAirInterfacePacuuId); -// -// } else { -// // Step 2.2: construct data and the relative iid -// InstanceIdentifier<AirInterfaceHistoricalPerformances> mwAirInterfaceHistoricalPerformanceIID = InstanceIdentifier -// .builder(MwAirInterfacePac.class, new MwAirInterfacePacKey(mwAirInterfacePacuuId)) -// .child(AirInterfaceHistoricalPerformances.class).build(); -// -// // Step 2.3: read to the config data store -// AirInterfaceHistoricalPerformances airHistoricalPerformanceData = genericTransactionUtils.readData( -// coreData.getDataBroker(), LogicalDatastoreType.OPERATIONAL, mwAirInterfaceHistoricalPerformanceIID); -// -// if (airHistoricalPerformanceData == null) { -// LOG.debug("DBRead MWAirInterfacePac Id {} no AirInterfaceHistoricalPerformances", -// mwAirInterfacePacuuId); -// } else { -// // org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170320.air._interface.historical.performances.g.HistoricalPerformanceDataList -// List<org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.air._interface.historical.performances.g.HistoricalPerformanceDataList> airHistPMList = airHistoricalPerformanceData -// .nonnullHistoricalPerformanceDataList(); -// LOG.debug("DBRead MWAirInterfacePac Id {} Records intermediate: {}", mwAirInterfacePacuuId, -// airHistPMList.size()); -// for (AirInterfaceHistoricalPerformanceTypeG pmRecord : airHistoricalPerformanceData -// .nonnullHistoricalPerformanceDataList()) { -// resultList.add(new ExtendedAirInterfaceHistoricalPerformanceType12(pmRecord, airConfiguration)); -// } -// } -// } -// LOG.debug("DBRead MWAirInterfacePac Id {} Records result: {}", mwAirInterfacePacuuId, resultList.size()); -// return resultList; -// } - - /** + /** * Read and add performance data * @param lp to read from * @param result Object to be filled with data @@ -598,39 +497,6 @@ public class WrapperMicrowaveModelRev170324 implements OnfMicrowaveModel, Microw return result; } -// private @NonNull List<ContainerHistoricalPerformanceTypeG> readTheHistoricalPerformanceDataOfEthernetContainer(Lp lp) { -// -// final String myName = "MWEthernetContainerPac"; -// -// List<ContainerHistoricalPerformanceTypeG> resultList = new ArrayList<>(); -// LOG.debug("DBRead Get {} : {}", coreData.getMountpoint(), myName, lp.getUuid()); -// // ---- -// UniversalId ethContainerPacuuId = lp.getUuid(); -// // Step 2.2: construct data and the relative iid -// InstanceIdentifier<EthernetContainerHistoricalPerformances> ethContainerIID = InstanceIdentifier -// .builder(MwEthernetContainerPac.class, new MwEthernetContainerPacKey(ethContainerPacuuId)) -// .child(EthernetContainerHistoricalPerformances.class).build(); -// -// // Step 2.3: read to the config data store -// EthernetContainerHistoricalPerformances ethContainerHistoricalPerformanceData = genericTransactionUtils -// .readData(coreData.getDataBroker(), LogicalDatastoreType.OPERATIONAL, ethContainerIID); -// -// if (ethContainerHistoricalPerformanceData == null) { -// LOG.debug("DBRead {} Id {} no HistoricalPerformances", myName, ethContainerPacuuId); -// } else { -// // import -// // org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170320.ethernet.container.historical.performances.g.HistoricalPerformanceDataList -// // org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.ethernet.container.historical.performances.g.HistoricalPerformanceDataList -// List<org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.ethernet.container.historical.performances.g.HistoricalPerformanceDataList> airHistPMList = ethContainerHistoricalPerformanceData -// .nonnullHistoricalPerformanceDataList(); -// LOG.debug("DBRead {} Id {} Records intermediate: {}", myName, ethContainerPacuuId, airHistPMList.size()); -// for (ContainerHistoricalPerformanceTypeG pmRecord : airHistPMList) { -// resultList.add(pmRecord); -// } -// } -// LOG.debug("DBRead {} Id {} Records result: {}", myName, ethContainerPacuuId, resultList.size()); -// return resultList; -// } private @NonNull PerformanceDataLtp readEthernetContainerPerformanceData(Lp lp, PerformanceDataLtp result) { final String myName = "MWEthernetContainerPac"; @@ -663,11 +529,6 @@ public class WrapperMicrowaveModelRev170324 implements OnfMicrowaveModel, Microw return result; } -// private static String getUuid(Lp lp) { -// UniversalId uuid = lp.getUuid(); -// return uuid != null ? uuid.getValue() : null; -// } - private org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.SeverityType mapSeverity( SeverityType severity) { Optional<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.SeverityType> res = @@ -675,7 +536,4 @@ public class WrapperMicrowaveModelRev170324 implements OnfMicrowaveModel, Microw return res.orElse(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.SeverityType.NonAlarmed); } - - - } diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev180907.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev180907.java index ed3019cec..bee11b6be 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev180907.java +++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev180907.java @@ -133,19 +133,19 @@ public class WrapperMicrowaveModelRev180907 implements OnfMicrowaveModel, Microw FaultData resultList) { switch (lpName) { - case MWAirInterface: + case MWAIRINTERFACE: readTheFaultsOfMwAirInterfacePac(uuid, resultList); break; - case EthernetContainer12: + case ETHERNETCONTAINER12: readTheFaultsOfMwEthernetContainerPac(uuid, resultList); break; - case TDMContainer: + case TDMCONTAINER: readTheFaultsOfMwTdmContainerPac(uuid, resultList); break; - case Structure: + case STRUCTURE: if (lpClass == MwHybridMwStructurePac.class) { readTheFaultsOfMwHybridMwStructurePac(uuid, resultList); @@ -159,10 +159,10 @@ public class WrapperMicrowaveModelRev180907 implements OnfMicrowaveModel, Microw LOG.warn("Unassigned lp model {} class {}", lpName, lpClass); } break; - case Ethernet: + case ETHERNET: // No alarms supported break; - case EthernetContainer10: + case ETHERNETCONTAINER10: default: LOG.warn("Unassigned or not expected lp in model {}", lpName); } @@ -172,47 +172,26 @@ public class WrapperMicrowaveModelRev180907 implements OnfMicrowaveModel, Microw public @NonNull PerformanceDataLtp getLtpHistoricalPerformanceData(@NonNull ONFLayerProtocolName lpName, @NonNull Lp lp) { PerformanceDataLtp res = new PerformanceDataLtp(); switch (lpName) { - case MWAirInterface: - res = readAirInterfacePerformanceData(lp, res); + case MWAIRINTERFACE: + readAirInterfacePerformanceData(lp, res); break; - case EthernetContainer12: - res = readEthernetContainerPerformanceData(lp, res); + case ETHERNETCONTAINER12: + readEthernetContainerPerformanceData(lp, res); break; - case EthernetContainer10: - case EthernetPhysical: - case Ethernet: - case TDMContainer: - case Structure: - case Unknown: + case ETHERNETCONTAINER10: + case ETHERNETPHYSICAL: + case ETHERNET: + case TDMCONTAINER: + case STRUCTURE: + case UNKNOWN: LOG.debug("Do not read HistoricalPM data for {} {}", lpName, Helper.nnGetUniversalId(lp.getUuid()).getValue()); break; } return res; } -// @Override -// public @NonNull List<? extends OtnHistoryDataG> readTheHistoricalPerformanceData(@NonNull ONFLayerProtocolName lpName, @NonNull Lp lp) { -// switch (lpName) { -// case MWAirInterface: -// return readTheHistoricalPerformanceDataOfMwAirInterfacePac(lp); -// -// case EthernetContainer12: -// return readTheHistoricalPerformanceDataOfEthernetContainer(lp); -// -// case EthernetContainer10: -// case EthernetPhysical: -// case Ethernet: -// case TDMContainer: -// case Structure: -// case Unknown: -// LOG.debug("Do not read HistoricalPM data for {} {}", lpName, Helper.nnGetUniversalId(lp.getUuid()).getValue()); -// break; -// } -// return new ArrayList<>(); -// } - @Override public Class<?> getClassForLtpExtension(QName qName) { Class<?> res = null; @@ -288,12 +267,7 @@ public class WrapperMicrowaveModelRev180907 implements OnfMicrowaveModel, Microw FaultData resultList) { final Class<MwAirInterfacePac> clazzPac = MwAirInterfacePac.class; - // final Class<MwAirInterfacePacKey> clazzPacKey = MwAirInterfacePacKey.class; - // final Class<AirInterfaceCurrentProblems> clazzProblems = - // AirInterfaceCurrentProblems.class; - // final Class<AirInterfaceCurrentProblemTypeG> clazzProblem = - // AirInterfaceCurrentProblemTypeG.class; - + LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(), mountpointId, interfacePacUuid.getValue()); @@ -327,13 +301,7 @@ public class WrapperMicrowaveModelRev180907 implements OnfMicrowaveModel, Microw FaultData resultList) { final Class<MwEthernetContainerPac> clazzPac = MwEthernetContainerPac.class; - // final Class<MwEthernetContainerPacKey> clazzPacKey = - // MwEthernetContainerPacKey.class; - // final Class<EthernetContainerCurrentProblems> clazzProblems = - // EthernetContainerCurrentProblems.class; - // final Class<ContainerCurrentProblemTypeG> clazzProblem = - // ContainerCurrentProblemTypeG.class; - + LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(), mountpointId, interfacePacUuid.getValue()); @@ -364,12 +332,8 @@ public class WrapperMicrowaveModelRev180907 implements OnfMicrowaveModel, Microw FaultData resultList) { final Class<MwAirInterfaceDiversityPac> clazzPac = MwAirInterfaceDiversityPac.class; - // final Class<MwAirInterfaceDiversityPacKey> clazzPacKey = - // MwAirInterfaceDiversityPacKey.class; final Class<AirInterfaceDiversityCurrentProblems> clazzProblems = AirInterfaceDiversityCurrentProblems.class; - // final Class<AirInterfaceDiversityCurrentProblemTypeG> clazzProblem = - // AirInterfaceDiversityCurrentProblemTypeG.class; - + LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(), mountpointId, interfacePacUuid.getValue()); @@ -399,12 +363,8 @@ public class WrapperMicrowaveModelRev180907 implements OnfMicrowaveModel, Microw FaultData resultList) { final Class<MwPureEthernetStructurePac> clazzPac = MwPureEthernetStructurePac.class; - // final Class<MwPureEthernetStructurePacKey> clazzPacKey = - // MwPureEthernetStructurePacKey.class; final Class<PureEthernetStructureCurrentProblems> clazzProblems = PureEthernetStructureCurrentProblems.class; - // final Class<StructureCurrentProblemTypeG> clazzProblem = - // StructureCurrentProblemTypeG.class; - + LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(), mountpointId, interfacePacUuid.getValue()); @@ -434,12 +394,8 @@ public class WrapperMicrowaveModelRev180907 implements OnfMicrowaveModel, Microw FaultData resultList) { final Class<MwHybridMwStructurePac> clazzPac = MwHybridMwStructurePac.class; - // final Class<MwHybridMwStructurePacKey> clazzPacKey = - // MwHybridMwStructurePacKey.class; final Class<HybridMwStructureCurrentProblems> clazzProblems = HybridMwStructureCurrentProblems.class; - // final Class<HybridMwStructureCurrentProblemsG> clazzProblem = - // HybridMwStructureCurrentProblemsG.class; - + LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(), mountpointId, interfacePacUuid.getValue()); @@ -479,9 +435,7 @@ public class WrapperMicrowaveModelRev180907 implements OnfMicrowaveModel, Microw final Class<MwTdmContainerPac> clazzPac = MwTdmContainerPac.class; final Class<MwTdmContainerPacKey> clazzPacKey = MwTdmContainerPacKey.class; final Class<TdmContainerCurrentProblems> clazzProblems = TdmContainerCurrentProblems.class; - // final Class<ContainerCurrentProblemTypeG> clazzProblem = - // ContainerCurrentProblemTypeG.class; - + LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(), mountpointId, interfacePacUuid.getValue()); @@ -510,96 +464,6 @@ public class WrapperMicrowaveModelRev180907 implements OnfMicrowaveModel, Microw return resultList; } - /*----------------------------------------------------------------------------- - * Performance related data - */ - -// /** -// * PM MwAirInterfacePac -// * -// * @param lp -// * @return -// */ -// private @NonNull List<ExtendedAirInterfaceHistoricalPerformanceType1211> readTheHistoricalPerformanceDataOfMwAirInterfacePac( -// Lp lp) { -// -// String uuId = Helper.nnGetUniversalId(lp.getUuid()).getValue(); -// -// List<ExtendedAirInterfaceHistoricalPerformanceType1211> resultList = new ArrayList<>(); -// LOG.debug("DBRead Get {} MWAirInterfacePac: {}", coreData.getMountpoint(), uuId); -// // ---- -// UniversalId mwAirInterfacePacuuId = new UniversalId(uuId); -// // Step 2.1: construct data and the relative iid -// InstanceIdentifier<AirInterfaceConfiguration> mwAirInterfaceConfigurationIID = InstanceIdentifier -// .builder(MwAirInterfacePac.class, new MwAirInterfacePacKey(mwAirInterfacePacuuId)) -// .child(AirInterfaceConfiguration.class).build(); -// AirInterfaceConfiguration airConfiguration = genericTransactionUtil.readData(coreData.getDataBroker(), -// LogicalDatastoreType.OPERATIONAL, mwAirInterfaceConfigurationIID); -// -// if (airConfiguration == null) { -// LOG.debug("DBRead MWAirInterfacePac Id {} no AirInterfaceConfiguration", mwAirInterfacePacuuId); -// -// } else { -// // Step 2.2: construct data and the relative iid -// InstanceIdentifier<AirInterfaceHistoricalPerformances> mwAirInterfaceHistoricalPerformanceIID = InstanceIdentifier -// .builder(MwAirInterfacePac.class, new MwAirInterfacePacKey(mwAirInterfacePacuuId)) -// .child(AirInterfaceHistoricalPerformances.class).build(); -// -// // Step 2.3: read to the config data store -// AirInterfaceHistoricalPerformances airHistoricalPerformanceData = genericTransactionUtil.readData( -// coreData.getDataBroker(), LogicalDatastoreType.OPERATIONAL, mwAirInterfaceHistoricalPerformanceIID); -// -// if (airHistoricalPerformanceData == null) { -// LOG.debug("DBRead MWAirInterfacePac Id {} no AirInterfaceHistoricalPerformances", -// mwAirInterfacePacuuId); -// } else { -// List<org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.air._interface.historical.performances.g.HistoricalPerformanceDataList> airHistPMList = airHistoricalPerformanceData -// .nonnullHistoricalPerformanceDataList(); -// LOG.debug("DBRead MWAirInterfacePac Id {} Records intermediate: {}", mwAirInterfacePacuuId, -// airHistPMList.size()); -// for (AirInterfaceHistoricalPerformanceTypeG pmRecord : airHistPMList) { -// resultList.add(new ExtendedAirInterfaceHistoricalPerformanceType1211(pmRecord, airConfiguration)); -// } -// } -// } -// LOG.debug("DBRead MWAirInterfacePac Id {} Records result: {}", mwAirInterfacePacuuId, resultList.size()); -// return resultList; -// } - -// private @NonNull List<ContainerHistoricalPerformanceTypeG> readTheHistoricalPerformanceDataOfEthernetContainer(Lp lp) { -// -// final String myName = "MWEthernetContainerPac"; -// String uuId = Helper.nnGetUniversalId(lp.getUuid()).getValue(); -// -// List<ContainerHistoricalPerformanceTypeG> resultList = new ArrayList<>(); -// LOG.debug("DBRead Get {} : {}", coreData.getMountpoint(), myName, uuId); -// // ---- -// UniversalId ethContainerPacuuId = new UniversalId(uuId); -// // Step 2.2: construct data and the relative iid -// InstanceIdentifier<EthernetContainerHistoricalPerformances> ethContainerIID = InstanceIdentifier -// .builder(MwEthernetContainerPac.class, new MwEthernetContainerPacKey(ethContainerPacuuId)) -// .child(EthernetContainerHistoricalPerformances.class).build(); -// -// // Step 2.3: read to the config data store -// EthernetContainerHistoricalPerformances ethContainerHistoricalPerformanceData = genericTransactionUtil -// .readData(coreData.getDataBroker(), LogicalDatastoreType.OPERATIONAL, ethContainerIID); -// -// if (ethContainerHistoricalPerformanceData == null) { -// LOG.debug("DBRead {} Id {} no HistoricalPerformances", myName, ethContainerPacuuId); -// } else { -// // import -// // org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170320.ethernet.container.historical.performances.g.HistoricalPerformanceDataList -// List<org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.ethernet.container.historical.performances.g.HistoricalPerformanceDataList> airHistPMList = ethContainerHistoricalPerformanceData -// .nonnullHistoricalPerformanceDataList(); -// LOG.debug("DBRead {} Id {} Records intermediate: {}", myName, ethContainerPacuuId, airHistPMList.size()); -// for (ContainerHistoricalPerformanceTypeG pmRecord : airHistPMList) { -// resultList.add(pmRecord); -// } -// } -// LOG.debug("DBRead {} Id {} Records result: {}", myName, ethContainerPacuuId, resultList.size()); -// return resultList; -// } - /** * Read and add performance data * @param lp to read from diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev181010.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev181010.java index dc2c4e995..633f24d96 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev181010.java +++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev181010.java @@ -132,19 +132,19 @@ public class WrapperMicrowaveModelRev181010 implements OnfMicrowaveModel, Microw FaultData resultList) { switch (lpName) { - case MWAirInterface: + case MWAIRINTERFACE: readTheFaultsOfMwAirInterfacePac(uuid, resultList); break; - case EthernetContainer12: + case ETHERNETCONTAINER12: readTheFaultsOfMwEthernetContainerPac(uuid, resultList); break; - case TDMContainer: + case TDMCONTAINER: readTheFaultsOfMwTdmContainerPac(uuid, resultList); break; - case Structure: + case STRUCTURE: if (lpClass == MwHybridMwStructurePac.class) { readTheFaultsOfMwHybridMwStructurePac(uuid, resultList); @@ -158,10 +158,10 @@ public class WrapperMicrowaveModelRev181010 implements OnfMicrowaveModel, Microw LOG.warn("Unassigned lp model {} class {}", lpName, lpClass); } break; - case Ethernet: + case ETHERNET: // No alarms supported break; - case EthernetContainer10: + case ETHERNETCONTAINER10: default: LOG.warn("Unassigned or not expected lp in model {}", lpName); } @@ -171,18 +171,18 @@ public class WrapperMicrowaveModelRev181010 implements OnfMicrowaveModel, Microw public @NonNull PerformanceDataLtp getLtpHistoricalPerformanceData(@NonNull ONFLayerProtocolName lpName, @NonNull Lp lp) { PerformanceDataLtp res = new PerformanceDataLtp(); switch (lpName) { - case MWAirInterface: + case MWAIRINTERFACE: return readAirInterfacePerformanceData(lp, res); - case EthernetContainer12: + case ETHERNETCONTAINER12: return readEthernetContainerPerformanceData(lp, res); - case EthernetContainer10: - case EthernetPhysical: - case Ethernet: - case TDMContainer: - case Structure: - case Unknown: + case ETHERNETCONTAINER10: + case ETHERNETPHYSICAL: + case ETHERNET: + case TDMCONTAINER: + case STRUCTURE: + case UNKNOWN: LOG.debug("Do not read HistoricalPM data for {} {}", lpName, Helper.nnGetUniversalId(lp.getUuid()).getValue()); } return res; @@ -263,12 +263,7 @@ public class WrapperMicrowaveModelRev181010 implements OnfMicrowaveModel, Microw FaultData resultList) { final Class<MwAirInterfacePac> clazzPac = MwAirInterfacePac.class; - // final Class<MwAirInterfacePacKey> clazzPacKey = MwAirInterfacePacKey.class; - // final Class<AirInterfaceCurrentProblems> clazzProblems = - // AirInterfaceCurrentProblems.class; - // final Class<AirInterfaceCurrentProblemTypeG> clazzProblem = - // AirInterfaceCurrentProblemTypeG.class; - + LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(), mountpointId, interfacePacUuid.getValue()); @@ -304,13 +299,7 @@ public class WrapperMicrowaveModelRev181010 implements OnfMicrowaveModel, Microw FaultData resultList) { final Class<MwEthernetContainerPac> clazzPac = MwEthernetContainerPac.class; - // final Class<MwEthernetContainerPacKey> clazzPacKey = - // MwEthernetContainerPacKey.class; - // final Class<EthernetContainerCurrentProblems> clazzProblems = - // EthernetContainerCurrentProblems.class; - // final Class<ContainerCurrentProblemTypeG> clazzProblem = - // ContainerCurrentProblemTypeG.class; - + LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(), mountpointId, interfacePacUuid.getValue()); @@ -343,12 +332,8 @@ public class WrapperMicrowaveModelRev181010 implements OnfMicrowaveModel, Microw FaultData resultList) { final Class<MwAirInterfaceDiversityPac> clazzPac = MwAirInterfaceDiversityPac.class; - // final Class<MwAirInterfaceDiversityPacKey> clazzPacKey = - // MwAirInterfaceDiversityPacKey.class; final Class<AirInterfaceDiversityCurrentProblems> clazzProblems = AirInterfaceDiversityCurrentProblems.class; - // final Class<AirInterfaceDiversityCurrentProblemTypeG> clazzProblem = - // AirInterfaceDiversityCurrentProblemTypeG.class; - + LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(), mountpointId, interfacePacUuid.getValue()); @@ -380,12 +365,8 @@ public class WrapperMicrowaveModelRev181010 implements OnfMicrowaveModel, Microw FaultData resultList) { final Class<MwPureEthernetStructurePac> clazzPac = MwPureEthernetStructurePac.class; - // final Class<MwPureEthernetStructurePacKey> clazzPacKey = - // MwPureEthernetStructurePacKey.class; final Class<PureEthernetStructureCurrentProblems> clazzProblems = PureEthernetStructureCurrentProblems.class; - // final Class<StructureCurrentProblemTypeG> clazzProblem = - // StructureCurrentProblemTypeG.class; - + LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(), mountpointId, interfacePacUuid.getValue()); @@ -417,12 +398,8 @@ public class WrapperMicrowaveModelRev181010 implements OnfMicrowaveModel, Microw FaultData resultList) { final Class<MwHybridMwStructurePac> clazzPac = MwHybridMwStructurePac.class; - // final Class<MwHybridMwStructurePacKey> clazzPacKey = - // MwHybridMwStructurePacKey.class; final Class<HybridMwStructureCurrentProblems> clazzProblems = HybridMwStructureCurrentProblems.class; - // final Class<HybridMwStructureCurrentProblemsG> clazzProblem = - // HybridMwStructureCurrentProblemsG.class; - + LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(), mountpointId, interfacePacUuid.getValue()); @@ -464,9 +441,7 @@ public class WrapperMicrowaveModelRev181010 implements OnfMicrowaveModel, Microw final Class<MwTdmContainerPac> clazzPac = MwTdmContainerPac.class; final Class<MwTdmContainerPacKey> clazzPacKey = MwTdmContainerPacKey.class; final Class<TdmContainerCurrentProblems> clazzProblems = TdmContainerCurrentProblems.class; - // final Class<ContainerCurrentProblemTypeG> clazzProblem = - // ContainerCurrentProblemTypeG.class; - + LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(), mountpointId, interfacePacUuid.getValue()); diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/impl/DeviceManagerOnfImpl.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/impl/DeviceManagerOnfImpl.java new file mode 100644 index 000000000..04c3bc57b --- /dev/null +++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/impl/DeviceManagerOnfImpl.java @@ -0,0 +1,86 @@ +/******************************************************************************* + * ============LICENSE_START======================================================================== + * ONAP : ccsdk feature sdnr wt + * ================================================================================================= + * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. + * ================================================================================================= + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * ============LICENSE_END========================================================================== + ******************************************************************************/ +package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.impl; + +import org.onap.ccsdk.features.sdnr.wt.common.database.HtDatabaseClient; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.ne.factory.FactoryRegistration; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.NetconfNetworkElementService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class DeviceManagerOnfImpl implements AutoCloseable { + + private static final Logger LOG = LoggerFactory.getLogger(DeviceManagerOnfImpl.class); + private static final String APPLICATIONNAME = "DeviceManagerOnf"; + + private NetconfNetworkElementService netconfNetworkElementService; + + private HtDatabaseClient htDatabaseClient; + private Boolean devicemanagerInitializationOk = false; + private FactoryRegistration<ONFCoreNetworkElementFactory> resOnf; + + // Blueprint begin + public DeviceManagerOnfImpl() { + LOG.info("Creating provider for {}", APPLICATIONNAME); + resOnf = null; + } + + public void setNetconfNetworkElementService(NetconfNetworkElementService netconfNetworkElementService) { + this.netconfNetworkElementService = netconfNetworkElementService; + } + + public void init() throws Exception { + + LOG.info("Session Initiated start {}", APPLICATIONNAME); + + resOnf = netconfNetworkElementService.registerNetworkElementFactory(new ONFCoreNetworkElementFactory()); + + + netconfNetworkElementService.writeToEventLog(APPLICATIONNAME, "startup", "done"); + this.devicemanagerInitializationOk = true; + + LOG.info("Session Initiated end. Initialization done {}", devicemanagerInitializationOk); + } + // Blueprint end + + @Override + public void close() throws Exception { + LOG.info("closing ..."); + close(htDatabaseClient); + close(resOnf); + LOG.info("closing done"); + } + + /** + * Used to close all Services, that should support AutoCloseable Pattern + * + * @param toClose + * @throws Exception + */ + private void close(AutoCloseable... toCloseList) { + for (AutoCloseable element : toCloseList) { + if (element != null) { + try { + element.close(); + } catch (Exception e) { + LOG.warn("Fail during close: ", e); + } + } + } + } +} diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Base.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Base.java index 48f1ebba6..9fc0c9599 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Base.java +++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Base.java @@ -57,380 +57,378 @@ import org.slf4j.LoggerFactory; */ public abstract class ONFCoreNetworkElement12Base extends ONFCoreNetworkElementBase implements NetworkElementCoreData { - private static final Logger LOG = LoggerFactory.getLogger(ONFCoreNetworkElement12Base.class); - - protected static final @NonNull List<Extension> EMPTYLTPEXTENSIONLIST = new ArrayList<>(); - // private static final List<Ltp> EMPTYLTPLIST = new ArrayList<>(); - - protected static final InstanceIdentifier<NetworkElement> NETWORKELEMENT_IID = InstanceIdentifier - .builder(NetworkElement.class).build(); - - - /*----------------------------------------------------------------------------- - * Class members - */ - - // Non specific part. Used by all functions. - /** interfaceList is used by PM task and should be synchronized */ - @SuppressWarnings("null") - private final @NonNull List<Lp> interfaceList = Collections.synchronizedList(new CopyOnWriteArrayList<>()); - private Optional<NetworkElement> optionalNe; - - // Performance monitoring specific part - /** Lock for the PM access specific elements that could be null */ - private final @NonNull Object pmLock = new Object(); - protected @Nullable Iterator<Lp> interfaceListIterator = null; - /** Actual pmLp used during iteration over interfaces */ - protected @Nullable Lp pmLp = null; - - // Device monitoring specific part - /** Lock for the DM access specific elements that could be null */ - protected final @NonNull Object dmLock = new Object(); - - protected final boolean isNetworkElementCurrentProblemsSupporting12; - - protected final ONFCoreNetworkElement12Equipment equipment; - - protected final NodeId nodeId; - - /*--------------------------------------------------------------- - * Constructor - */ - - protected ONFCoreNetworkElement12Base(@NonNull NetconfAccessor acessor) { - super(acessor); - this.optionalNe = Optional.empty(); - this.nodeId = getAcessor().get().getNodeId(); - this.isNetworkElementCurrentProblemsSupporting12 = acessor.getCapabilites().isSupportingNamespaceAndRevision(NetworkElementPac.QNAME); - this.equipment = new ONFCoreNetworkElement12Equipment(acessor, this, acessor.getCapabilites()); - WrapperPTPModelRev170208.initSynchronizationExtension(acessor); - LOG.debug("support necurrent-problem-list={}", this.isNetworkElementCurrentProblemsSupporting12); - } - - /*--------------------------------------------------------------- - * Getter/ Setter - */ - - @Override - public Optional<NetworkElement> getOptionalNetworkElement() { - return optionalNe; - } - - List<Lp> getInterfaceList() { - return interfaceList; - } - - public Object getPmLock() { - return pmLock; - } - - /*--------------------------------------------------------------- - * Core model related function - */ - - /** - * Get uuid of Optional NE. - * - * @return Uuid or EMPTY String if optionNE is not available - */ - protected String getUuId() { - String uuid = optionalNe.isPresent() ? Helper.nnGetUniversalId(optionalNe.get().getUuid()).getValue() : EMPTY; - return uuid; - } - - /** - * Read from NetworkElement and verify LTPs have changed. If the NE has changed, update to the new - * structure. From initial state it changes also. - */ - protected synchronized boolean readNetworkElementAndInterfaces() { - - LOG.debug("Update mountpoint if changed {}", getMountPointNodeName()); - - optionalNe = Optional.ofNullable(getGenericTransactionUtils().readData(getNetconfNodeDataBroker(), LogicalDatastoreType.OPERATIONAL, - NETWORKELEMENT_IID)); - synchronized (pmLock) { - boolean change = false; - - if (!optionalNe.isPresent()) { - LOG.debug("Unable to read NE data for mountpoint {}", getMountPointNodeName()); - if (!interfaceList.isEmpty()) { - interfaceList.clear(); - interfaceListIterator = null; - change = true; - } - - } else { - NetworkElement ne = optionalNe.get(); - LOG.debug("Mountpoint '{}' NE-Name '{}'", getMountPointNodeName(), ne.getName()); - List<Lp> actualInterfaceList = getLtpList(ne); - if (!interfaceList.equals(actualInterfaceList)) { - LOG.debug("Mountpoint '{}' Update LTP List. Elements {}", getMountPointNodeName(), - actualInterfaceList.size()); - interfaceList.clear(); - interfaceList.addAll(actualInterfaceList); - interfaceListIterator = null; - change = true; - } - } - return change; - } - } - - /** - * Get List of UUIDs for conditional packages from Networkelement<br> - * Possible interfaces are:<br> - * MWPS, LTP(MWPS-TTP), MWAirInterfacePac, MicrowaveModel-ObjectClasses-AirInterface<br> - * ETH-CTP,LTP(Client), MW_EthernetContainer_Pac<br> - * MWS, LTP(MWS-CTP-xD), MWAirInterfaceDiversityPac, - * MicrowaveModel-ObjectClasses-AirInterfaceDiversity<br> - * MWS, LTP(MWS-TTP), ,MicrowaveModel-ObjectClasses-HybridMwStructure<br> - * MWS, LTP(MWS-TTP), ,MicrowaveModel-ObjectClasses-PureEthernetStructure<br> - * - * @param ne NetworkElement - * @return Id List, never null. - */ - - private static List<Lp> getLtpList(@Nullable NetworkElement ne) { - - List<Lp> res = Collections.synchronizedList(new ArrayList<Lp>()); - - if (ne != null) { - List<Ltp> ltpRefList = ne.getLtp(); - if (ltpRefList == null) { - LOG.debug("DBRead NE-Interfaces: null"); - } else { - for (Ltp ltRefListE : ltpRefList) { - List<Lp> lpList = ltRefListE.getLp(); - if (lpList == null) { - LOG.debug("DBRead NE-Interfaces Reference List: null"); - } else { - for (Lp ltp : lpList) { - res.add(ltp); - } - } - } - } - } else { - LOG.debug("DBRead NE: null"); - } - - // ---- Debug - if (LOG.isDebugEnabled()) { - StringBuffer strBuf = new StringBuffer(); - for (Lp ltp : res) { - if (strBuf.length() > 0) { - strBuf.append(", "); - } - strBuf.append(Helper.nnGetLayerProtocolName(ltp.getLayerProtocolName()).getValue()); - strBuf.append(':'); - strBuf.append(Helper.nnGetUniversalId(ltp.getUuid()).getValue()); - } - LOG.debug("DBRead NE-Interfaces: {}", strBuf.toString()); - } - // ---- Debug end - - return res; - } - - /** - * Read current problems of AirInterfaces and EthernetContainer according to NE status into DB - * - * @return List with all problems - */ - protected FaultData readAllCurrentProblemsOfNode() { - - // Step 2.3: read the existing faults and add to DB - FaultData resultList = new FaultData(); - int idxStart; // Start index for debug messages - UniversalId uuid; - - synchronized (pmLock) { - for (Lp lp : interfaceList) { - - idxStart = resultList.size(); - uuid = lp.getUuid(); - FaultData.debugResultList(LOG, uuid.getValue(), resultList, idxStart); - - } - } - - // Step 2.4: Read other problems from mountpoint - if (isNetworkElementCurrentProblemsSupporting12) { - idxStart = resultList.size(); - readNetworkElementCurrentProblems12(resultList); - FaultData.debugResultList(LOG, "CurrentProblems12", resultList, idxStart); - } - - return resultList; - - } - - /** - * Reading problems for the networkElement V1.2 - * @param resultList to collect the problems - * @return resultList with additonal problems - */ - protected FaultData readNetworkElementCurrentProblems12(FaultData resultList) { - - LOG.info("DBRead Get {} NetworkElementCurrentProblems12", getMountPointNodeName()); - - InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.onf.core.model.conditional.packages.rev170402.NetworkElementPac> networkElementCurrentProblemsIID = - InstanceIdentifier.builder( - org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.onf.core.model.conditional.packages.rev170402.NetworkElementPac.class) - .build(); - - // Step 2.3: read to the config data store - NetworkElementPac problemPac; - NetworkElementCurrentProblems problems = null; - try { - problemPac = getGenericTransactionUtils().readData(getNetconfNodeDataBroker(), LogicalDatastoreType.OPERATIONAL, - networkElementCurrentProblemsIID); - if (problemPac != null) { - problems = problemPac.getNetworkElementCurrentProblems(); - } - if (problems == null) { - LOG.debug("DBRead no NetworkElementCurrentProblems12"); - } else { - for (org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.onf.core.model.conditional.packages.rev170402.network.element.current.problems.g.CurrentProblemList problem : problems - .nonnullCurrentProblemList()) { - resultList.add(nodeId, problem.getSequenceNumber(), problem.getTimeStamp(), - problem.getObjectReference(), problem.getProblemName(), - WrapperMicrowaveModelRev181010.mapSeverity(problem.getProblemSeverity())); - } - } - } catch (Exception e) { - LOG.warn("DBRead {} NetworkElementCurrentProblems12 not supported. Message '{}' ", getMountPointNodeName(), - e.getMessage()); - } - return resultList; - } - - /*--------------------------------------------------------------- - * Device Monitor - */ - - @Override - public boolean checkIfConnectionToMediatorIsOk() { - synchronized (dmLock) { - return optionalNe != null; - } - } - - /* - * New implementation to interpret status with empty LTP List as notConnected => return false - * 30.10.2018 Since this behavior is very specific and implicit for specific NE Types - * it needs to be activated by extension or configuration. Change to be disabled at the moment - */ - @Override - public boolean checkIfConnectionToNeIsOk() { - return true; - } - - /*--------------------------------------------------------------- - * Synchronization - */ - - - /*--------------------------------------------------------------- - * Equipment related functions - */ - - @Override - public @NonNull InventoryInformationDcae getInventoryInformation(String layerProtocolFilter) { - LOG.debug("request inventory information. filter:" + layerProtocolFilter); - return this.equipment.getInventoryInformation(getFilteredInterfaceUuidsAsStringList(layerProtocolFilter)); - } - - @Override - public InventoryInformationDcae getInventoryInformation() { - return getInventoryInformation(null); - } - - protected List<String> getFilteredInterfaceUuidsAsStringList(String layerProtocolFilter) { - List<String> uuids = new ArrayList<>(); - - LOG.debug("request inventory information. filter:" + layerProtocolFilter); - if (optionalNe != null) { - // uuids - for (Lp lp : this.interfaceList) { - if (layerProtocolFilter == null || layerProtocolFilter.isEmpty()) { - uuids.add(Helper.nnGetUniversalId(lp.getUuid()).getValue()); - } else if (layerProtocolFilter.equals(Helper.nnGetLayerProtocolName(lp.getLayerProtocolName()).getValue())) { - uuids.add(Helper.nnGetUniversalId(lp.getUuid()).getValue()); - } - } - } - LOG.debug("uuids found: {}", uuids); - return uuids; - } - - - /*--------------------------------------------------------------- - * Performancemanagement specific interface - */ - - @Override - public void resetPMIterator() { - synchronized (pmLock) { - interfaceListIterator = interfaceList.iterator(); - } - LOG.debug("PM reset iterator"); - } - - @SuppressWarnings("null") - @Override - public boolean hasNext() { - boolean res; - synchronized (pmLock) { - res = interfaceListIterator != null ? interfaceListIterator.hasNext() : false; - } - LOG.debug("PM hasNext LTP {}", res); - return res; - } - - @SuppressWarnings("null") - @Override - public void next() { - synchronized (pmLock) { - if (interfaceListIterator == null) { - pmLp = null; - LOG.debug("PM next LTP null"); - } else { - pmLp = interfaceListIterator.next(); - LOG.debug("PM next LTP {}", Helper.nnGetLayerProtocolName(pmLp.getLayerProtocolName()).getValue()); - } - } - } - - @SuppressWarnings("null") - @Override - public String pmStatusToString() { - StringBuffer res = new StringBuffer(); - synchronized (pmLock) { - res.append(pmLp == null ? "no interface" : Helper.nnGetLayerProtocolName(pmLp.getLayerProtocolName()).getValue()); - for (Lp lp : getInterfaceList()) { - res.append("IF:"); - res.append(Helper.nnGetLayerProtocolName(lp.getLayerProtocolName()).getValue()); - res.append(" "); - } - } - return res.toString(); - } - - @Override - public void doRegisterEventListener(MountPoint mountPoint) { - //Do nothing - } - - @SuppressWarnings("unchecked") - @Override - public <L extends NetworkElementService> Optional<L> getService(Class<L> clazz) { - return clazz.isInstance(this) ? Optional.of((L)this) : Optional.empty(); - } - - @Override - public Optional<PerformanceDataLtp> getLtpHistoricalPerformanceData() { - return Optional.empty(); - } + private static final Logger LOG = LoggerFactory.getLogger(ONFCoreNetworkElement12Base.class); + + protected static final @NonNull List<Extension> EMPTYLTPEXTENSIONLIST = new ArrayList<>(); + + protected static final InstanceIdentifier<NetworkElement> NETWORKELEMENT_IID = InstanceIdentifier + .builder(NetworkElement.class).build(); + + + /*----------------------------------------------------------------------------- + * Class members + */ + + // Non specific part. Used by all functions. + /** interfaceList is used by PM task and should be synchronized */ + @SuppressWarnings("null") + private final @NonNull List<Lp> interfaceList = Collections.synchronizedList(new CopyOnWriteArrayList<>()); + private Optional<NetworkElement> optionalNe; + + // Performance monitoring specific part + /** Lock for the PM access specific elements that could be null */ + private final @NonNull Object pmLock = new Object(); + protected @Nullable Iterator<Lp> interfaceListIterator = null; + /** Actual pmLp used during iteration over interfaces */ + protected @Nullable Lp pmLp = null; + + // Device monitoring specific part + /** Lock for the DM access specific elements that could be null */ + protected final @NonNull Object dmLock = new Object(); + + protected final boolean isNetworkElementCurrentProblemsSupporting12; + + protected final ONFCoreNetworkElement12Equipment equipment; + + protected final NodeId nodeId; + + /*--------------------------------------------------------------- + * Constructor + */ + + protected ONFCoreNetworkElement12Base(@NonNull NetconfAccessor acessor) { + super(acessor); + this.optionalNe = Optional.empty(); + this.nodeId = getAcessor().get().getNodeId(); + this.isNetworkElementCurrentProblemsSupporting12 = acessor.getCapabilites().isSupportingNamespaceAndRevision(NetworkElementPac.QNAME); + this.equipment = new ONFCoreNetworkElement12Equipment(acessor, this, acessor.getCapabilites()); + WrapperPTPModelRev170208.initSynchronizationExtension(acessor); + LOG.debug("support necurrent-problem-list={}", this.isNetworkElementCurrentProblemsSupporting12); + } + + /*--------------------------------------------------------------- + * Getter/ Setter + */ + + @Override + public Optional<NetworkElement> getOptionalNetworkElement() { + return optionalNe; + } + + List<Lp> getInterfaceList() { + return interfaceList; + } + + public Object getPmLock() { + return pmLock; + } + + /*--------------------------------------------------------------- + * Core model related function + */ + + /** + * Get uuid of Optional NE. + * + * @return Uuid or EMPTY String if optionNE is not available + */ + protected String getUuId() { + return optionalNe.isPresent() ? Helper.nnGetUniversalId(optionalNe.get().getUuid()).getValue() : EMPTY; + } + + /** + * Read from NetworkElement and verify LTPs have changed. If the NE has changed, update to the new + * structure. From initial state it changes also. + */ + protected synchronized boolean readNetworkElementAndInterfaces() { + + LOG.debug("Update mountpoint if changed {}", getMountpoint()); + + optionalNe = Optional.ofNullable(getGenericTransactionUtils().readData(getDataBroker(), LogicalDatastoreType.OPERATIONAL, + NETWORKELEMENT_IID)); + synchronized (pmLock) { + boolean change = false; + + if (!optionalNe.isPresent()) { + LOG.debug("Unable to read NE data for mountpoint {}", getMountpoint()); + if (!interfaceList.isEmpty()) { + interfaceList.clear(); + interfaceListIterator = null; + change = true; + } + + } else { + NetworkElement ne = optionalNe.get(); + LOG.debug("Mountpoint '{}' NE-Name '{}'", getMountpoint(), ne.getName()); + List<Lp> actualInterfaceList = getLtpList(ne); + if (!interfaceList.equals(actualInterfaceList)) { + LOG.debug("Mountpoint '{}' Update LTP List. Elements {}", getMountpoint(), + actualInterfaceList.size()); + interfaceList.clear(); + interfaceList.addAll(actualInterfaceList); + interfaceListIterator = null; + change = true; + } + } + return change; + } + } + + /** + * Get List of UUIDs for conditional packages from Networkelement<br> + * Possible interfaces are:<br> + * MWPS, LTP(MWPS-TTP), MWAirInterfacePac, MicrowaveModel-ObjectClasses-AirInterface<br> + * ETH-CTP,LTP(Client), MW_EthernetContainer_Pac<br> + * MWS, LTP(MWS-CTP-xD), MWAirInterfaceDiversityPac, + * MicrowaveModel-ObjectClasses-AirInterfaceDiversity<br> + * MWS, LTP(MWS-TTP), ,MicrowaveModel-ObjectClasses-HybridMwStructure<br> + * MWS, LTP(MWS-TTP), ,MicrowaveModel-ObjectClasses-PureEthernetStructure<br> + * + * @param ne NetworkElement + * @return Id List, never null. + */ + + private static List<Lp> getLtpList(@Nullable NetworkElement ne) { + + List<Lp> res = Collections.synchronizedList(new ArrayList<Lp>()); + + if (ne != null) { + List<Ltp> ltpRefList = ne.getLtp(); + if (ltpRefList == null) { + LOG.debug("DBRead NE-Interfaces: null"); + } else { + for (Ltp ltRefListE : ltpRefList) { + List<Lp> lpList = ltRefListE.getLp(); + if (lpList == null) { + LOG.debug("DBRead NE-Interfaces Reference List: null"); + } else { + for (Lp ltp : lpList) { + res.add(ltp); + } + } + } + } + } else { + LOG.debug("DBRead NE: null"); + } + + // ---- Debug + if (LOG.isDebugEnabled()) { + StringBuilder strBuild = new StringBuilder(); + for (Lp ltp : res) { + if (strBuild.length() > 0) { + strBuild.append(", "); + } + strBuild.append(Helper.nnGetLayerProtocolName(ltp.getLayerProtocolName()).getValue()); + strBuild.append(':'); + strBuild.append(Helper.nnGetUniversalId(ltp.getUuid()).getValue()); + } + LOG.debug("DBRead NE-Interfaces: {}", strBuild.toString()); + } + // ---- Debug end + + return res; + } + + /** + * Read current problems of AirInterfaces and EthernetContainer according to NE status into DB + * + * @return List with all problems + */ + protected FaultData readAllCurrentProblemsOfNode() { + + // Step 2.3: read the existing faults and add to DB + FaultData resultList = new FaultData(); + int idxStart; // Start index for debug messages + UniversalId uuid; + + synchronized (pmLock) { + for (Lp lp : interfaceList) { + + idxStart = resultList.size(); + uuid = lp.getUuid(); + FaultData.debugResultList(LOG, uuid.getValue(), resultList, idxStart); + + } + } + + // Step 2.4: Read other problems from mountpoint + if (isNetworkElementCurrentProblemsSupporting12) { + idxStart = resultList.size(); + readNetworkElementCurrentProblems12(resultList); + FaultData.debugResultList(LOG, "CurrentProblems12", resultList, idxStart); + } + + return resultList; + + } + + /** + * Reading problems for the networkElement V1.2 + * @param resultList to collect the problems + * @return resultList with additonal problems + */ + protected FaultData readNetworkElementCurrentProblems12(FaultData resultList) { + + LOG.info("DBRead Get {} NetworkElementCurrentProblems12", getMountpoint()); + + InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.onf.core.model.conditional.packages.rev170402.NetworkElementPac> networkElementCurrentProblemsIID = + InstanceIdentifier.builder( + org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.onf.core.model.conditional.packages.rev170402.NetworkElementPac.class) + .build(); + + // Step 2.3: read to the config data store + NetworkElementPac problemPac; + NetworkElementCurrentProblems problems = null; + try { + problemPac = getGenericTransactionUtils().readData(getDataBroker(), LogicalDatastoreType.OPERATIONAL, + networkElementCurrentProblemsIID); + if (problemPac != null) { + problems = problemPac.getNetworkElementCurrentProblems(); + } + if (problems == null) { + LOG.debug("DBRead no NetworkElementCurrentProblems12"); + } else { + for (org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.onf.core.model.conditional.packages.rev170402.network.element.current.problems.g.CurrentProblemList problem : problems + .nonnullCurrentProblemList()) { + resultList.add(nodeId, problem.getSequenceNumber(), problem.getTimeStamp(), + problem.getObjectReference(), problem.getProblemName(), + WrapperMicrowaveModelRev181010.mapSeverity(problem.getProblemSeverity())); + } + } + } catch (Exception e) { + LOG.warn("DBRead {} NetworkElementCurrentProblems12 not supported. Message '{}' ", getMountpoint(), + e.getMessage()); + } + return resultList; + } + + /*--------------------------------------------------------------- + * Device Monitor + */ + + @Override + public boolean checkIfConnectionToMediatorIsOk() { + synchronized (dmLock) { + return optionalNe != null; + } + } + + /* + * New implementation to interpret status with empty LTP List as notConnected => return false + * 30.10.2018 Since this behavior is very specific and implicit for specific NE Types + * it needs to be activated by extension or configuration. Change to be disabled at the moment + */ + @Override + public boolean checkIfConnectionToNeIsOk() { + return true; + } + + /*--------------------------------------------------------------- + * Synchronization + */ + + + /*--------------------------------------------------------------- + * Equipment related functions + */ + + @Override + public @NonNull InventoryInformationDcae getInventoryInformation(String layerProtocolFilter) { + LOG.debug("request inventory information. filter: {}" + layerProtocolFilter); + return this.equipment.getInventoryInformation(getFilteredInterfaceUuidsAsStringList(layerProtocolFilter)); + } + + @Override + public InventoryInformationDcae getInventoryInformation() { + return getInventoryInformation(null); + } + + protected List<String> getFilteredInterfaceUuidsAsStringList(String layerProtocolFilter) { + List<String> uuids = new ArrayList<>(); + + LOG.debug("request inventory information. filter: {}" + layerProtocolFilter); + if (optionalNe != null) { + // uuids + for (Lp lp : this.interfaceList) { + if (layerProtocolFilter == null || + layerProtocolFilter.isEmpty() || + layerProtocolFilter.equals(Helper.nnGetLayerProtocolName(lp.getLayerProtocolName()).getValue())) { + uuids.add(Helper.nnGetUniversalId(lp.getUuid()).getValue()); + } + } + } + LOG.debug("uuids found: {}", uuids); + return uuids; + } + + + /*--------------------------------------------------------------- + * Performancemanagement specific interface + */ + + @Override + public void resetPMIterator() { + synchronized (pmLock) { + interfaceListIterator = interfaceList.iterator(); + } + LOG.debug("PM reset iterator"); + } + + @SuppressWarnings("null") + @Override + public boolean hasNext() { + boolean res; + synchronized (pmLock) { + res = interfaceListIterator != null ? interfaceListIterator.hasNext() : false; + } + LOG.debug("PM hasNext LTP {}", res); + return res; + } + + @SuppressWarnings("null") + @Override + public void next() { + synchronized (pmLock) { + if (interfaceListIterator == null) { + pmLp = null; + LOG.debug("PM next LTP null"); + } else { + pmLp = interfaceListIterator.next(); + LOG.debug("PM next LTP {}", Helper.nnGetLayerProtocolName(pmLp.getLayerProtocolName()).getValue()); + } + } + } + + @SuppressWarnings("null") + @Override + public String pmStatusToString() { + StringBuilder res = new StringBuilder(); + synchronized (pmLock) { + res.append(pmLp == null ? "no interface" : Helper.nnGetLayerProtocolName(pmLp.getLayerProtocolName()).getValue()); + for (Lp lp : getInterfaceList()) { + res.append("IF:"); + res.append(Helper.nnGetLayerProtocolName(lp.getLayerProtocolName()).getValue()); + res.append(" "); + } + } + return res.toString(); + } + + @Override + public void doRegisterEventListener(MountPoint mountPoint) { + //Do nothing + } + + @SuppressWarnings("unchecked") + @Override + public <L extends NetworkElementService> Optional<L> getService(Class<L> clazz) { + return clazz.isInstance(this) ? Optional.of((L)this) : Optional.empty(); + } + + @Override + public Optional<PerformanceDataLtp> getLtpHistoricalPerformanceData() { + return Optional.empty(); + } } diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Basic.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Basic.java index fb73b823e..b152824ee 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Basic.java +++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Basic.java @@ -104,7 +104,7 @@ public class ONFCoreNetworkElement12Basic extends ONFCoreNetworkElement12Base { int problems = faultService.removeAllCurrentProblemsOfNode(nodeId); FaultData resultList = readAllCurrentProblemsOfNode(); faultService.initCurrentProblemStatus(nodeId, resultList); - LOG.info("Resync mountpoint {} for device {}. Removed {}. Current problems: {}", getMountPointNodeName(), + LOG.info("Resync mountpoint {} for device {}. Removed {}. Current problems: {}", getMountpoint(), getUuId(), problems, resultList.size()); } } @@ -130,8 +130,8 @@ public class ONFCoreNetworkElement12Basic extends ONFCoreNetworkElement12Base { */ @Override public synchronized void initialReadFromNetworkElement() { - // optionalNe.getLtp().get(0).getLp(); - LOG.debug("Get info about {}", getMountPointNodeName()); + + LOG.debug("Get info about {}", getMountpoint()); int problems = faultService.removeAllCurrentProblemsOfNode(nodeId); LOG.debug("Removed all {} problems from database at registration", problems); @@ -150,7 +150,7 @@ public class ONFCoreNetworkElement12Basic extends ONFCoreNetworkElement12Base { faultService.initCurrentProblemStatus(nodeId, resultList); equipmentService.writeEquipment(equipment.getEquipmentData()); - LOG.info("Found info at {} for device {} number of problems: {}", getMountPointNodeName(), getUuId(), + LOG.info("Found info at {} for device {} number of problems: {}", getMountpoint(), getUuId(), resultList.size()); } @@ -166,9 +166,6 @@ public class ONFCoreNetworkElement12Basic extends ONFCoreNetworkElement12Base { public void register() { // Setup microwaveEventListener for notification service - // MicrowaveEventListener microwaveEventListener = new - // MicrowaveEventListener(mountPointNodeName, websocketmanagerService, - // xmlMapper, databaseClientEvents); doRegisterEventListener(acessor.getMountpoint()); // Register netconf stream @@ -201,6 +198,7 @@ public class ONFCoreNetworkElement12Basic extends ONFCoreNetworkElement12Base { @Override public void close() throws Exception { + // Close to be implemented } diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Microwave.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Microwave.java index c90e76efc..505e0ca12 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Microwave.java +++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Microwave.java @@ -110,7 +110,7 @@ public class ONFCoreNetworkElement12Microwave extends ONFCoreNetworkElement12Bas int problems = microwaveEventListener.removeAllCurrentProblemsOfNode(nodeId); FaultData resultList = readAllCurrentProblemsOfNode(); microwaveEventListener.initCurrentProblemStatus(nodeId, resultList); - LOG.info("Resync mountpoint {} for device {}. Removed {}. Current problems: {}", getMountPointNodeName(), + LOG.info("Resync mountpoint {} for device {}. Removed {}. Current problems: {}", getMountpoint(), getUuId(), problems, resultList.size()); } } @@ -187,8 +187,7 @@ public class ONFCoreNetworkElement12Microwave extends ONFCoreNetworkElement12Bas */ @Override public synchronized void initialReadFromNetworkElement() { - // optionalNe.getLtp().get(0).getLp(); - LOG.debug("Get info about {}", getMountPointNodeName()); + LOG.debug("Get info about {}", getMountpoint()); int problems = microwaveEventListener.removeAllCurrentProblemsOfNode(nodeId); LOG.debug("Removed all {} problems from database at registration", problems); @@ -207,7 +206,7 @@ public class ONFCoreNetworkElement12Microwave extends ONFCoreNetworkElement12Bas microwaveEventListener.initCurrentProblemStatus(nodeId, resultList); equipmentService.writeEquipment(equipment.getEquipmentData()); - LOG.info("Found info at {} for device {} number of problems: {}", getMountPointNodeName(), getUuId(), + LOG.info("Found info at {} for device {} number of problems: {}", getMountpoint(), getUuId(), resultList.size()); } @@ -220,7 +219,7 @@ public class ONFCoreNetworkElement12Microwave extends ONFCoreNetworkElement12Bas */ private void debugResultList(String uuid, FaultData resultList, int idxStart) { if (LOG.isDebugEnabled()) { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); int idx = 0; for (int t = idxStart; t < resultList.size(); t++) { sb.append(idx++); @@ -228,7 +227,7 @@ public class ONFCoreNetworkElement12Microwave extends ONFCoreNetworkElement12Bas sb.append(resultList.get(t)); sb.append('}'); } - LOG.debug("Found problems {} {}", uuid, sb.toString()); + LOG.debug("Found problems {} {}", uuid, sb); } } @@ -290,7 +289,7 @@ public class ONFCoreNetworkElement12Microwave extends ONFCoreNetworkElement12Bas if (valueName.contentEquals("capability")) { capability = e.getValue(); if (capability != null) { - int idx = capability.indexOf("?"); + int idx = capability.indexOf('?'); if (idx != -1) { capability = capability.substring(0, idx); } @@ -310,7 +309,7 @@ public class ONFCoreNetworkElement12Microwave extends ONFCoreNetworkElement12Bas // "2017-03-24", "mw-air-interface-pac").intern(); LOG.info("LpExtension capability={} revision={} conditionalPackage={}", capability, revision, conditionalPackage); - if (!capability.isEmpty() && !revision.isEmpty() && !conditionalPackage.isEmpty()) { + if (capability != null && !capability.isEmpty() && !revision.isEmpty() && !conditionalPackage.isEmpty()) { try { QName qName = QName.create(capability, revision, conditionalPackage); res = this.microwaveModel.getClassForLtpExtension(qName); diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElementBase.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElementBase.java index 80df3ce5f..5bbeb74ef 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElementBase.java +++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElementBase.java @@ -57,7 +57,6 @@ public abstract class ONFCoreNetworkElementBase implements AutoCloseable, ONFCor private final String mountPointNodeName; private final NodeId nodeId; private final DataBroker netconfNodeDataBroker; - private final Capabilities capabilities; private final NetconfAccessor acessor; protected ONFCoreNetworkElementBase(NetconfAccessor acessor) { @@ -65,7 +64,6 @@ public abstract class ONFCoreNetworkElementBase implements AutoCloseable, ONFCor this.mountPointNodeName = acessor.getNodeId().getValue(); this.nodeId = acessor.getNodeId(); this.netconfNodeDataBroker = acessor.getDataBroker(); - this.capabilities = acessor.getCapabilites(); this.acessor = acessor; } @@ -79,73 +77,14 @@ public abstract class ONFCoreNetworkElementBase implements AutoCloseable, ONFCor public String getMountPointNodeName() { return mountPointNodeName; } - + /** * @return the netconfNodeDataBroker */ public DataBroker getNetconfNodeDataBroker() { return netconfNodeDataBroker; } - - /** - * @return the capabilities - */ - /* - * public Capabilities getCapabilities() { return capabilities; } - */ - - /** - * Update devicetype and let all other field empty - * @param deviceType that should be updated - * @return NetworkElementConnectionEntity with related parameter - */ - /* - * public static NetworkElementConnectionEntity - * getNetworkConnectionDeviceTpe(NetworkElementDeviceType deviceType) { - * NetworkElementConnectionBuilder eb = new NetworkElementConnectionBuilder(); - * eb.setDeviceType(deviceType); return eb.build(); } - */ - - /** - * Provide device specific data - * @param nodeId mountpoint id - * @param nNode data - * @return NetworkElementConnectionEntity specific information - */ - /* - * public static NetworkElementConnectionEntity getNetworkConnection(String - * nodeId, @Nonnull NetconfNode nNode) { - * - * NetworkElementConnectionBuilder eb = new NetworkElementConnectionBuilder(); - * // -- basics - * eb.setId(nodeId).setNodeId(nodeId).setDeviceType(NetworkElementDeviceType. - * Unknown).setIsRequired(false); - * - * // -- connection status ConnectionLogStatus status = - * InternalConnectionStatus.statusFromNodeStatus(nNode.getConnectionStatus()); - * eb.setStatus(status); - * - * // -- capabilites Capabilities availableCapabilities = - * Capabilities.getAvailableCapabilities(nNode); Capabilities - * unAvailableCapabilities = Capabilities.getUnavailableCapabilities(nNode); - * eb.setCoreModelCapability(availableCapabilities.getRevisionForNamespace( - * NetworkElement.QNAME)); - * - * NodeDetailsBuilder nodeDetails = new NodeDetailsBuilder() - * .setAvailableCapabilities(availableCapabilities.getCapabilities()) - * .setUnavailableCapabilities(unAvailableCapabilities.getCapabilities()); - * eb.setNodeDetails(nodeDetails.build()); // -- host information Host host = - * nNode.getHost(); PortNumber portNumber = nNode.getPort(); if (host != null && - * portNumber != null) { - * eb.setHost(host.stringValue()).setPort(portNumber.getValue().longValue()); } - * - * Credentials credentials = nNode.getCredentials(); if (credentials instanceof - * LoginPassword) { LoginPassword loginPassword = (LoginPassword) credentials; - * eb.setUsername(loginPassword.getUsername()).setPassword(loginPassword. - * getPassword()); } return eb.build(); } - */ - - + @Override public void warmstart() { int problems = removeAllCurrentProblemsOfNode(); diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/notifications/NotificationWorker.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/notifications/NotificationWorker.java index 44fad1b3a..5de65642b 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/notifications/NotificationWorker.java +++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/notifications/NotificationWorker.java @@ -54,7 +54,7 @@ public class NotificationWorker<T> implements AutoCloseable { @Override public void close() throws Exception { - // TODO Auto-generated method stub + // Auto-generated method stub } private static class Worker<T> implements Runnable { diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/util/ONFLayerProtocolName.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/util/ONFLayerProtocolName.java index 3fa52e110..f9e5ea688 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/util/ONFLayerProtocolName.java +++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/util/ONFLayerProtocolName.java @@ -23,14 +23,14 @@ import org.slf4j.LoggerFactory; public enum ONFLayerProtocolName { - MWAirInterface("MWPS"), //V1.0 + V1.2 - EthernetContainer10("ETH-CTP"), //V1.0 - EthernetContainer12("ETC"), //V1.2 + V1.2.1.1 - EthernetPhysical("ETY"), //V1.2 - TDMContainer("TDM"), //V1.2 - Structure("MWS"), //V1.0 + V1.2 - Ethernet("ETH"), //V1.2 - Unknown(""); + MWAIRINTERFACE("MWPS"), //V1.0 + V1.2 + ETHERNETCONTAINER10("ETH-CTP"), //V1.0 + ETHERNETCONTAINER12("ETC"), //V1.2 + V1.2.1.1 + ETHERNETPHYSICAL("ETY"), //V1.2 + TDMCONTAINER("TDM"), //V1.2 + STRUCTURE("MWS"), //V1.0 + V1.2 + ETHERNET("ETH"), //V1.2 + UNKNOWN(""); private static final Logger LOG = LoggerFactory.getLogger(ONFLayerProtocolName.class); @@ -51,7 +51,7 @@ public enum ONFLayerProtocolName { } } LOG.info("Can not map {}. Use Unknown",onfName.getValue() ); - return Unknown; + return UNKNOWN; } public String getValue() { diff --git a/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev170324.java b/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev170324.java index 7ac2944dd..99e426adc 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev170324.java +++ b/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev170324.java @@ -136,7 +136,7 @@ public class TestWrapperMicrowaveModelRev170324 { LogicalDatastoreType.OPERATIONAL, mwAirInterfaceIID)).thenReturn(airInterfaceCurrentProblems); WrapperMicrowaveModelRev170324 wrapperMicrowaveModelRev170324 = new WrapperMicrowaveModelRev170324(accessor, serviceProvider); - wrapperMicrowaveModelRev170324.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.MWAirInterface, null, uid, resultList); + wrapperMicrowaveModelRev170324.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.MWAIRINTERFACE, null, uid, resultList); } @Test @@ -145,7 +145,7 @@ public class TestWrapperMicrowaveModelRev170324 { LogicalDatastoreType.OPERATIONAL, mwAirInterfaceIID)).thenReturn(null); WrapperMicrowaveModelRev170324 wrapperMicrowaveModelRev170324 = new WrapperMicrowaveModelRev170324(accessor, serviceProvider); - wrapperMicrowaveModelRev170324.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.MWAirInterface, null, uid, resultList); + wrapperMicrowaveModelRev170324.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.MWAIRINTERFACE, null, uid, resultList); } @Test @@ -154,7 +154,7 @@ public class TestWrapperMicrowaveModelRev170324 { LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID)).thenReturn(ethernetContainerCurrentProblems); WrapperMicrowaveModelRev170324 wrapperMicrowaveModelRev170324 = new WrapperMicrowaveModelRev170324(accessor, serviceProvider); - wrapperMicrowaveModelRev170324.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.EthernetContainer12, null, uid, resultList); + wrapperMicrowaveModelRev170324.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.ETHERNETCONTAINER12, null, uid, resultList); } @Test @@ -163,7 +163,7 @@ public class TestWrapperMicrowaveModelRev170324 { LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID)).thenReturn(null); WrapperMicrowaveModelRev170324 wrapperMicrowaveModelRev170324 = new WrapperMicrowaveModelRev170324(accessor, serviceProvider); - wrapperMicrowaveModelRev170324.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.EthernetContainer12, null, uid, resultList); + wrapperMicrowaveModelRev170324.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.ETHERNETCONTAINER12, null, uid, resultList); } @Test @@ -183,7 +183,7 @@ public class TestWrapperMicrowaveModelRev170324 { LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID)).thenReturn(tdmInterfaceCurrentProblems); WrapperMicrowaveModelRev170324 wrapperMicrowaveModelRev170324 = new WrapperMicrowaveModelRev170324(accessor, serviceProvider); - wrapperMicrowaveModelRev170324.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.TDMContainer, null, uid, resultList); + wrapperMicrowaveModelRev170324.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.TDMCONTAINER, null, uid, resultList); } @@ -202,7 +202,7 @@ public class TestWrapperMicrowaveModelRev170324 { LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID)).thenReturn(hybridMwStructureCurrentProblems); WrapperMicrowaveModelRev170324 wrapperMicrowaveModelRev170324 = new WrapperMicrowaveModelRev170324(accessor, serviceProvider); - wrapperMicrowaveModelRev170324.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.Structure, MwHybridMwStructurePac.class, uid, resultList); + wrapperMicrowaveModelRev170324.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.STRUCTURE, MwHybridMwStructurePac.class, uid, resultList); } @@ -221,7 +221,7 @@ public class TestWrapperMicrowaveModelRev170324 { LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID)).thenReturn(hybridMwStructureCurrentProblems); WrapperMicrowaveModelRev170324 wrapperMicrowaveModelRev170324 = new WrapperMicrowaveModelRev170324(accessor, serviceProvider); - wrapperMicrowaveModelRev170324.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.Structure, MwAirInterfaceDiversityPac.class, uid, resultList); + wrapperMicrowaveModelRev170324.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.STRUCTURE, MwAirInterfaceDiversityPac.class, uid, resultList); } @@ -240,7 +240,7 @@ public class TestWrapperMicrowaveModelRev170324 { LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID)).thenReturn(hybridMwStructureCurrentProblems); WrapperMicrowaveModelRev170324 wrapperMicrowaveModelRev170324 = new WrapperMicrowaveModelRev170324(accessor, serviceProvider); - wrapperMicrowaveModelRev170324.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.Structure, MwPureEthernetStructurePac.class, uid, resultList); + wrapperMicrowaveModelRev170324.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.STRUCTURE, MwPureEthernetStructurePac.class, uid, resultList); } @@ -248,7 +248,7 @@ public class TestWrapperMicrowaveModelRev170324 { public void testNullStructureWithProblems() throws Exception { WrapperMicrowaveModelRev170324 wrapperMicrowaveModelRev170324 = new WrapperMicrowaveModelRev170324(accessor, serviceProvider); - wrapperMicrowaveModelRev170324.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.Structure, null, uid, resultList); + wrapperMicrowaveModelRev170324.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.STRUCTURE, null, uid, resultList); } @@ -288,6 +288,6 @@ public class TestWrapperMicrowaveModelRev170324 { Lp lp = new LpBuilder().setUuid(uid).build(); WrapperMicrowaveModelRev170324 wrapperMicrowaveModelRev170324 = new WrapperMicrowaveModelRev170324(accessor, serviceProvider); - wrapperMicrowaveModelRev170324.getLtpHistoricalPerformanceData(ONFLayerProtocolName.Ethernet, lp); + wrapperMicrowaveModelRev170324.getLtpHistoricalPerformanceData(ONFLayerProtocolName.ETHERNET, lp); } } diff --git a/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev180907.java b/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev180907.java index ee0f727dd..64c857173 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev180907.java +++ b/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev180907.java @@ -133,7 +133,7 @@ public class TestWrapperMicrowaveModelRev180907 { LogicalDatastoreType.OPERATIONAL, mwAirInterfaceIID)).thenReturn(airInterfaceCurrentProblems); WrapperMicrowaveModelRev180907 wrapperMicrowaveModelRev180907 = new WrapperMicrowaveModelRev180907(accessor, serviceProvider); - wrapperMicrowaveModelRev180907.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.MWAirInterface, null, uid, resultList); + wrapperMicrowaveModelRev180907.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.MWAIRINTERFACE, null, uid, resultList); } @Test @@ -142,7 +142,7 @@ public class TestWrapperMicrowaveModelRev180907 { LogicalDatastoreType.OPERATIONAL, mwAirInterfaceIID)).thenReturn(null); WrapperMicrowaveModelRev180907 wrapperMicrowaveModelRev180907 = new WrapperMicrowaveModelRev180907(accessor, serviceProvider); - wrapperMicrowaveModelRev180907.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.MWAirInterface, null, uid, resultList); + wrapperMicrowaveModelRev180907.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.MWAIRINTERFACE, null, uid, resultList); } @Test @@ -151,7 +151,7 @@ public class TestWrapperMicrowaveModelRev180907 { LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID)).thenReturn(ethernetContainerCurrentProblems); WrapperMicrowaveModelRev180907 wrapperMicrowaveModelRev180907 = new WrapperMicrowaveModelRev180907(accessor, serviceProvider); - wrapperMicrowaveModelRev180907.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.EthernetContainer12, null, uid, resultList); + wrapperMicrowaveModelRev180907.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.ETHERNETCONTAINER12, null, uid, resultList); } @Test @@ -160,7 +160,7 @@ public class TestWrapperMicrowaveModelRev180907 { LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID)).thenReturn(null); WrapperMicrowaveModelRev180907 wrapperMicrowaveModelRev180907 = new WrapperMicrowaveModelRev180907(accessor, serviceProvider); - wrapperMicrowaveModelRev180907.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.EthernetContainer12, null, uid, resultList); + wrapperMicrowaveModelRev180907.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.ETHERNETCONTAINER12, null, uid, resultList); } @Test @@ -180,7 +180,7 @@ public class TestWrapperMicrowaveModelRev180907 { LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID)).thenReturn(tdmInterfaceCurrentProblems); WrapperMicrowaveModelRev180907 wrapperMicrowaveModelRev180907 = new WrapperMicrowaveModelRev180907(accessor, serviceProvider); - wrapperMicrowaveModelRev180907.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.TDMContainer, null, uid, resultList); + wrapperMicrowaveModelRev180907.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.TDMCONTAINER, null, uid, resultList); } @@ -199,7 +199,7 @@ public class TestWrapperMicrowaveModelRev180907 { LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID)).thenReturn(hybridMwStructureCurrentProblems); WrapperMicrowaveModelRev180907 wrapperMicrowaveModelRev180907 = new WrapperMicrowaveModelRev180907(accessor, serviceProvider); - wrapperMicrowaveModelRev180907.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.Structure, MwHybridMwStructurePac.class, uid, resultList); + wrapperMicrowaveModelRev180907.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.STRUCTURE, MwHybridMwStructurePac.class, uid, resultList); } @@ -218,7 +218,7 @@ public class TestWrapperMicrowaveModelRev180907 { LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID)).thenReturn(hybridMwStructureCurrentProblems); WrapperMicrowaveModelRev180907 wrapperMicrowaveModelRev180907 = new WrapperMicrowaveModelRev180907(accessor, serviceProvider); - wrapperMicrowaveModelRev180907.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.Structure, MwAirInterfaceDiversityPac.class, uid, resultList); + wrapperMicrowaveModelRev180907.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.STRUCTURE, MwAirInterfaceDiversityPac.class, uid, resultList); } @@ -237,7 +237,7 @@ public class TestWrapperMicrowaveModelRev180907 { LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID)).thenReturn(hybridMwStructureCurrentProblems); WrapperMicrowaveModelRev180907 wrapperMicrowaveModelRev180907 = new WrapperMicrowaveModelRev180907(accessor, serviceProvider); - wrapperMicrowaveModelRev180907.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.Structure, MwPureEthernetStructurePac.class, uid, resultList); + wrapperMicrowaveModelRev180907.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.STRUCTURE, MwPureEthernetStructurePac.class, uid, resultList); } @@ -245,7 +245,7 @@ public class TestWrapperMicrowaveModelRev180907 { public void testNullStructureWithProblems() throws Exception { WrapperMicrowaveModelRev180907 wrapperMicrowaveModelRev180907 = new WrapperMicrowaveModelRev180907(accessor, serviceProvider); - wrapperMicrowaveModelRev180907.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.Structure, null, uid, resultList); + wrapperMicrowaveModelRev180907.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.STRUCTURE, null, uid, resultList); } @@ -285,6 +285,6 @@ public class TestWrapperMicrowaveModelRev180907 { Lp lp = new LpBuilder().setUuid(uid).build();; WrapperMicrowaveModelRev180907 wrapperMicrowaveModelRev180907 = new WrapperMicrowaveModelRev180907(accessor, serviceProvider); - wrapperMicrowaveModelRev180907.getLtpHistoricalPerformanceData(ONFLayerProtocolName.MWAirInterface, lp); + wrapperMicrowaveModelRev180907.getLtpHistoricalPerformanceData(ONFLayerProtocolName.MWAIRINTERFACE, lp); } } diff --git a/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev181010.java b/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev181010.java index 074948ba1..32d9849d8 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev181010.java +++ b/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev181010.java @@ -138,7 +138,7 @@ public class TestWrapperMicrowaveModelRev181010 { LogicalDatastoreType.OPERATIONAL, mwAirInterfaceIID)).thenReturn(airInterfaceCurrentProblems); WrapperMicrowaveModelRev181010 wrapperMicrowaveModelRev181010 = new WrapperMicrowaveModelRev181010(accessor, serviceProvider); - wrapperMicrowaveModelRev181010.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.MWAirInterface, null, uid, resultList); + wrapperMicrowaveModelRev181010.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.MWAIRINTERFACE, null, uid, resultList); } @Test @@ -147,7 +147,7 @@ public class TestWrapperMicrowaveModelRev181010 { LogicalDatastoreType.OPERATIONAL, mwAirInterfaceIID)).thenReturn(null); WrapperMicrowaveModelRev181010 wrapperMicrowaveModelRev181010 = new WrapperMicrowaveModelRev181010(accessor, serviceProvider); - wrapperMicrowaveModelRev181010.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.MWAirInterface, null, uid, resultList); + wrapperMicrowaveModelRev181010.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.MWAIRINTERFACE, null, uid, resultList); } @Test @@ -156,7 +156,7 @@ public class TestWrapperMicrowaveModelRev181010 { LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID)).thenReturn(ethernetContainerCurrentProblems); WrapperMicrowaveModelRev181010 wrapperMicrowaveModelRev181010 = new WrapperMicrowaveModelRev181010(accessor, serviceProvider); - wrapperMicrowaveModelRev181010.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.EthernetContainer12, null, uid, resultList); + wrapperMicrowaveModelRev181010.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.ETHERNETCONTAINER12, null, uid, resultList); } @Test @@ -165,7 +165,7 @@ public class TestWrapperMicrowaveModelRev181010 { LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID)).thenReturn(null); WrapperMicrowaveModelRev181010 wrapperMicrowaveModelRev181010 = new WrapperMicrowaveModelRev181010(accessor, serviceProvider); - wrapperMicrowaveModelRev181010.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.EthernetContainer12, null, uid, resultList); + wrapperMicrowaveModelRev181010.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.ETHERNETCONTAINER12, null, uid, resultList); } @Test @@ -185,7 +185,7 @@ public class TestWrapperMicrowaveModelRev181010 { LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID)).thenReturn(tdmInterfaceCurrentProblems); WrapperMicrowaveModelRev181010 wrapperMicrowaveModelRev181010 = new WrapperMicrowaveModelRev181010(accessor, serviceProvider); - wrapperMicrowaveModelRev181010.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.TDMContainer, null, uid, resultList); + wrapperMicrowaveModelRev181010.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.TDMCONTAINER, null, uid, resultList); } @@ -204,7 +204,7 @@ public class TestWrapperMicrowaveModelRev181010 { LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID)).thenReturn(hybridMwStructureCurrentProblems); WrapperMicrowaveModelRev181010 wrapperMicrowaveModelRev181010 = new WrapperMicrowaveModelRev181010(accessor, serviceProvider); - wrapperMicrowaveModelRev181010.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.Structure, MwHybridMwStructurePac.class, uid, resultList); + wrapperMicrowaveModelRev181010.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.STRUCTURE, MwHybridMwStructurePac.class, uid, resultList); } @@ -223,7 +223,7 @@ public class TestWrapperMicrowaveModelRev181010 { LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID)).thenReturn(hybridMwStructureCurrentProblems); WrapperMicrowaveModelRev181010 wrapperMicrowaveModelRev181010 = new WrapperMicrowaveModelRev181010(accessor, serviceProvider); - wrapperMicrowaveModelRev181010.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.Structure, MwAirInterfaceDiversityPac.class, uid, resultList); + wrapperMicrowaveModelRev181010.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.STRUCTURE, MwAirInterfaceDiversityPac.class, uid, resultList); } @@ -242,7 +242,7 @@ public class TestWrapperMicrowaveModelRev181010 { LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID)).thenReturn(hybridMwStructureCurrentProblems); WrapperMicrowaveModelRev181010 wrapperMicrowaveModelRev181010 = new WrapperMicrowaveModelRev181010(accessor, serviceProvider); - wrapperMicrowaveModelRev181010.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.Structure, MwPureEthernetStructurePac.class, uid, resultList); + wrapperMicrowaveModelRev181010.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.STRUCTURE, MwPureEthernetStructurePac.class, uid, resultList); } @@ -250,7 +250,7 @@ public class TestWrapperMicrowaveModelRev181010 { public void testNullStructureWithProblems() throws Exception { WrapperMicrowaveModelRev181010 wrapperMicrowaveModelRev181010 = new WrapperMicrowaveModelRev181010(accessor, serviceProvider); - wrapperMicrowaveModelRev181010.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.Structure, null, uid, resultList); + wrapperMicrowaveModelRev181010.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.STRUCTURE, null, uid, resultList); } @@ -290,6 +290,6 @@ public class TestWrapperMicrowaveModelRev181010 { Lp lp = new LpBuilder().setUuid(uid).build(); WrapperMicrowaveModelRev181010 wrapperMicrowaveModelRev181010 = new WrapperMicrowaveModelRev181010(accessor, serviceProvider); - wrapperMicrowaveModelRev181010.getLtpHistoricalPerformanceData(ONFLayerProtocolName.MWAirInterface, lp); + wrapperMicrowaveModelRev181010.getLtpHistoricalPerformanceData(ONFLayerProtocolName.MWAIRINTERFACE, lp); } } diff --git a/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/TestDevMgrPropertiesFile.java b/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/TestDevMgrPropertiesFile.java index ff15f7991..0a458d805 100644 --- a/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/TestDevMgrPropertiesFile.java +++ b/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/TestDevMgrPropertiesFile.java @@ -46,16 +46,14 @@ public class TestDevMgrPropertiesFile { private static final Logger LOG = LoggerFactory.getLogger(ArchiveCleanService.class); - private static final File FILENAME = new File("test.properties"); - private static final File AAIPROP_FILE=new File("aaiclient.properties"); + private static final File FILENAME = new File("testdevmgrpropertiesfile.properties"); + private static final File AAIPROP_FILE=new File("testdevmgrpropertiesfileaaiclient.properties"); private int hasChanged; @Before public void init() { - //if (! LOG.isDebugEnabled()) { - delete(FILENAME); - delete(AAIPROP_FILE); - //} + delete(FILENAME); + delete(AAIPROP_FILE); } @After public void deinit() { @@ -63,14 +61,13 @@ public class TestDevMgrPropertiesFile { } @Test - public void test1() { + public void testBasicConfiguration() { writeFile(FILENAME, this.getContent1()); writeFile(AAIPROP_FILE, this.getAaiPropertiesConfig()); - System.out.println("Read and verify"); - ConfigurationFileRepresentation cfg = new ConfigurationFileRepresentation(FILENAME.getPath()); - ConfigurationFileRepresentation cfg2 = cfg; + LOG.info("Read and verify"); + ConfigurationFileRepresentation cfg2 = new ConfigurationFileRepresentation(FILENAME.getPath()); AaiConfig aaiConfig = new AaiConfig(cfg2); assertNotNull(aaiConfig); @@ -81,34 +78,24 @@ public class TestDevMgrPropertiesFile { ToggleAlarmConfig toggleAlarmConfig = new ToggleAlarmConfig(cfg2); assertNotNull(toggleAlarmConfig); - System.out.println("Verify\n"+aaiConfig+"\n"); - @SuppressWarnings("unused") - boolean res; - /* - res = cfg.getAai().equals(AaiConfig.getDefaultConfiguration()); - res = cfg.getDcae().equals(DcaeConfig.getDefaultConfiguration()); - res = cfg.getPm().equals(PmConfig.getDefaultConfiguration()); - res = cfg.getEs().equals(EsConfig.getDefaultConfiguration()); - res = cfg.getToggleAlarm().equals(ToggleAlarmConfig.getDefaultConfiguration()); - - res = cfg.getAai().hashCode() == AaiConfig.getDefaultConfiguration().hashCode(); - res = cfg.getDcae().hashCode() == DcaeConfig.getDefaultConfiguration().hashCode(); - res = cfg.getPm().hashCode() == PmConfig.getDefaultConfiguration().hashCode(); - res = cfg.getEs().hashCode() == EsConfig.getDefaultConfiguration().hashCode(); - res = cfg.getToggleAlarm().hashCode() == ToggleAlarmConfig.getDefaultConfiguration().hashCode(); - */ + LOG.info("Verify {} ", aaiConfig); } //-- Observer not working with all testcases, because config does not support different file types. @Test - public void test2() { + public void testChangeConfiguration() { + + LOG.info("Read and verify"); - hasChanged=0; writeFile(FILENAME, this.getContent1()); writeFile(AAIPROP_FILE, this.getAaiPropertiesConfig()); - System.out.println("Read and verify"); ConfigurationFileRepresentation cfg2 = new ConfigurationFileRepresentation(FILENAME.getPath()); + hasChanged = 0; + cfg2.registerConfigChangedListener(() -> { + hasChanged++; + LOG.info("file changed listener triggered: {}",hasChanged); + }); AaiConfig aaiConfig = new AaiConfig(cfg2); assertNotNull(aaiConfig); @@ -119,25 +106,18 @@ public class TestDevMgrPropertiesFile { ToggleAlarmConfig toggleAlarmConfig = new ToggleAlarmConfig(cfg2); assertNotNull(toggleAlarmConfig); - cfg2.registerConfigChangedListener(() -> { - hasChanged++; - System.out.println("file changed listener triggered: "+hasChanged); - }); - - sleep(1000); - System.out.println("Write new content. Changes "+hasChanged); + LOG.info("Write new content. Changes {}",hasChanged); writeFile(FILENAME, this.getContent2()); - sleep(1000); int i=10; while(hasChanged == 0 && i-- > 0) { - System.out.println("Wait for Change indication."); + LOG.info("Wait for Change indication."); sleep(1000); } - System.out.println("Changes "+hasChanged); + LOG.info("Changes {}",hasChanged); - assertTrue("fileChanged counter"+hasChanged, hasChanged > 0); - System.out.println("Test done"); + assertTrue("fileChanged counter "+hasChanged, hasChanged > 0); + LOG.info("Test done"); } |