Age | Commit message (Collapse) | Author | Files | Lines |
|
THis change adds a method to create a ToscaConceptIdentifer from a
ToscaEntityKey class. This method reduces the code vloume when
translating between these identifiers.
Issue-ID: POLICY-2971
Change-Id: Idd62339935d2ba78e6c60b40ee95fedac0642bef
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
|
|
In order to support serialization and deserialization of
ToscaNodeTemplate objects onto DMaaP, we need a copy constructor on the
ToscaNodeTemplate object.
Issue-ID: POLICY-2971
Change-Id: If6dc6c54d5673cef46734a88d0a91ae868c11dcb
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
Using keywords as column names in JPA models is causing syntax errors during auto generation of DDL
The errors are visible in the policy api and pap docker logs on startup
This review renames the relevant columns
Issue-ID: POLICY-2670
Signed-off-by: gregory.hayes <gregory.hayes@est.tech>
Change-Id: I52a3156461940465c3945841c69a04fcb2f90117
|
|
Updated the code to place validation annotations directly on the
annotated types instead of using the @Items and @Entries annotations.
Also added/updated junits for validation code.
Issue-ID: POLICY-2648
Change-Id: Ia535da07a38cec77a74c5c3215b5ae784d7a4e1a
Signed-off-by: Jim Hahn <jrh3@att.com>
|
|
The policy models tosca classes ToscaPolicyIdentifier and
ToscaPolicyIdentifierOptVersion can be used to identify any TOSCA
concept, not just TOSCA policies so they are renamed to
ToscaConceptIdentifier and ToscaCinceptIdentifierOptVersion
respectively.
The class ToscaPolicyTypeIdentifier is redundant and is replaced by
ToscaConceptIdentifier.
Issue-ID: POLICY-2900
Change-Id: Id0a37c42ea4e74f07b47e1694c4f8291c35879c9
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
Today we can only handle a single service template in the database. We
should be able to handle multiple service templates and assign arbitrary
policy types and policies to maned and versioned service templates.
This review brings in the Java API in models provider for handling
service templates in this way and uses a simplistic single-teplate
implementation in models-tosca, that will work but still only handles a
single service template under the hood.
Issue-ID: POLICY-2900
Change-Id: Ia02dea8abe44b7f407e685090a4b8e0360889653
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
Modified models to use annotations instead of function calls for most
field validations. Created a few new validation annotations for use
within models.
Per review comments:
- renamed Key to VerifyKey
- enhanced VerifyKey to imply "@Valid", unless disabled
Issue-ID: POLICY-2648
Change-Id: I2b53f218b0a2ab1ed1f5e278816a3509f1408972
Signed-off-by: Jim Hahn <jrh3@att.com>
|
|
Policy models uses PfValidationXxx classes which are totally unrelated
to ValidationResult in policy common. This precludes the use of various
utility methods and annotations for doing validation. Modified policy
models to use ValidationResult instead.
This approach uses function calls, though a future approach could make
use of annotations instead.
Issue-ID: POLICY-2648
Change-Id: I9760f1dc46902ab6bef7f440f3caf5e951660a5d
Signed-off-by: Jim Hahn <jrh3@att.com>
|
|
Implement the Database persistence parts for the new TOSCA concepts so
that those concepts can be written to and read from the database.
First batch of comment fixes
Issue-ID: POLICY-2900
Change-Id: I45191c1ff57cf1ea8563399db6cc8e51b2724813
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
Generic methods for getting ehtire service templates are added to the
TOSCA providers in models-tosca.
These are needed to read service tempaltes containing entities that are
not policy related.
Issue-ID: POLICY-2900
Change-Id: If4c646037f51f8a18b66257426accc330905acf9
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
Issue-ID: POLICY-2900
Change-Id: Iaba37b81473b60d3da15a52ffcccdaa16a5b7091
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
This review brings in extra TOSCA concepts for Node types, nodes, and
capabilities.
The TOSCA handling is also amended to make the handling of equality
consistent. Now, if filtering or ordering is required using an order
rather than natural ordering, a comparator must be supplied by the user.
Issue-ID: POLICY-2900
Change-Id: Ie40e86870b97eb993b1338bdc0666ac116f72f67
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
When we upgrade to oparent, these will fail as oparent upgrades
to 8.37 of puppycrawl which fixes a few bugs that should have
flagged these previously.
Issue-ID: POLICY-2887
Change-Id: Ia0ceab23ff3d5c177f657c5852115ab1b265c698
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
|
|
Property default value is serialized to the database as Yaml and
deserialized back into an object on a DB read.
Issue-ID: POLICY-2844
Change-Id: I69f2843a93cd5f831359a0965223298b769498d9
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
Addressed sonar issues:
- diamond operator
Also removed a number of the "NOSONAR" comments now that we know how to
address them without disabling sonar.
Issue-ID: POLICY-2714
Change-Id: I440f4fa955968fd911616c2b6ee61b4b4d013821
Signed-off-by: Jim Hahn <jrh3@att.com>
|
|
Removing all the legacy operational policy related
concepts, providers, examples etc from models repo.
Issue-ID: POLICY-2764
Change-Id: Ie820271381674ccc4eaef0bd6379f673f67701e7
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
|
|
Issue-ID: POLICY-2188
Change-Id: I6db16763c1d2d80ff934302081a8dfc16afa7d9a
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
Issue-ID: POLICY-2078
Change-Id: I0e8aae118a52aaef7e372293396802b85782a22c
Signed-off-by: RossC <ross.carter@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>
|
|
When a "get" is executed while a "create" or "delete" is underway, the
DB sessions overlp and data is lost in the database. "get" requests must
also be synchronized.
Issue-ID: POLICY-2533
Change-Id: Idbe155568e5d793fe82b7cc3aad5ef121e8209b9
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
Up until now, the "type" and "type_version" fields defaulted to "NULL"
and "0.0.0" respectively when they were not specified because the
"type_version" field was not always specified on policies in previous
releases. In cases where the "type_version" field was not specified, it
was assumend that a "0.0.0" version of the policy type existed. In
parallel, if the version field was not specified on the policy type, the
version was stored as 0.0.0.
This behaviour is now changed and the "type" and "type_version" fields
are now always mandatory.
Issue-ID: POLICY-2538
Change-Id: I4279adfa86f531205879dbb87986453604624032
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>
|
|
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>
|
|
Due to the problems with TOSCA and version handling, the filtering for
policy types on old versions did not work. This change fixes that
problem.
Issue-ID: POLICY-2377
Change-Id: I462bd5710b9dea37475861d1021d28b2c7391a24
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
Issue-ID: POLICY-2389
Signed-off-by: Chris Ramstad <cramstad@ciena.com>
Change-Id: Iba9faf9e878d55022be7882e862ebed826dc76c1
|
|
Optional controllerName has been added to Legacy Operational
policies to be able to route Operational Policies to an
specific drools controller.
Currently, the policies are deployed to all controllers that
support a policy type. In the case, that there are multiple
controllers set, and the policy is only to be routed to one of
them, this field should be populated.
Issue-ID: POLICY-2388
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: I7288ce0069a723b8e6ec535331dc9cda56fbf130
|
|
Major, minor, and patch version of policy now in policy metadata
version.
Issue-ID: POLICY-2243
Change-Id: I1f3c7054a12e724264b117e399890c9e1c3347f2
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>
|
|
We should return the incoming service template on create requests. This
change is required for CSIT tests.
Issue-ID: POLICY-1402
Change-Id: I1072c9c16d2b267c34fa015e7e7a355ba9f5338a
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
Change-Id: If911bdd4116b722e13e00199d05b1794de4e79c2
Issue-ID: POLICY-1402
Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
|
|
Change-Id: If737f6ae0bcb0f8c694711a67a3c879fee8c11c5
Issue-ID: POLICY-1402
Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
|
|
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 service template that is being returned for the "get" has to be built
up in the correct order. A policy and the policy types and data types it
is referencing must be added together. Before, all the policies were added
at once and then the policy types and data types for the policies were added
afterwards. This means that if the service template is validated during
the service template build, validation may fail, depending on the order
of building of the template.
Issue-ID: POLICY-1402
Change-Id: Ia4fb9ee3819dccfc8c346c682545b2d27ebc4058
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
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>
|
|
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>
|
|
Utilityu method to filter out all bit an entity and its parents from a
service template entity container.
Issue-ID: POLICY-1402
Change-Id: I8c3b4c21b27fd8787cdfde0e1b726646f52c437b
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
Full validation including references to policy types and data types
added. Unit tests fixed to cope with new stricter validation.
Issue-ID: POLICY-1402
Change-Id: I59f37640a99494a53960a54d2fc82cc96861d43b
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
This change brings in proper hierarchical checks for service templates,
making sure that all parents of data types, policy types, and policies
must be in place.
Issue-ID: POLICY-1402
Change-Id: I61b1b556403f74aeaa092f0d4d6ed19bf6a0b715
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
This utility function allows a TOSCA service template fragment to be
merged with an exsiting service template and will be tbe backbone of
"create" methods on the API from now on.
Issue-ID: POLICY-1402
Change-Id: I3381cb2a1bd30621a639dedc213c546eeb2bf9aa
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
Persistence needs to be carried out at service template level in order
to guarantee consistency of the service template in the database as much
as possible. Therefire, service template lelve reading, writing, and
delting is required.
Issue-ID: POLICY-1402
Change-Id: I5be57c29381bf6ddc87afdbb64ddae66a5ea5e5f
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>
|
|
validation feature"
|
|
feature
Issue-ID: POLICY-2316
Change-Id: Ifcb6739c7dd6c5796067a4b9e2f3eef960e1ace4
Signed-off-by: Chenfei Gao <cgao@research.att.com>
|
|
Data type properties are not being stored correctly into the database
when MariaDB is used (it worked fine in unit tests in H2).
Issue-ID: POLICY-2315
Change-Id: Ia901a070292b338154f3766f5fc7b91d656038df
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
Refactored the ToscaUtils class to remove code duplication.
Issue-ID: POLICY-2315
Change-Id: Ic06a0881d1797dbb3c45ae1903a150fbda421e72
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>
|