Uploaded image for project: 'Service Design and Creation'
  1. Service Design and Creation
  2. SDC-2345

Enhance JTosca validation issue API

XMLWordPrintable

      The Problem

      The current API confusingly uses a global but thread local collection in org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder for storing validation output from tosca parsing. Even worse that this global variable is effectively used as the API for the jtosca users.

      This is bad for

      1. Needlessly and undocumentedly pushes the user code for certain concurrency pattern towards JTosca although the parser is not concurrent at all. 
      2. If the users have not not noticed this undocumented API requirement to the user and use some other concurrency pattern, strange things can happen with validation issues.
      3. The whole thing is just an extra confusion over the logical point that validation issues are just another (perfectly normal) output from the parsing process and should be clearly treated as such and not hidden in some global variable.

      The Solution

      As this is an API change, this should be discussed a bit more before jumping to implementation if there are more hidden requirements. Please give your comments to this ticket.

      The simplest and most usable solution to the user seems to have the validation issues available from at least ToscaTemplate object and possibly from the lower level objects as well. Internally this will need some extra bookkeeping during the parsing process as validation issues are no longer available in a global. 

            Unassigned Unassigned
            t.puha t.puha
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: