Reimplement Lock API using Lock objects

Modified PolicyResourceLockManager to just return a feature, deferring
the lock() call/method to the feature, itself.  The manager was also
modified so that, if it can't find an enabled provider, it will return
a default provider, whose lock() methods always fail.  Once a feature
has been identified, the manager will cache it for use thereafter.

Modified the feature API to return lock objects and simplified the
interface to remove the beforeXxx and afterXxx methods.
Moved the unlock and refresh methods from the feature API into the
lock class, renaming them to free and extend, respectively.
Added a separate, feature-simple-locking project, which implements
a simple version of the locking feature, over a single JVM.
Extensively revised the distributed locking feature to fit in with
the new API.

Added support for persistence so that the various LockImpl classes
can be serialized and still function correctly when they are
deserialized back into new feature instances
Added default implementations of free & extend to LockImpl.
Modified API to take the ownerKey string, instead of the owner object.
Removed Extractor as unneeded - may add via another review, if still useful.

Updates per review comments:
- Updated licenses in feature-simple-locking
- Added beforeCreateLock & afterCreateLock to feature API
- Moved SimpleLockingFeature into policy-management so that it's
  always available
- Moved the executor service, "exsvc", into PolicyEngine
- Moved Extrator into policy-utils
- Changed Extractor logging level for exceptions
- Fixed feature sequence numbers
- Fixed mixing of seconds and milliseconds
- Renamed exsvc
- Modified to use property method with default value
- Configured scheduled executor
- Added suffix to Extractor.register()
- Eliminated Feature Api and tied lock manager into engine
- Added non-null checks to LockImpl parameters
- Added non-null checks to createLock() parameters
- Checked that lockManager is initialized

Change-Id: Iddba38157ddc5f7277656979c0e679e5489eb7b1
Issue-ID: POLICY-2113
Signed-off-by: Jim Hahn <jrh3@att.com>
38 files changed
tree: e91c7bfb7365f9a06ad5674bc83e041b7237e378
  1. api-active-standby-management/
  2. api-state-management/
  3. feature-active-standby-management/
  4. feature-controller-logging/
  5. feature-distributed-locking/
  6. feature-eelf/
  7. feature-healthcheck/
  8. feature-lifecycle/
  9. feature-mdc-filters/
  10. feature-pooling-dmaap/
  11. feature-session-persistence/
  12. feature-simulators/
  13. feature-state-management/
  14. feature-test-transaction/
  15. packages/
  16. policy-core/
  17. policy-management/
  18. policy-utils/
  19. releases/
  20. .gitignore
  21. .gitreview
  22. INFO.yaml
  23. LICENSE.txt
  24. lombok.config
  25. pom.xml
  26. README.md
  27. version.properties
README.md

Copyright 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 DroolsPDP code. To build it:

  1. using Maven 3
  2. git clone http://gerrit.onap.org/r/oparent and copy oparent/settings.xml to ~/.m2
  3. mvn clean install