Age | Commit message (Collapse) | Author | Files | Lines |
|
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>
|
|
|
|
Issue-ID: POLICY-2389
Signed-off-by: Chris Ramstad <cramstad@ciena.com>
Change-Id: I7ce91e331a128aaadaab5ac837e19873a3388164
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Addressed the following issues related to the java 11 upgrade:
- forClass().newInstance()
- java.xml.bind no longer included in jdk
- new mockito doesn't clear captured lists
Issue-ID: POLICY-1406
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: Ia254c1ed21f847d1824e7abc22528975372ee2b6
|
|
|
|
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>
|
|
Refactored PfConceptKey, extracting most of it into PfKeyImpl.
Added PfSearchableKey as a subclass of PfKeyImpl.
Change-Id: I524f4ce9208fc9ba09e77db4cc7dde5a21e1d7fc
Issue-ID: POLICY-2224
Signed-off-by: Jim Hahn <jrh3@att.com>
|
|
Deleted the copyTo() method from PfConcepts and replaced uses
with deep-copy constructors. Also added mapMap() and makeCopy()
methods to PfUtils to facilitate.
Change-Id: Id6391bb806ef0dfab6c1089278bf2b514c7e303e
Issue-ID: POLICY-1600
Signed-off-by: Jim Hahn <jrh3@att.com>
|
|
Issue-ID: POLICY-1600
Change-Id: If660cbe84424e492b6db3ab11ef97b37f046b3aa
Signed-off-by: Henry.Sun <henry.a.sun@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>
|
|
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>
|
|
Issue-ID: POLICY-1777
Change-Id: I83d6d15653a5bd934515980186349b8bd710c113
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>
|
|
Re-introduced regular expressions to match policy version
so that the policy version found in the metadata, which is just
the major number, can be matched with a policy's version, which
is of the form, major.minor.patch.
Simplified equals() test, as we already know "text!=null".
Added filterPrefixPred() and modified policy filter to use it when
matching versions, as it is simpler to use when matching a version
prefix.
Also added tests to PfObjectFilterTest to test each of the XxxPred()
methods.
Change-Id: I0734873f701a539e883fe25b8eecfdde60cc8b6d
Issue-ID: POLICY-1542
Signed-off-by: Jim Hahn <jrh3@att.com>
|
|
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>
|
|
THis review adds unit tests for the authorative concepts in the
models-tosc module and adds unit tests for the authorative and
and database providers.
Issue-ID: POLICY-1095
Change-Id: If98deea99658056030dd47725b0c0a4266d84106
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
This review completes the unit test for the models-pdp module, for persistence
of PDP groups and for PDP group filtering.
Added unit test of filters for TOSCA policy types and policies.
Added fix to allow filters to pass when the value being
checked is null.
Issue-ID: POLICY-1095
Change-Id: I982400ef39f0282d813d49e484a58207e03b8a63
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
Fixed bugs on filtering where lack of null checks was blocking
all results.
Added unit test for PDP related JPA objects.
Fixed cascading and orphan control on JPA objects.
Added partial testing of PdpProvider.
Added partial testing of filters.
Changed tag for content of operational policies from "Content" to "content".
Issue-ID: POLICY-1095
Change-Id: Ieb22e06955a8434b490bae7d0f6b77d4479515e8
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
Initialized initial array size for empty list.
Add some junit tests to ensure that the returned lists are mutable.
Updated license in filter class.
Change-Id: I9c151eb50355a71f4d34ac46b41f8278cf913664
Issue-ID: POLICY-1542
Signed-off-by: Jim Hahn <jrh3@att.com>
|
|
This is a proposed revision of the latestVersion() method that's
guaranteed to be linear time. Still makes use of the slick idea
of sorting the list so that items with the same name are adjacent
and in order by version.
Revised to use an array list, which is more like the original code.
Change-Id: If047d4d9630c426c6335f52cb7e5bdda7b6cc0a9
Issue-ID: POLICY-1542
Signed-off-by: Jim Hahn <jrh3@att.com>
|
|
Brings coverage in models-base up over 99%
Issue-ID: POLICY-1095
Change-Id: Ie1c9f3f132715275f44f349a415a8bb34a0115c9
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
This review completes the implementaiton of the filters
for fetching policy types, policies, and PDP groups
from the database.
It also fixes bugs in Policy type creation.
Yaml in some of the policy type examples modified so that it is syntatically
correct.
Proeprties now stored as a blob in DB as they can be big.
Issue-ID: POLICY-1095
Change-Id: I6aef88ee2905afa58d778d82832f2b55d794fe9c
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
I just raised this review to shwo where I'm going with the
filters. They are not complete yet.
Issue-ID: POLICY-1095
Change-Id: I7b602a32bb67159b893f3b3cefea5d88038c4e5f
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
This review refactors the TOSCA support to use authorative
serialization and mapping.
It removes the JPA entities from the Proider interface
It brings the mapping support from and to authorative concepts out of
the JSON serialization classes directly into the JPA classes
It adapts the unit tests to work with the refactored structure.
Apologies for the review size but it all had to be done in a single block
of work.
Issue-ID: POLICY-1095
Change-Id: I4827d1dc67ef7aac98cba230ffcd79c6de71e805
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
Use authorative models instead of the JPA stored models
as the venacular models in the Policy Framework.
The next step is to pass the authorative objects over the
provider interface rather than the JPA obejcts. This change will
be made in the next review.
Minor changes to pdp objects to remove JPA things from them. These
object will be the authorative in-memory obejcts on the PDP side and
new JPA entity object will be introduced in a future review to persist
them.
Issue-ID: POLICY-1095
Change-Id: I40e7b713903980cb41bb315417111b67a9b17307
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
Change-Id: I4b2f69bb023a07930b9f418b88078d04a24b7303
Issue-ID: POLICY-1542
Signed-off-by: Jim Hahn <jrh3@att.com>
|
|
Legacy operational policies now fully supported for
serialization and persistence from provider through to
database and back. Unit test coverage completed
also
Issue-ID: POLICY-1095
Change-Id: I65755859c94b50edee537d2685f51a7838c6541f
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
The ErrorResponse object is now contained in Policy Framework
exceptions.
Issue-ID: POLICY-1095
Change-Id: Ib0ce6cdbbead939afefc4afa3f507eb1a28c4a5c
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
Added additional PolicyIdentXxx classes. Added PdpDeployPolicies, which
makes use of it, thus eliminating the need for PdpPolicies, which will be
deleted once the PAP has been modified to use the new code.
Added Validated class to facilitate field validation.
Added utility methods to Validated class.
Use new validator methods in PolicyIdentXxx classes.
Use addError() method in validator class.
Use parameter types instead of "?".
Use static Validator instead of local.
Get "result" from each call to a validateXxx() method.
Derived PolicyIdentOptVersion from PfConceptKey.
Moved PolicyIdent classes to models-pdp.
Added PolicyIdent classes to models-pap.
Also removed copy constructors from classes in models-pap, as those
are plain POJOs that will not be copied. Copy constructors will be
added to new classes that will be added to models-pdp in a separate
review.
Forgot to include the new Ident classes in models-pap.
Change-Id: I923132c464c7802ee3e9225685cde44f36c64620
Issue-ID: POLICY-1542
Signed-off-by: Jim Hahn <jrh3@att.com>
|
|
Also changed supportedPolicyTypes to PfConceptKey.
Updated licenses.
Removed trailing whitespace from pom.
Provide default request id.
Rebased to fix merge conflict.
Added SupportedPolicyType class.
Renamed SupportedPolicyType to PolicyTypeIdent, and moved it to
models-base. Also updated models-pap to use it.
Deleted models-pdp Policy and replaced it with ToscaPolicy.
Updated test method name.
Change-Id: Id65f769c2f308c6b56e79978bd50b84f2e0b3d02
Issue-ID: POLICY-1542
Signed-off-by: Jim Hahn <jrh3@att.com>
|
|
Also added a method to PfUtils to simplify cloning lists.
Change-Id: Iae667be02cced57b0b9578e0a96c5cda38111b97
Issue-ID: POLICY-1542
Signed-off-by: Jim Hahn <jrh3@att.com>
|
|
Interface allows uniform geting of information from checked
and runtime model exceptions
Issue-ID: POLICY-1195
Change-Id: I913b98a4d4b705ed256714392cafc72d6a71877f
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
The unit test MonitoringPolicySerializationTest tests
persistence for policies and shows how persistence works.
Issue-ID: POLICY-1195
Change-Id: I933eb538238f9ccd41ce69614e0c9afcac869c29
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
Add DAO annotations to TOSCA model
Add keying between concepts and define
foreign keys in objects for translation to DB schema
Added provider interface, factory, and stubbed implementation.
Completed unit test for models-base
Completed unit test for models-dao
Completed unit test for models-tosca
Issue-ID: POLICY-1195
Change-Id: I53a0ba8b7a679b6887b38bdab184b60315e0cf5b
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
This patch set fixes some typos and license headers.
Issue-ID: POLICY-1195
Change-Id: I2d15b00fcb50ea92746ab7c5a87b57efa07196fe
Signed-off-by: liamfallon <liam.fallon@est.tech>
|
|
This review introduces the basic concepts that all model objects
inherit from. Using this approach, all concepts that inherit from
these types can use standardized DAO handling and marrshal/unmarshal
handling
This approach is a more generic version of the approach used in the
APEX PDP for model handling. The APEX model handling will inherit this
module.
Issue-ID: POLICY-1264
Change-Id: I35b76659ab66cf3f33bee59a5528e49c7edf7796
Signed-off-by: liamfallon <liam.fallon@est.tech>
|