aboutsummaryrefslogtreecommitdiffstats
path: root/feature-no-locking
diff options
context:
space:
mode:
authoradheli.tavares <adheli.tavares@est.tech>2024-08-15 11:08:57 +0100
committeradheli.tavares <adheli.tavares@est.tech>2024-08-15 11:10:39 +0100
commit88744c04a7cfed3a4227bc2137102ff5fe69895f (patch)
tree5865844183729aed07f06dd2f94e4940e7ff80f1 /feature-no-locking
parentf6d8e60eb75733cf9996bffb3c6ecb586f377da6 (diff)
PostgreSQL support for Drools
- moved all sql related management to db-migrator - any hardcoded variable related to database is configurable Issue-ID: POLICY-5107 Change-Id: I789895773ba8737651f68a0b494f72f947a147d1 Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
Diffstat (limited to 'feature-no-locking')
-rw-r--r--feature-no-locking/src/assembly/assemble_zip.xml7
-rw-r--r--feature-no-locking/src/main/java/org/onap/policy/no/locking/NoLockManager.java9
-rw-r--r--feature-no-locking/src/test/java/org/onap/policy/no/locking/NoLockManagerTest.java2
3 files changed, 6 insertions, 12 deletions
diff --git a/feature-no-locking/src/assembly/assemble_zip.xml b/feature-no-locking/src/assembly/assemble_zip.xml
index 2c74fc00..ded6dff7 100644
--- a/feature-no-locking/src/assembly/assemble_zip.xml
+++ b/feature-no-locking/src/assembly/assemble_zip.xml
@@ -3,6 +3,7 @@
ONAP
================================================================================
Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
+ Modifications Copyright (C) 2024 Nordix Foundation.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -60,12 +61,6 @@
<excludes/>
</fileSet>
<fileSet>
- <directory>src/main/feature/db</directory>
- <outputDirectory>db</outputDirectory>
- <fileMode>0744</fileMode>
- <excludes/>
- </fileSet>
- <fileSet>
<directory>src/main/feature/install</directory>
<outputDirectory>install</outputDirectory>
<fileMode>0744</fileMode>
diff --git a/feature-no-locking/src/main/java/org/onap/policy/no/locking/NoLockManager.java b/feature-no-locking/src/main/java/org/onap/policy/no/locking/NoLockManager.java
index 49ea0af9..449f7480 100644
--- a/feature-no-locking/src/main/java/org/onap/policy/no/locking/NoLockManager.java
+++ b/feature-no-locking/src/main/java/org/onap/policy/no/locking/NoLockManager.java
@@ -3,6 +3,7 @@
* ONAP
* ================================================================================
* Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2024 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,7 +21,6 @@
package org.onap.policy.no.locking;
-import java.util.Properties;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.onap.policy.drools.core.lock.AlwaysSuccessLock;
@@ -28,7 +28,6 @@ import org.onap.policy.drools.core.lock.Lock;
import org.onap.policy.drools.core.lock.LockCallback;
import org.onap.policy.drools.core.lock.PolicyResourceLockManager;
import org.onap.policy.drools.features.PolicyEngineFeatureApi;
-import org.onap.policy.drools.system.PolicyEngine;
/**
* In contrast with other implementations the no-lock manager provides non-synchronized access
@@ -43,8 +42,8 @@ public class NoLockManager implements PolicyResourceLockManager, PolicyEngineFea
@Override
public Lock createLock(String resourceId, String ownerKey, int holdSec,
- LockCallback callback, boolean waitForLock) {
- var successLock = new AlwaysSuccessLock(resourceId, ownerKey, holdSec, callback);
+ LockCallback callback, boolean waitForLock) {
+ var successLock = new AlwaysSuccessLock(resourceId, ownerKey, holdSec, callback);
successLock.notifyAvailable();
return successLock;
}
@@ -90,7 +89,7 @@ public class NoLockManager implements PolicyResourceLockManager, PolicyEngineFea
}
@Override
- public PolicyResourceLockManager beforeCreateLockManager(PolicyEngine engine, Properties properties) {
+ public PolicyResourceLockManager beforeCreateLockManager() {
return this;
}
}
diff --git a/feature-no-locking/src/test/java/org/onap/policy/no/locking/NoLockManagerTest.java b/feature-no-locking/src/test/java/org/onap/policy/no/locking/NoLockManagerTest.java
index 5b5e0964..22f3f5d1 100644
--- a/feature-no-locking/src/test/java/org/onap/policy/no/locking/NoLockManagerTest.java
+++ b/feature-no-locking/src/test/java/org/onap/policy/no/locking/NoLockManagerTest.java
@@ -93,7 +93,7 @@ public class NoLockManagerTest {
@Test
void testBeforeCreateLockManager() {
- assertEquals(nlm, nlm.beforeCreateLockManager(null, null));
+ assertEquals(nlm, nlm.beforeCreateLockManager());
}
@Test