aboutsummaryrefslogtreecommitdiffstats
path: root/controlloop/common/guard/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'controlloop/common/guard/src/main')
-rw-r--r--controlloop/common/guard/src/main/java/org/onap/policy/guard/CallGuardTask.java6
-rw-r--r--controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuard.java18
-rw-r--r--controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardRequest.java8
-rw-r--r--controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardResponse.java8
-rw-r--r--controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardXacmlHelper.java16
-rw-r--r--controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardXacmlRequestAttributes.java66
-rw-r--r--controlloop/common/guard/src/main/java/org/onap/policy/guard/TargetLock.java6
-rw-r--r--controlloop/common/guard/src/main/java/org/onap/policy/guard/impl/PnfTargetLock.java (renamed from controlloop/common/guard/src/main/java/org/onap/policy/guard/impl/PNFTargetLock.java)12
-rw-r--r--controlloop/common/guard/src/main/java/org/onap/policy/guard/impl/VmTargetLock.java (renamed from controlloop/common/guard/src/main/java/org/onap/policy/guard/impl/VMTargetLock.java)12
-rw-r--r--controlloop/common/guard/src/main/java/org/onap/policy/guard/impl/VnfTargetLock.java (renamed from controlloop/common/guard/src/main/java/org/onap/policy/guard/impl/VNFTargetLock.java)12
10 files changed, 82 insertions, 82 deletions
diff --git a/controlloop/common/guard/src/main/java/org/onap/policy/guard/CallGuardTask.java b/controlloop/common/guard/src/main/java/org/onap/policy/guard/CallGuardTask.java
index fefea39ab..046b7cfd6 100644
--- a/controlloop/common/guard/src/main/java/org/onap/policy/guard/CallGuardTask.java
+++ b/controlloop/common/guard/src/main/java/org/onap/policy/guard/CallGuardTask.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* guard
* ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -131,7 +131,7 @@ public class CallGuardTask implements Runnable {
//
// Make guard request
//
- guardDecision = new PolicyGuardXacmlHelper().callPDP(xacmlReq);
+ guardDecision = new PolicyGuardXacmlHelper().callPdp(xacmlReq);
logger.debug("\n********** XACML RESPONSE START ********");
logger.debug("{}", guardDecision);
@@ -153,7 +153,7 @@ public class CallGuardTask implements Runnable {
//
if ("Indeterminate".equals(guardResponse.getResult())) {
guardResponse.setOperation(recipe);
- guardResponse.setRequestID(UUID.fromString(requestId));
+ guardResponse.setRequestId(UUID.fromString(requestId));
}
long estimatedTime = System.nanoTime() - startTime;
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 e4849cea5..7ae0e7eb2 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
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* guard
* ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,9 +23,9 @@ package org.onap.policy.guard;
import java.util.UUID;
import org.onap.policy.controlloop.policy.TargetType;
import org.onap.policy.drools.core.lock.PolicyResourceLockManager;
-import org.onap.policy.guard.impl.PNFTargetLock;
-import org.onap.policy.guard.impl.VMTargetLock;
-import org.onap.policy.guard.impl.VNFTargetLock;
+import org.onap.policy.guard.impl.PnfTargetLock;
+import org.onap.policy.guard.impl.VmTargetLock;
+import org.onap.policy.guard.impl.VnfTargetLock;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -97,17 +97,17 @@ public class PolicyGuard {
//
// Create the Lock object
//
- return new PNFTargetLock(targetType, targetInstance, requestId, callback);
+ return new PnfTargetLock(targetType, targetInstance, requestId, callback);
case VM:
//
// Create the Lock object
//
- return new VMTargetLock(targetType, targetInstance, requestId, callback);
+ return new VmTargetLock(targetType, targetInstance, requestId, callback);
case VNF:
//
// Create the Lock object
//
- return new VNFTargetLock(targetType, targetInstance, requestId, callback);
+ return new VnfTargetLock(targetType, targetInstance, requestId, callback);
default:
logger.error("invalid target type {} for lock on {}", targetType, targetInstance);
return null;
@@ -156,7 +156,7 @@ public class PolicyGuard {
* @return the result: acquired or denied
*/
public static GuardResult lockTarget(TargetLock lock, int holdSec) {
- String owner = makeOwner(lock.getTargetType(), lock.getRequestID());
+ String owner = makeOwner(lock.getTargetType(), lock.getRequestId());
boolean result = factory.getManager().refresh(lock.getTargetInstance(), owner, holdSec);
@@ -173,7 +173,7 @@ public class PolicyGuard {
* @throws IllegalArgumentException if an argument is null
*/
public static boolean unlockTarget(TargetLock lock) {
- String owner = makeOwner(lock.getTargetType(), lock.getRequestID());
+ String owner = makeOwner(lock.getTargetType(), lock.getRequestId());
boolean result = factory.getManager().unlock(lock.getTargetInstance(), owner);
if (result) {
diff --git a/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardRequest.java b/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardRequest.java
index 5cb080fa5..8887e00b7 100644
--- a/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardRequest.java
+++ b/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardRequest.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* guard
* ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -46,7 +46,7 @@ public class PolicyGuardRequest {
@Override
public String toString() {
- return "PolicyGuardRequest [actor=" + actor + ", target=" + target + ", requestID=" + requestId + ", operation="
+ return "PolicyGuardRequest [actor=" + actor + ", target=" + target + ", requestId=" + requestId + ", operation="
+ operation + "]";
}
@@ -66,11 +66,11 @@ public class PolicyGuardRequest {
this.target = target;
}
- public UUID getRequestID() {
+ public UUID getRequestId() {
return requestId;
}
- public void setRequestID(UUID requestId) {
+ public void setRequestId(UUID requestId) {
this.requestId = requestId;
}
diff --git a/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardResponse.java b/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardResponse.java
index d7ece3081..574c50b79 100644
--- a/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardResponse.java
+++ b/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardResponse.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* guard
* ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -42,14 +42,14 @@ public class PolicyGuardResponse {
@Override
public String toString() {
- return "PolicyGuardResponse [requestID=" + requestId + ", operation=" + operation + ", result=" + result + "]";
+ return "PolicyGuardResponse [requestId=" + requestId + ", operation=" + operation + ", result=" + result + "]";
}
- public UUID getRequestID() {
+ public UUID getRequestId() {
return requestId;
}
- public void setRequestID(UUID requestId) {
+ public void setRequestId(UUID requestId) {
this.requestId = requestId;
}
diff --git a/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardXacmlHelper.java b/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardXacmlHelper.java
index 35b1d2561..c2dfc908d 100644
--- a/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardXacmlHelper.java
+++ b/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardXacmlHelper.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* guard
* ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -84,7 +84,7 @@ public class PolicyGuardXacmlHelper {
* @param xacmlReq the XACML request
* @return the response
*/
- public String callPDP(PolicyGuardXacmlRequestAttributes xacmlReq) {
+ public String callPdp(PolicyGuardXacmlRequestAttributes xacmlReq) {
//
// Send it to the PDP
//
@@ -94,11 +94,11 @@ public class PolicyGuardXacmlHelper {
// Build the json request
//
JSONObject attributes = new JSONObject();
- attributes.put("actor", xacmlReq.getActorID());
- attributes.put("recipe", xacmlReq.getOperationID());
- attributes.put("target", xacmlReq.getTargetID());
- if (xacmlReq.getClnameID() != null) {
- attributes.put("clname", xacmlReq.getClnameID());
+ attributes.put("actor", xacmlReq.getActorId());
+ attributes.put("recipe", xacmlReq.getOperationId());
+ attributes.put("target", xacmlReq.getTargetId());
+ if (xacmlReq.getClnameId() != null) {
+ attributes.put("clname", xacmlReq.getClnameId());
}
if (xacmlReq.getVfCount() != null) {
attributes.put("vfCount", xacmlReq.getVfCount());
@@ -221,7 +221,7 @@ public class PolicyGuardXacmlHelper {
* @param xacmlResponse the XACML response
* @return the PolicyGuardResponse
*/
- public static PolicyGuardResponse parseXACMLPDPResponse(com.att.research.xacml.api.Response xacmlResponse) {
+ public static PolicyGuardResponse parseXacmlPdpResponse(com.att.research.xacml.api.Response xacmlResponse) {
if (xacmlResponse == null) {
//
// In case the actual XACML response was null, create an empty
diff --git a/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardXacmlRequestAttributes.java b/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardXacmlRequestAttributes.java
index d7e608cb8..da03addf9 100644
--- a/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardXacmlRequestAttributes.java
+++ b/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardXacmlRequestAttributes.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* guard
* ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,19 +29,19 @@ import com.att.research.xacml.std.annotations.XACMLSubject;
public class PolicyGuardXacmlRequestAttributes {
@XACMLSubject(includeInResults = true, attributeId = "urn:oasis:names:tc:xacml:1.0:clname:clname-id")
- String clnameID;
+ String clnameId;
@XACMLSubject(includeInResults = true, attributeId = "urn:oasis:names:tc:xacml:1.0:actor:actor-id")
- String actorID;
+ String actorId;
@XACMLAction(includeInResults = true, attributeId = "urn:oasis:names:tc:xacml:1.0:operation:operation-id")
- String operationID;
+ String operationId;
@XACMLResource(includeInResults = true, attributeId = "urn:oasis:names:tc:xacml:1.0:target:target-id")
- String targetID;
+ String targetId;
@XACMLResource(includeInResults = true, attributeId = "urn:oasis:names:tc:xacml:1.0:request:request-id")
- String requestID;
+ String requestId;
@XACMLResource(includeInResults = true, attributeId = "urn:oasis:names:tc:xacml:1.0:request:vf-count")
Integer vfCount;
@@ -59,58 +59,58 @@ public class PolicyGuardXacmlRequestAttributes {
public PolicyGuardXacmlRequestAttributes(String clnameId, String actorId, String operationId, String targetId,
String requestId, Integer vfCount) {
super();
- this.clnameID = clnameId;
- this.actorID = actorId;
- this.operationID = operationId;
- this.targetID = targetId;
- this.requestID = requestId;
+ this.clnameId = clnameId;
+ this.actorId = actorId;
+ this.operationId = operationId;
+ this.targetId = targetId;
+ this.requestId = requestId;
this.vfCount = vfCount;
}
@Override
public String toString() {
- return "PolicyGuardXacmlRequestAttributes [actorID=" + actorID + ", operationID=" + operationID + ", targetID="
- + targetID + ", requestID=" + requestID + "]";
+ return "PolicyGuardXacmlRequestAttributes [actorId=" + actorId + ", operationId=" + operationId + ", targetId="
+ + targetId + ", requestId=" + requestId + "]";
}
- public String getActorID() {
- return actorID;
+ public String getActorId() {
+ return actorId;
}
- public void setActorID(String actorID) {
- this.actorID = actorID;
+ public void setActorId(String actorId) {
+ this.actorId = actorId;
}
- public String getOperationID() {
- return operationID;
+ public String getOperationId() {
+ return operationId;
}
- public void setOperationID(String operationID) {
- this.operationID = operationID;
+ public void setOperationId(String operationId) {
+ this.operationId = operationId;
}
- public String getTargetID() {
- return targetID;
+ public String getTargetId() {
+ return targetId;
}
- public void setTargetID(String targetID) {
- this.targetID = targetID;
+ public void setTargetId(String targetId) {
+ this.targetId = targetId;
}
- public String getRequestID() {
- return requestID;
+ public String getRequestId() {
+ return requestId;
}
- public void setRequestID(String requestID) {
- this.requestID = requestID;
+ public void setRequestId(String requestId) {
+ this.requestId = requestId;
}
- public String getClnameID() {
- return clnameID;
+ public String getClnameId() {
+ return clnameId;
}
- public void setClnameID(String clnameID) {
- this.clnameID = clnameID;
+ public void setClnameId(String clnameId) {
+ this.clnameId = clnameId;
}
public Integer getVfCount() {
diff --git a/controlloop/common/guard/src/main/java/org/onap/policy/guard/TargetLock.java b/controlloop/common/guard/src/main/java/org/onap/policy/guard/TargetLock.java
index 1e3064abd..eea46c3cc 100644
--- a/controlloop/common/guard/src/main/java/org/onap/policy/guard/TargetLock.java
+++ b/controlloop/common/guard/src/main/java/org/onap/policy/guard/TargetLock.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* guard
* ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017, 2019 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,12 +26,12 @@ import org.onap.policy.controlloop.policy.TargetType;
public interface TargetLock {
- public UUID getLockID();
+ public UUID getLockId();
public TargetType getTargetType();
public String getTargetInstance();
- public UUID getRequestID();
+ public UUID getRequestId();
}
diff --git a/controlloop/common/guard/src/main/java/org/onap/policy/guard/impl/PNFTargetLock.java b/controlloop/common/guard/src/main/java/org/onap/policy/guard/impl/PnfTargetLock.java
index 904448591..c1ad34a22 100644
--- a/controlloop/common/guard/src/main/java/org/onap/policy/guard/impl/PNFTargetLock.java
+++ b/controlloop/common/guard/src/main/java/org/onap/policy/guard/impl/PnfTargetLock.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* guard
* ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,7 +27,7 @@ import org.onap.policy.controlloop.policy.TargetType;
import org.onap.policy.guard.LockCallback;
import org.onap.policy.guard.TargetLock;
-public class PNFTargetLock implements TargetLock, Serializable {
+public class PnfTargetLock implements TargetLock, Serializable {
private static final long serialVersionUID = 2335897394577202732L;
@@ -45,7 +45,7 @@ public class PNFTargetLock implements TargetLock, Serializable {
* @param requestId the request Id
* @param callback the callback
*/
- public PNFTargetLock(TargetType type, String target, UUID requestId, LockCallback callback) {
+ public PnfTargetLock(TargetType type, String target, UUID requestId, LockCallback callback) {
this.lockId = UUID.randomUUID();
this.targetType = type;
this.target = target;
@@ -54,7 +54,7 @@ public class PNFTargetLock implements TargetLock, Serializable {
}
@Override
- public UUID getLockID() {
+ public UUID getLockId() {
return this.lockId;
}
@@ -70,7 +70,7 @@ public class PNFTargetLock implements TargetLock, Serializable {
}
@Override
- public UUID getRequestID() {
+ public UUID getRequestId() {
return this.requestId;
}
@@ -80,7 +80,7 @@ public class PNFTargetLock implements TargetLock, Serializable {
@Override
public String toString() {
- return "PNFTargetLock [lockID=" + lockId + ", targetType=" + targetType + ", target=" + target + ", requestID="
+ return "PnfTargetLock [lockId=" + lockId + ", targetType=" + targetType + ", target=" + target + ", requestId="
+ requestId + "]";
}
diff --git a/controlloop/common/guard/src/main/java/org/onap/policy/guard/impl/VMTargetLock.java b/controlloop/common/guard/src/main/java/org/onap/policy/guard/impl/VmTargetLock.java
index 6046e3a32..301c6ec7c 100644
--- a/controlloop/common/guard/src/main/java/org/onap/policy/guard/impl/VMTargetLock.java
+++ b/controlloop/common/guard/src/main/java/org/onap/policy/guard/impl/VmTargetLock.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* guard
* ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,7 +27,7 @@ import org.onap.policy.controlloop.policy.TargetType;
import org.onap.policy.guard.LockCallback;
import org.onap.policy.guard.TargetLock;
-public class VMTargetLock implements TargetLock, Serializable {
+public class VmTargetLock implements TargetLock, Serializable {
private static final long serialVersionUID = -8795145054334409724L;
private final UUID lockId;
@@ -44,7 +44,7 @@ public class VMTargetLock implements TargetLock, Serializable {
* @param requestId the request Id
* @param callback the callback
*/
- public VMTargetLock(TargetType targetType, String target, UUID requestId, LockCallback callback) {
+ public VmTargetLock(TargetType targetType, String target, UUID requestId, LockCallback callback) {
this.lockId = UUID.randomUUID();
this.targetType = targetType;
this.target = target;
@@ -53,7 +53,7 @@ public class VMTargetLock implements TargetLock, Serializable {
}
@Override
- public UUID getLockID() {
+ public UUID getLockId() {
return this.lockId;
}
@@ -68,7 +68,7 @@ public class VMTargetLock implements TargetLock, Serializable {
}
@Override
- public UUID getRequestID() {
+ public UUID getRequestId() {
return this.requestId;
}
@@ -78,7 +78,7 @@ public class VMTargetLock implements TargetLock, Serializable {
@Override
public String toString() {
- return "VMTargetLock [lockID=" + lockId + ", targetType=" + targetType + ", target=" + target + ", requestID="
+ return "VmTargetLock [lockId=" + lockId + ", targetType=" + targetType + ", target=" + target + ", requestId="
+ requestId + "]";
}
diff --git a/controlloop/common/guard/src/main/java/org/onap/policy/guard/impl/VNFTargetLock.java b/controlloop/common/guard/src/main/java/org/onap/policy/guard/impl/VnfTargetLock.java
index 418a3ed78..2e3fc28b1 100644
--- a/controlloop/common/guard/src/main/java/org/onap/policy/guard/impl/VNFTargetLock.java
+++ b/controlloop/common/guard/src/main/java/org/onap/policy/guard/impl/VnfTargetLock.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* guard
* ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,7 +27,7 @@ import org.onap.policy.controlloop.policy.TargetType;
import org.onap.policy.guard.LockCallback;
import org.onap.policy.guard.TargetLock;
-public class VNFTargetLock implements TargetLock, Serializable {
+public class VnfTargetLock implements TargetLock, Serializable {
private static final long serialVersionUID = 2335897394577202732L;
@@ -45,7 +45,7 @@ public class VNFTargetLock implements TargetLock, Serializable {
* @param requestId the request Id
* @param callback the callback
*/
- public VNFTargetLock(TargetType type, String target, UUID requestId, LockCallback callback) {
+ public VnfTargetLock(TargetType type, String target, UUID requestId, LockCallback callback) {
this.lockId = UUID.randomUUID();
this.targetType = type;
this.target = target;
@@ -54,7 +54,7 @@ public class VNFTargetLock implements TargetLock, Serializable {
}
@Override
- public UUID getLockID() {
+ public UUID getLockId() {
return this.lockId;
}
@@ -70,7 +70,7 @@ public class VNFTargetLock implements TargetLock, Serializable {
}
@Override
- public UUID getRequestID() {
+ public UUID getRequestId() {
return this.requestId;
}
@@ -80,7 +80,7 @@ public class VNFTargetLock implements TargetLock, Serializable {
@Override
public String toString() {
- return "VNFTargetLock [lockID=" + lockId + ", targetType=" + targetType + ", target=" + target + ", requestID="
+ return "VnfTargetLock [lockId=" + lockId + ", targetType=" + targetType + ", target=" + target + ", requestId="
+ requestId + "]";
}