aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
AgeCommit message (Collapse)AuthorFilesLines
2019-03-26Allow UUID definitions in the mappings JSONmark.j.leonard3-28/+41
Add support for reading the Widget invariant and version UUIDs from the TOSCA mappings JSON. In this commit the artifact-generator.properties is also read and used to provide default values. This step prevents any existing deployments (e.g. automated test integration) from failing. The redundant properties file will be deprecated in a future commit, only when the JSON configuration has been updated. Also remove two unused Java files to help with coverage stats. Change-Id: Idc82e28092a2b028214225c7974db411c9f8a173 Issue-ID: AAI-2284 Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
2019-03-25Refactor Widget creation methodsmark.j.leonard6-21/+83
Rename getWidget() to createWidget() to indicate that a new Object is created. Add a method to create a Widget from the String representation of its type. Change-Id: I430acf02ea67c7b730e28e79887f8fbdb18feb42 Issue-ID: AAI-2281 Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
2019-03-25Additional JUnit tests for Model classesmark.j.leonard2-6/+7
Increase code coverage for Model and Service Change-Id: I02430f470cfa6497535a372a0b18be8678279270 Issue-ID: AAI-2280 Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
2019-03-25Improve javadoc comments and formattingmark.j.leonard6-37/+55
Issue-ID: AAI-2281 Change-Id: I0f5cce16ce76113b1fee603ad3c191cb6f9fe80f Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
2019-03-25Add hasWidgetType() helper methodmark.j.leonard7-18/+41
Replace getWidgetType() == WidgetType.valueOf("type") with hasWidgetType("type") for improved readability. Change-Id: Id51bed7c4cb9ce38799bf3ff34301c8feb664922 Issue-ID: AAI-2281 Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
2019-03-22Simplify VNF Vendor Image extractionmark.j.leonard1-109/+86
Refactoring of the software version extraction routines to reduce complexity. Pass the NodeTemplates directly to the extractSoftwareVersions() method and move the exception handling up the calling stack. Remove the creation/usage of an intermediate Pair object. Query for the Service VF list once only. Use Streams rather than converting from Stream to List and back. This change will simplify future work: either to convert sdc-tosca API methods (that will be deprecated), or to use an alternative parser. Change-Id: I745ced9e6095f389ee1bede37e8480dfaf65716a Issue-ID: AAI-2281 Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
2019-03-21Create new Resource objects for each new modelmark.j.leonard2-2/+19
When creating multiple Resources of the same type, ensure that each Resource has a new Java Object: follow the same pattern as used for Widget types. Change-Id: I1e41d3258a3ccdad91448234ae3cf40235d7b210 Issue-ID: AAI-2267 Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
2019-03-11Refactor auth classes and add testsmark.j.leonard2-48/+57
Add new tests to give better coverage of the authorization classes. Refactor the core class for readability. Change-Id: I2be467d8f4492249a0c29be8b108bb2bce2818dd Issue-ID: AAI-2229 Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
2019-03-11Test starting application with OBF: passwordmark.j.leonard1-8/+15
Test an uncovered code path. Remove the unnecessary declaration of the Jetty OBF: prefix constant String. Ensure that the Spring Application exits before the next JUnit test runs. Change-Id: Iceb2e79a923359c15ca6ad366c2ac94a63e381b0 Issue-ID: AAI-2229 Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
2019-03-11Reimplement Widget.Type enum classmark.j.leonard10-71/+141
Replace this with a WidgetType dynamic enumeration, which may be extended at runtime. Load the Widget Types from the mapping configuration (JSON file). Issue-ID: AAI-2229 Change-Id: I5d1bc4291b4446f6d744821bf1d74b1f117b901f Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
2019-03-11Refactor AaiModelGenerator classesmark.j.leonard4-279/+248
Refactor the AAI Model Generator implementation by removing duplicate code and improving the variable and method names. This is not a rewrite. The unnecessary interface has been removed to simpify code maintenance. Change-Id: Ia8d630360008c7cfadefda3c04ff7b747ecd1577 Issue-ID: AAI-2212 Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
2019-03-07Re-implement model type value for Resource Mappingmark.j.leonard9-127/+80
Refactor the Model/Service/Resource/Widget hierarchy to improve code readability. Replace the configurable Boolean value for a Resource's model type with a value from the existing ModelType enum. Obtain the A&AI XML Model name (always resource or service) directly from the Model class and not from the configured model type for the Resource. Change-Id: I1487d919392b34e4bf1314da8cd2805a9fbf96a3 Issue-ID: AAI-2212 Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
2019-03-06Remove redundant methods from codebasemark.j.leonard6-95/+24
Delete methods that are never called (or only called from test code) Issue-ID: AAI-2212 Change-Id: I1554bd76de4a9ac2e3cc05987dac1d04966b9200 Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
2019-03-05Fix checkstyle warnings and formattingmark.j.leonard12-57/+69
Add Javadoc and make cosmetic changes to prevent Checkstyle messages Change-Id: Ibab7be42d6a01b181cdb625b6b34d580658c7046 Issue-ID: AAI-2212 Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
2019-03-05Move Widget attribute data to the mappings JSONmark.j.leonard34-839/+223
Extend the TOSCA mappings JSON content by adding a set of of Widget types defining the type name and data-delete flag. In this change the set of supported types (defined by an enum) remains. However the intention is to replace this in a future commit. The hierarchy of annotated Widget types is replaced by this new configuration, which is accessed from the Widget class. Refactoring has been kept to a minimum to simplify the code review process but further improvements can now be made. Ideally the set of supported Widgets can be extended through configuration changes only. Change-Id: I005cfe6976778b14f14c3ad06d8acf3745c8dd8f Issue-ID: AAI-2212 Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
2019-02-19Fix outstanding Sonar issuesmark.j.leonard3-33/+39
Change-Id: I9699ee13321f136b4460d5c85d49ab13378f52b4 Issue-ID: AAI-2121 Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
2019-02-11Rename the groupfilter.config System Propertymark.j.leonard7-40/+75
Rename the System Property to be tosca.mappings.config and default the value to ${CONFIG_HOME}/tosca-mappings.json Update Java code and comments to remove the word "filter" where this is now outdated. Add new JUnit tests for better code coverage. Change-Id: Iaa9685638e099c898894171a958b0d5d51542fde Issue-ID: AAI-2121 Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
2019-02-11Merge "Fix checkstyle issues including javadoc"Tian Lee6-49/+62
2019-02-06Merge "Optionally disable client authentication"Tian Lee2-1/+5
2019-02-06Optionally disable client authenticationSerban Popescu2-1/+5
based on an env. variable, client authentication can be disabled Change-Id: Ifa3e5d109d0609e0836ddaea2c1183799252ddd3 Issue-ID: AAI-2132 Signed-off-by: Serban Popescu <serban.popescu@amdocs.com>
2019-02-05Fix checkstyle issues including javadocmark.j.leonard6-49/+62
Minor code tidy-ups: mostly formatting and Javadoc comments Change-Id: I8a9ab692428fa09c73bd1fb542100610a86f6eca Issue-ID: AAI-2121 Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
2019-02-05Replace Resource sub-classes with configurationmark.j.leonard17-502/+306
Delete the sub-classes of the Resource (internal Model class) and replace the annotated properties of these classes with TOSCA-to-Model mappping data loaded from the JSON configuration. Change-Id: I56d5d9d4893be45eb42ae65099ea9abe5f4409b9 Issue-ID: AAI-2121 Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
2019-01-30Load type mappings from a group configuration filemark.j.leonard8-79/+144
Change the filter-types.properties file: re-implement to use JSON content. Remove the System Property that defines the location of the file and add this to the Spring application properties. Initialise the type-to-model mappings using the key=value pairs from this JSON content. Refactor existing Junit tests to remove duplicated resource loading code. Change-Id: Idb2e962fe5cae39b70cc8cf16053d0a253f4fac0 Issue-ID: AAI-2121 Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
2019-01-23Do not try to unobfuscate clear text passwordsSerban Popescu1-1/+4
The keystore password does not need to be decrypted if in clear text Change-Id: Ia0d8591e1d5ca6890fcb77295de9573921f6652f Issue-ID: AAI-2072 Signed-off-by: Serban Popescu <serban.popescu@amdocs.com>
2018-12-05Add null check for Group member with no A&AI Modelmark.j.leonard1-8/+18
Protect against a Null Pointer Exception when any member of an Instance Group cannot be mapped to an output XML Resource or Widget. Change-Id: Icf099686681b8dffb86e9f003bd92ace6e8679b1 Issue-ID: AAI-1991 Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
2018-11-27Process Service-level Instance Groupsmark.j.leonard1-297/+316
Create an InstanceGroup XML model for groups of the Service topology template in the case where there is no Resource model generated. Add a test CSAR file for a Service Proxy (an unsupported type). Assert that the Service is associated with the instance-group Models. Change-Id: If76bf7a1cfb960bc8692f1e136ee85176725915e Issue-ID: AAI-1963 Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
2018-11-27Refactor processProvidingService methodmark.j.leonard2-382/+396
Remedy some Java formatting issues and also simplify Providing Service processing code. Change-Id: Ifddc045e6a1fd1280f63065d4f3b6df83251800c Issue-ID: AAI-1884 Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
2018-11-27Refactor model generation algorithmmark.j.leonard3-469/+431
Reorganize the Service and Resource Model generation code for readability. Resort methods to put public before private. Rename generateService() to generateAllArtifacts() Reimplement this method such that the NodeTemplate list is iterated once only. This is intended to simplify future changes to the code. Change-Id: Ie0c6003eab99f42945747c6d79827881e05afc87 Issue-ID: AAI-1884 Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
2018-11-22Refactor Instance Group processingmark.j.leonard2-432/+466
Minor refactoring and reformatting of Java code using Eclipse. Add private method mergeProperties() to replace duplicated code logic for populating the Group model. Change-Id: I1360bbbf5b065149028a94392dd530af9c9153e8 Issue-ID: AAI-1884 Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
2018-11-09Add support for ResourceInstanceGroupmark.j.leonard1-26/+50
Refactor existing code and add a Junit test for the relevant method. Change-Id: I66703f1d2e93173df4676070faf66e289360609a Issue-ID: AAI-1884 Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
2018-11-09Minor formatting fixesmark.j.leonard2-2/+0
Non-functional changes addressing whitespace inconsistencies. Change-Id: Ife84f6b04bf8ce0204409d2f3708ab85b3a3caff Issue-ID: AAI-1884 Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
2018-11-07Upgrade Babel to sdc-tosca 1.4.6mark.j.leonard1-1/+2
Change-Id: I53863aabd02050606605f2e905186b01232a77c9 Issue-ID: AAI-1771 Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
2018-10-09Downgrade to sdc-tosca 1.4.41.3.0mark.j.leonard1-1/+1
Release 1.4.5 has a dependency on a SNAPSHOT jar and therefore must not be used. Change-Id: Ibc7a3d8f7f60eb06c01daaacb451fbc9748c4048 Issue-ID: AAI-1445 Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
2018-10-09Update to sdc-tosca 1.4.5mark.j.leonard1-3/+2
Update to use a newer release of the SDC TOSCA parser. Change-Id: I8bd3288e000c27c2fbcb5b4b24c3a31cf12bfab8 Issue-ID: AAI-1445 Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
2018-10-08Generate models for child resourcesmark.j.leonard3-94/+151
Babel now generates models for immediate children of Resources, non-recursively. Existing functionality is unchanged. Some large methods are refactored to avoid a Cognitive Complexity Sonar code smell. Change-Id: I7ab173a5693f25d0b303dfa97a25106e7e29b5f2 Issue-ID: AAI-1704 Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
2018-09-11Improved logging for VNF image extractionmark.j.leonard5-70/+142
Changes to logging messages to help with debugging issues. Improved Javadoc comments. Issue-ID: AAI-1242 Change-Id: I255eeb774b791a9653fdd0274367801245be6bbd Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
2018-09-10Add support for InstanceGroup resource modelsmark.j.leonard9-42/+254
Generate models for Instance Groups (for specific supported types). Process groups with a metadata type of CR or Configuration. Add InstanceGroup Widget to the supported Widgets. Add support for a group filter properties resource/file (with the single property key "AAI.instance-group-types" which provides a comma-separated list of supported types). Add the System Propery groupfilter.config to define the file path. Change-Id: I6153e6284965c57ae43291b1dc3ee4a1d11e6583 Issue-ID: AAI-1579 Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
2018-09-06Additional tests for VNF image extractionmark.j.leonard1-2/+1
New tests for extracting software versions. Change-Id: I26a9d654d03154a1d026741e623c8f953946a5f4 Issue-ID: AAI-1250 Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
2018-08-17Fixing the achtype variable nameArul.Nambi1-1/+1
Issue-ID: AAI-1449 Change-Id: I862fd89a4f9aa9525c5475997ca8c360c6cb39a7 Signed-off-by: Arul.Nambi <arul.nambi@amdocs.com>
2018-08-13Fixing the docker jenkins jobArul.Nambi1-1/+1
Issue-ID: AAI-1449 Change-Id: I5cda30518c34d52e49bb61055e29aaf839e090c6 Signed-off-by: Arul.Nambi <arul.nambi@amdocs.com>
2018-08-08Refactor method processServiceTosca for Sonarmark.j.leonard1-25/+40
Fix for a new Sonar issue detected when a method was moved within an existing Java class file. See https://sonar.onap.org/project/issues?id=org.onap.aai%3Ababel&open=AWUZW80uwGn37JfbxewF Change-Id: I3ac7ecf74c261d39a8762fd39123f7f8048894e3 Issue-ID: AAI-1242 Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
2018-08-07Check getMetaData() return value for nullmark.j.leonard3-77/+90
Added code to check for null metadata. Decomposed existing methods to avoid Sonar complexity warnings. Renamed some variables for readability. Change-Id: Id68be06bb5c105f45870a08f60a4ddc4dfbe5b09 Issue-ID: AAI-1448 Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
2018-08-06Add support for the CR Widgetmark.j.leonard4-1/+62
Issue-ID: AAI-1444 Change-Id: If25a2ea001fe7b43dbd14eed008a14e5dd8b3579 Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
2018-08-06Minor text fixesmark.j.leonard2-1/+2
Updated some Javadoc text for compatibility with Checkstyle settings. Issue-ID: AAI-1444 Change-Id: I9d7541aa24d07e42d7d127f76b8576a7fa7184d4 Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
2018-08-06Remove Byte Order Mark from License textmark.j.leonard64-64/+64
Change-Id: I331d3832828aa825c710d7fb058786dd1448c0c3 Issue-ID: AAI-1443 Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
2018-07-06Refactor Widget class to reduce complexitymark.j.leonard2-62/+51
Remove a large switch statement to reduce Cyclomatic Complexity and thus remove an oustanding Sonar code smell. Replace the switch with a Map so that a look-up can be implemented. Issue-ID: AAI-1242 Change-Id: I5b396216a28b77dcb3953eb4897a5397c98d119d Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
2018-07-06Merge "Test coverage and refactor for GeneratorUtil"Tian Lee1-5/+3
2018-07-05Test coverage and refactor for GeneratorUtilAdam Wudzinski1-5/+3
Added tests and made GeneratorUtil final class Change-Id: I3e9b3fa22dff5c50fa37ad10ba0ddd8b9bbef2d9 Issue-ID: AAI-1334 Signed-off-by: awudzins <adam.wudzinski@nokia.com>
2018-07-03Refactor Model methods to reduce complexitymark.j.leonard1-125/+167
Change-Id: Ie67b85df855670974aa7939caf0f9afc3effe077 Issue-ID: AAI-1242 Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
2018-06-28Support Port Mirroring Configuration modelLee, Tian (tl5884)4-1/+65
Add support for Port Mirroring Configuration XML model generation from SDC TOSCA Change-Id: I44718d20a53e343ee34ae47ef2bc35d49c862ddf Issue-ID: AAI-1345 Signed-off-by: Lee, Tian (tl5884) <TianL@amdocs.com>