summaryrefslogtreecommitdiffstats
path: root/controlloop/common/guard/src/main
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2018-08-14 14:22:34 -0400
committerPamela Dragosh <pdragosh@research.att.com>2018-08-14 14:22:41 -0400
commitdbe1d23be5420a5efa4d3977fee974c452bbfd29 (patch)
treecf5ab051e698d9278e6fd28022acbd5c1a9a91a2 /controlloop/common/guard/src/main
parent6f9976df27dccb2dcaedeb9106166f62a435b050 (diff)
Fix checkstyle issues
Spacing, missing javadoc Issue-ID: POLICY-883 Change-Id: Ice65c6c1baf0bb7c6273411f078bacfe3496b89b Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Diffstat (limited to 'controlloop/common/guard/src/main')
-rw-r--r--controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuard.java20
-rw-r--r--controlloop/common/guard/src/main/java/org/onap/policy/guard/Util.java2
2 files changed, 13 insertions, 9 deletions
diff --git a/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuard.java b/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuard.java
index e9ff01072..e4fd27415 100644
--- a/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuard.java
+++ b/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuard.java
@@ -64,6 +64,8 @@ public class PolicyGuard {
}
/**
+ * Get the factory.
+ *
* @return the factory used to access various objects
*/
protected static Factory getFactory() {
@@ -72,7 +74,7 @@ public class PolicyGuard {
/**
* Sets the factory to be used by junit tests.
- * @param factory
+ * @param factory factory
*/
protected static void setFactory(Factory factory) {
PolicyGuard.factory = factory;
@@ -95,7 +97,7 @@ public class PolicyGuard {
String owner = makeOwner(targetType, requestID);
boolean result = factory.getManager().lock(targetInstance, owner, holdSec);
- if(!result) {
+ if (!result) {
return LockResult.createLockResult(GuardResult.LOCK_DENIED, null);
}
@@ -145,7 +147,7 @@ public class PolicyGuard {
boolean result = factory.getManager().refresh(lock.getTargetInstance(), owner, holdSec);
logger.debug("Lock {} extend {}", lock, result);
- return(result ? GuardResult.LOCK_ACQUIRED : GuardResult.LOCK_DENIED);
+ return (result ? GuardResult.LOCK_ACQUIRED : GuardResult.LOCK_DENIED);
}
/**
@@ -160,7 +162,7 @@ public class PolicyGuard {
String owner = makeOwner(lock.getTargetType(), lock.getRequestID());
boolean result = factory.getManager().unlock(lock.getTargetInstance(), owner);
- if(result) {
+ if (result) {
logger.debug("Unlocked {}", lock);
return true;
}
@@ -184,17 +186,17 @@ public class PolicyGuard {
/**
* Combines the target type and request ID to yield a single, "owner" string.
- * @param targetType
- * @param requestID
+ * @param targetType target type
+ * @param requestID request id
* @return the "owner" of a resource
* @throws IllegalArgumentException if either argument is null
*/
private static String makeOwner(TargetType targetType, UUID requestID) {
- if(targetType == null) {
+ if (targetType == null) {
throw new IllegalArgumentException("null targetType for lock request id " + requestID);
}
- if(requestID == null) {
+ if (requestID == null) {
throw new IllegalArgumentException("null requestID for lock type " + targetType);
}
@@ -207,6 +209,8 @@ public class PolicyGuard {
public static class Factory {
/**
+ * Get the manager.
+ *
* @return the lock manager to be used
*/
public PolicyResourceLockManager getManager() {
diff --git a/controlloop/common/guard/src/main/java/org/onap/policy/guard/Util.java b/controlloop/common/guard/src/main/java/org/onap/policy/guard/Util.java
index 233fc0b49..46a815cdd 100644
--- a/controlloop/common/guard/src/main/java/org/onap/policy/guard/Util.java
+++ b/controlloop/common/guard/src/main/java/org/onap/policy/guard/Util.java
@@ -135,7 +135,7 @@ public final class Util {
/**
* Sets Guard Properties.
*
- * @see /guard/src/test/java/org/onap/policy/guard/UtilTest.java for setting test properties
+ * <p>see /guard/src/test/java/org/onap/policy/guard/UtilTest.java for setting test properties
*/
public static void setGuardEnvProps(String url, String username, String password, String clientName,
String clientPassword, String environment) {