1 ## Library for parsing yaml files
3 ###### Requirements specified under the SDC jira ticket: [SDC-2094](https://jira.onap.org/browse/SDC-2094) - R4 5G U/C SDC: FM Meta Data GUI Display from PNF Onboarded Package
8 GABController is a tool for searching inside the [Yaml](https://yaml.org/) file content. At this moment is completely independent from any ONAPs component and can be used in any case where searching full json-path format keywords is needed. To use it, two things are required from the user: yaml document and list of fields to filter the results and nothing more.
11 GABController is provided as a standard JAVA archive and can be imported in any application by adding its JAR name into the classpath or using maven dependency management:
14 <groupId>org.onap.sdc.common</groupId>
15 <artifactId>onap-generic-artifact-browser-service</artifactId>
16 <version>${project.version}</version>
17 <scope>compile</scope>
20 The most usable class is GABServiceImpl implements GABService and expose single method for searching paths inside the [Yaml](https://yaml.org/) file.
22 GABService operates on 2 different types: GABQuery as an input and GABResults as an output model.
23 ###### Example 1 - searching for multiple keywords:
25 /* First You need to create GABService */
26 GABService gabService = new GABServiceImpl();
28 /* Next step is to prepare your query model.
29 * In this example we will use file:
31 * and will search for keywords:
32 * 'event.structure.commonEventHeader' and 'event.presence'
34 GABQuery gabQuery = new GABQuery(Arrays.asList(
35 "event.structure.commonEventHeader","event.presence"), "/root/test.yml", GABQueryType.PATH);
37 /* And at last ask for the results */
38 GABResults gabResults = gabService.searchFor(gabQuery);
40 /* And thats it. Please notice that IOException can be thrown in some cases.
41 * For more info please follow specification inside the JavaDocs.
48 - lombok: 1.16.16 - [Doc](https://projectlombok.org/features/all)
49 - snakeyaml: 1.21 - [Doc](https://bitbucket.org/asomov/snakeyaml)
50 - gson: 2.8.5 - [Doc](https://github.com/google/gson)
51 - jsurfer: 1.4.3 - [Doc](https://github.com/jsurfer/JsonSurfer)
52 - guava: 18.0 - [Doc](https://github.com/google/guava/wiki/Release18)
53 - commons-io: 2.6 - [Doc](https://commons.apache.org/proper/commons-io/)
56 - junit: 5.4.0 - [Doc](https://junit.org/junit5/docs/current/api/)
59 Generic Artifact Browser has got two independent layers of tests:
60 1. Unit testing using JUnit 5 (integrated in every component)
61 2. Component testing using Cucumber 2.3 (component-tests module)
63 All layers are currently executed during the maven build of the main project.
68 - guava: 18.0 - [Doc](https://github.com/google/guava/wiki/Release18)
71 - junit: 5.4.0 - [Doc](https://junit.org/junit5/docs/current/api/)
72 - cucumber: 2.3.1 - [Doc](https://docs.cucumber.io/)