Age | Commit message (Collapse) | Author | Files | Lines |
|
Issue-ID: POLICY-2188
Change-Id: I6db16763c1d2d80ff934302081a8dfc16afa7d9a
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
When a DB deadlock occurs, the DB contents can sometimes be deleted
becasue the DB removes the Service Template object and recreates a new
one in two separate DB transactions.
This change makes sure that the object remove and re-create is in a
sngle DB transaction, so the operation will either happen or not happen
so the DB will not be cleared.
Legacy policy handling must also use the SimpleToscaProvider rather than
accessing the DB directly, as SimpleToscaProvider keeps the DB structure
correct.
Issue-ID: POLICY-2548
Change-Id: I263a41cd1d8bec5d7b421045b3b14aad6e6c66d3
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
The policy type delete and policy delete now only return what is deleted
in the service template.
Issue-ID: POLICY-2534
Change-Id: I1b8d10c22d4392b0bbb655aa6876ac900ebc81df
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
This change serializes write access to the policy database via the
AUthorative TOSCA provider by making sure that only one request is
executed at a time. His change should be repolaced by proper session
handling in the next release of the Policy Framework project.
Issue-ID: POLICY-2533
Change-Id: I5fe4c0f2846981a66eb2f4e1da936fe3c9490ae5
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
Issue-ID: POLICY-2525
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: I7c6880b63b3ff8f986fb0de27656eda8f6e596a2
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
|
|
Load 21 versions of the same policy and make sure that the latest
version is returned when the LATEST policy is set on the version filter.
Issue-ID: POLICY-2352
Change-Id: Iddee33ae53096e18ed2ec67b0c3e837d1d7410a9
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
Addressed the following sonar issues:
- use RE2 instead of java.util Pattern for "+" and "*"
- don't use deprecated methods
- for Date(long), sonar appeared not to parse the argument's
type correctly. Modified the code slightly to make sonar happy
- duplicate blocks of code
- either log or throw
- missing assert in junit
- for SDNR & VFC, eliminated threads, as they are unnecessary
- duplicate code block in different branches
- useless assignments
- redeclaring abstract methods
- cyclomatic complexity
- used lombok in some cases (e.g., EqualsAndHashCode)
- assert argument order
- actually deleted ControlLoopTargetType, because it is not needed
and sonar complains regardless of which order is used
- add private constructor to utility classes
- use StandardCharsets instead of literals
Also:
- added logback-test.xml to SO to eliminate the voluminous output
from the junit test
Issue-ID: POLICY-2305
Change-Id: I586c331781bedbd54a115a71847d04d293689445
Signed-off-by: Jim Hahn <jrh3@att.com>
|
|
This patch tests cascaded get requests with multiple revisions.
Issue-ID: POLICY-2377
Change-Id: Ie7dc849d7b930b861d38c386a9950ae7e84e2a05
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
This review amends the behaviour of "get" operations on entities to
always return the latest version of an entity when the version of the
search key is the null key (value of 0.0.0).
Issue-ID: POLICY-2377
Change-Id: I4f7c12637c90bc1a83ce2ba5ef40e15b461a7d51
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
This review enables specification of versions of entities on incoming
service templates using a ':' delimiter.
So this will load version 1.00, version 2.0.0, and version 3.0.0:
org.onap.entitiy:1.0.0:
version: 1.0.0
org.onap.entity:2.0.0:
version: 2.0.0
org.onap.entity
version: 3.0.0
So this will load version 1.00, version 2.0.0, and version 4.0.0:
org.onap.entitiy:1.0.0:
version: 1.0.0
org.onap.entity:2.0.0:
version: 2.0.0
org.onap.entity:
version: 3.0.0
org.onap.entity:
version: 4.0.0
This will load
org.onap.entity:1.0.0
name: org.onap.entity
version: 1.0.0
This will throw an exception
org.onap.entity:1.0.0
name: org.onap.some.other.entity
version: 1.0.0
This will throw an exception
org.onap.entity:1.0.0:
name: org.onap.entity
version: 2.0.0
Issue-ID: POLICY-2377
Change-Id: I34bccf065b4ee4d2fe71b052bf009d4a40e2cba8
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
Fixing the legacy guard policies and renaming them so we are
able to differentiate them.
Adding newer, cleaner TOSCA Guard Policies that match the operational
guard policies.
Removing legacy guard policies.
Fixing JUnit so that they don't use indexes to test whether versions
are changed correctly.
Added back in new guard policies. Fixed the guard policy types to use
camel case.
Issue-ID: POLICY-2243
Change-Id: Ie611f26f73f41e64c0b467f524f470739158f437
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
|
|
This change adds proper cascading bahaviour to the returned service
template for filtered gets on policies.
It also significantly improves the performance on get operations, all
get operations on the API now result in only one database query.
Issue-ID: POLICY-1402
Change-Id: I7c7d0a8d9f1caf8b610461779e242c34b7f77365
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
|
|
|
|
This review implements checks on whether entities are being used or
referenced propr to allowing deletes.
The review also fixes bugs on multiple entity get returning 4040 not
found
Issue-ID: POLICY-1402
Change-Id: I9cebb9a873098740e9ff4be6284d6307e19838bd
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
The recent policy-models changes cascade database changes to some new
classes. THis change adds these classes to persistence.xml.
Issue-ID: POLICY-1402
Change-Id: I4d9953c8423dc6e33f6852744c394c9cfbc21ac6
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
Also ensure the json for vFirewall matches the yaml. We will
need to clean up some of the other legacy operational policies.
Or at least rename them.
Renamed legacy Operational policies to avoid confusion.
Fixed wrong derived_from policy types.
Operational Policy Types are now solely for new TOSCA compliant
operational policy types.
Issue-ID: POLICY-2146
Change-Id: Ia0bcabe6cca8e197f1bec8157a3004a420033969
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
|
|
Change the return codes for validation to return more helpful and
correct codes.
Fix the policy "get" request to get policy types and data types for a
policy get.
Issue-ID: POLICY-1402
Change-Id: I89d67f830e9a75bdeef39c4142523c718879f19c
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
This patch allows to store and get database passwor from
environment variables. This is needed if we want to send those
variables by helm secrets.
Issue-ID: OOM-2287
Change-Id: Id9ea8f43dd07c2b0cdeaa6d14a8033336d26923f
Signed-off-by: Dominik Mizyn <d.mizyn@samsung.com>
|
|
More additions, updates, and fixes for TOSCA service template handling.
Better handling of 404 not found on list requests.
Issue-ID: POLICY-1402
Change-Id: Id73b9a3cebb5445d4f05ae83e301330ee38a6598
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
NOTE: This review will require changes to the persistence.xml file in
other policy framework components.
This change brings in two changes:
1) Validation of the references betwen policies, policy types, and data
types
This change mans that additions to and changes to policies, policy
types, and data types must be structurally correct in the change coming
in and with whatever is already in the database
2) Hierarchical return of referenced entitites on policy types,
policies and data types.
When a policy, policy type, or data type is read from the database, the
entities referenced byt the returned policy, policy type, or data type
are returned as well.
Tests are amended for the stricter validation and structure.
Examples are corrected where they are incorrect.
Issue-ID: POLICY-1402
Change-Id: Ie6a4cb7ed336562338924079114df405f0ab889f
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
SOme outstanding comment on TOSCA provider unit tests cleaned up.
Issue-ID: POLICY-2315
Change-Id: I235a5fc9996c81f421f17236afb413df7435de19
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
Update the unit tests in models-provider so that we can check that the
TOSCA artifact that is read from the database is the same as the TOSCA
artifact that is stored.
This review does some groundwork for that check.
Issue-ID: POLICY-2315
Change-Id: Iabc7b247736b862713585a493752bc254cfe1c3d
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
|
|
In this change, the data types of policy types are persisted to the
database. All policy types currently in the database are returned on all
policy type get requests. This will be made more intelligent in the next
review.
Issue-ID: POLICY-2315
Change-Id: I10065ab9b90e72114a453494fc706d8aabc50c0a
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
Issue-ID: POLICY-1629
Signed-off-by: ning.xi <ning.xi@est.tech>
Change-Id: I42c9542adc44d52b760a70e710ab4cc6fa8a1b3b
|
|
Data types must be persisted to the database in order for them to be
retrieved in policy type queries and later for policy validation.
Issue-ID: POLICY-2315
Change-Id: Iacb88501a597aeee8f6d8bcc3d9604c13dc09090
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
Issue-ID: POLICY-1629
Signed-off-by: ning.xi <ning.xi@est.tech>
Change-Id: Ife65d50c862ed90c3c9a3cea91a2b9a8d874fa14
|
|
|
|
New checkstyle profile flagged some minor issues in policy models.
Issue-ID: POLICY-2165
Change-Id: I17ed070a3d55601ad31e48fdfd29fff01d29fa42
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
|
|
Add JpaPdpStatistics entity which will be used in provider.
Add Pdp Statistics entities
Issue-ID: POLICY-1628
Signed-off-by: shaoqiu <tim.huang@est.tech>
Change-Id: Iab12eb02e2e7f0e366aff64fa665b5d6674f2905
Signed-off-by: shaoqiu <tim.huang@est.tech>
|
|
Optimization policies need to be further refactored so
that Resource vs Service type policies can be specified.
Issue-ID: POLICY-2066
Change-Id: Ia40a947097692ea7dcc6ea8d13eb8669c37fac14
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
|
|
New operational policy type for Frankfurt. Updating examples.
added sample CLAMP metadata.
Issue-ID: POLICY-2217
Change-Id: I941c3a4187a4d164bf793ef2d82c34fccc1a2c35
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
|
|
Code was creating the DAO object twice - removed the extra line.
Note: this properly doesn't fix the race condition, but it should fix
a memory leak.
Change-Id: I5f5c6002d42f9bb0525d1b5013b1300e80264645
Issue-ID: POLICY-1832
Signed-off-by: Jim Hahn <jrh3@att.com>
|
|
Changed policy types from a list of maps to a map.
Changed data types from a list of maps to a map.
Made all knock on changes to adapters and tests.
Updated Issue ID.
Added
onap.policies.controlloop.guard.coordination.FirstBlocksSecond.yaml
policy type that is required to be preloaded in policy-api.
Issue-ID: POLICY-2047
Change-Id: Ic8e809eab248fd7242f0e565fa2e3da75bcfbdeb
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
Per javadocs, getName() should generally be used instead of
Class.getCanonicalName(). This change only applies to classes; it
does not apply to File objects.
Note: this impacts the output from PfValidationMessage, as it will
now list the names of embedded classes with a "$" separator instead
of a ".".
Change-Id: I2cd64bc0281dd324bf80eac57335a7299a516447
Issue-ID: POLICY-1646
Signed-off-by: Jim Hahn <jrh3@att.com>
|
|
|
|
models-errors
models-pdp
models-provider
models-sim-pdp
Also had to work around this checkstyle issue:
src/test/java/org/onap/policy/models/sim/pdp/comm/
TestPdpStateChangeListener.java:[77,32] (javadoc) JavadocMethod:
Unable to get class information for @throws tag
'PdpSimulatorException'.
The error appears to be bogus, as PdpSimulatorException is on the
"throws" line thus indicating that the class IS accessible to the
above java file.
Change-Id: Iaca58457a32b00121000fc0bab12a8be4cb19bac
Issue-ID: POLICY-1791
Signed-off-by: Jim Hahn <jrh3@att.com>
|
|
and policy type
Issue-ID: POLICY-1807
Change-Id: I831c720993930a911d301a82b59a74cda7cb0c50
Signed-off-by: Chenfei Gao <cgao@research.att.com>
|
|
Fix .gitreviw file to point at "master" rather than "dublin"
Allow return of multiple versions of policy types and data types in
TOSCA service templates and multiple policies in TOSCA topology
templates.
Because the return type is a list of singleton maps, utility methods
were added to return flat maps of poliicy types, data types, and
policies keyed by a compound ToscaEntityKey name/version key.
Issue-ID: POLICY-1807
Change-Id: I355038aaca26f41064d0e3cb3b45b1de2294cf5f
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
The regular expressions for checking names and versions
in policy key names and versions were not expressive enough
to restrict all error names and versions.
Issue-ID: POLICY-1777
Change-Id: I037eca051f6c7a9f1e7182150d40d8b8d906a75c
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
Issue-ID: POLICY-1777
Change-Id: I5b07ad1acdb4a614a50cb15978130c19bc5786f7
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
THe properties of legacy operational policies are already
encoded and should not be stored in JSON format.
Issue-ID: POLICY-1759
Change-Id: I3e2a69f216348c02c2ef9c23282f87da52a7f390
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
The policy type version must be updated on a policy before it is stored
to the database, otherwise the database value is incorrect.
Issue-ID: POLICY-1738
Change-Id: I0a7f2da3837497dd999141f40466d6507c26159b
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
The TOSCA specification has a "bug" in that it does not have a field to specify
the version of a policy type to use. We already had introduced the "type_version" field
for this.
This review introduces setting of the default version of a policy type to be
be used by a policy as the latest version of the policy type in the database.
As a side effect of this, we now have to check for existence of the policy type
of a policy in the database. This means that creation/update of a policy with
a non-existant policy type specified will now fail.
Issue-ID: POLICY-1738
Change-Id: I27080cf6cd358948810dab6897c72dfe4d41fe91
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
Issue-ID: POLICY-1095
Change-Id: I91f495947fe77222804e7ab31c4dd7d7aee66b44
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
Add unit test for the new database provider driver parameter.
Address the comments raised in the last review.
Issue-ID: POLICY-1095
Change-Id: I9f629d9f4446d12bfb492e00e49e07b97ef5a490
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
Issue-ID: POLICY-1095
Change-Id: I3edd70898836d3bd978643857d1ba29599b1cf6c
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
Unit test coverage well over 90% in
policy-models-base
policy-models-dao
policy-models-pdp
policy-models-tosca
policy-models-provider
Issue-ID: POLICY-1095
Change-Id: I7703e2ae8a93575ca478c3d809ff8c1fb9f0f334
Signed-off-by: liamfallon <liam.fallon@est.tech>
|