Added the new versioning validation for policy and policy type

The following rules are implemented to validate the version provided
in the POST payloads of policies and policy types:

1) If version field is not specified in POST payload, "406 - Not Acceptable"
   would be returned along with the message "mandantory version field is missing".
2) If the version is not in the DB, we simply insert it.
3) If the version is in the DB, "406 - Not Acceptable" is returned along with
   the message saying "specified version x.x.x" is already existing and the latest
   version is x.x.x. It can force the user to create a newer version than the latest one.
4) The same versioning validation is applied to legacy types of policies too
   so that everything is consistent.

Issue-ID: POLICY-2316
Change-Id: I395df0196a9d3073fd1f09060f943aeeb554d277
Signed-off-by: Chenfei Gao <cgao@research.att.com>
21 files changed
tree: 3ab1be8a1fb3dd19154090291e17eb6b691f19c7
  1. main/
  2. packages/
  3. releases/
  4. testsuites/
  5. .gitignore
  6. .gitreview
  7. INFO.yaml
  8. LICENSE.txt
  9. lombok.config
  10. pom.xml
  11. README.md
  12. version.properties
README.md

Copyright 2017-2018 AT&T Intellectual Property. All rights reserved. This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE Full license text at https://creativecommons.org/licenses/by/4.0/legalcode

This source repository contains the ONAP Policy API code.

To build it using Maven 3, run: mvn clean install