package org.onap.policy.controlloop.actor.vfc;
import java.util.Collections;
-import java.util.HashMap;
import java.util.List;
-import java.util.Map;
-import org.onap.policy.controlloop.VirtualControlLoopEvent;
-import org.onap.policy.vfc.VFCRequest;
-import org.onap.policy.vfc.VFCHealRequest;
-import org.onap.policy.vfc.VFCHealAdditionalParams;
-import org.onap.policy.vfc.VFCHealActionVmInfo;
import org.onap.policy.controlloop.ControlLoopOperation;
+import org.onap.policy.controlloop.VirtualControlLoopEvent;
+import org.onap.policy.controlloop.actorServiceProvider.spi.Actor;
import org.onap.policy.controlloop.policy.Policy;
+import org.onap.policy.vfc.VFCHealActionVmInfo;
+import org.onap.policy.vfc.VFCHealAdditionalParams;
+import org.onap.policy.vfc.VFCHealRequest;
+import org.onap.policy.vfc.VFCRequest;
-import org.onap.policy.controlloop.actorServiceProvider.spi.Actor;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
public final UUID requestID;
private String controlLoopResult;
- private ControlLoopProcessor processor = null;
+ private transient ControlLoopProcessor processor = null;
private VirtualControlLoopEvent onset;
private Integer numOnsets = 0;
private Integer numAbatements = 0;
private boolean isActivated = false;
private LinkedList<ControlLoopOperation> controlLoopHistory = new LinkedList<>();
private ControlLoopOperationManager currentOperation = null;
- private TargetLock targetLock = null;
+ private transient TargetLock targetLock = null;
private static AAIGETVnfResponse vnfResponse = null;
private static AAIGETVserverResponse vserverResponse = null;
//
//public final ATTControlLoopEvent onset;
public final ControlLoopEvent onset;
- public final Policy policy;
+ public final transient Policy policy;
//
// Properties used to track the Operation
//
private int attempts = 0;
- private Operation currentOperation = null;
+ private transient Operation currentOperation = null;
private LinkedList<Operation> operationHistory = new LinkedList<Operation>();
private PolicyResult policyResult = null;
private ControlLoopEventManager eventManager = null;
}
private String guardApprovalStatus = "NONE";//"NONE", "PERMIT", "DENY"
- private Object operationRequest;
+ private transient Object operationRequest;
public Object getOperationRequest() {
return operationRequest;
try {
diff = now - dateUtil.init(timeWindow).getMs();
} catch (Exception ex) {
- System.err.println("PIP thread got Exception " + ex.getLocalizedMessage());
+ logger.error("PIP thread got Exception " + ex);
return -1;
}
} catch (Exception e) {
String message = "Parsing Content-Type: " + connection.getContentType() + ", error=" + e.getMessage();
- logger.error("{}: callRESTfulPDP threw: ", message);
+ logger.error("{}: callRESTfulPDP threw: ", message, e);
}
} else {
private final TargetType targetType;
private final String target;
private final UUID requestID;
- private final LockCallback callback;
+ private final transient LockCallback callback;
public PNFTargetLock (TargetType type, String target, UUID requestID, LockCallback callback) {
this.lockID = UUID.randomUUID();
private final TargetType targetType;
private final String target;
private final UUID requestID;
- private final LockCallback callback;
+ private final transient LockCallback callback;
public VMTargetLock(TargetType targetType, String target, UUID requestID, LockCallback callback) {
this.lockID = UUID.randomUUID();
private final TargetType targetType;
private final String target;
private final UUID requestID;
- private final LockCallback callback;
+ private final transient LockCallback callback;
public VNFTargetLock (TargetType type, String target, UUID requestID, LockCallback callback) {
this.lockID = UUID.randomUUID();
Thread.sleep(1000);
} catch (InterruptedException e) {
logger.error(e.getMessage());
+ Thread.currentThread().interrupt();
}
}
package org.onap.policy.aai;
+import java.io.Serializable;
+
import com.google.gson.annotations.SerializedName;
-public class RelatedToPropertyItem {
+public class RelatedToPropertyItem implements Serializable {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 5644372985092588637L;
+
@SerializedName("property-key")
public String propertyKey;
@SerializedName("property-value")
package org.onap.policy.aai;
+import java.io.Serializable;
+
import com.google.gson.annotations.SerializedName;
-public class Relationship {
+public class Relationship implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -68508443869003054L;
@SerializedName("related-to")
public String relatedTo;
logger.error("Failed to deserialize into SOResponse: ", e);
} catch (InterruptedException e) {
logger.error("Interrupted exception: ", e);
+ Thread.currentThread().interrupt();
}
}
package org.onap.policy.vfc;\r
\r
import java.io.Serializable;\r
-import java.time.LocalDateTime;\r
\r
import com.google.gson.annotations.SerializedName;\r
\r
package org.onap.policy.vfc;\r
\r
import java.io.Serializable;\r
-import java.time.LocalDateTime;\r
\r
import com.google.gson.annotations.SerializedName;\r
\r
package org.onap.policy.vfc;\r
\r
import java.io.Serializable;\r
-import java.time.LocalDateTime;\r
\r
import com.google.gson.annotations.SerializedName;\r
\r
logger.error("Failed to deserialize into VFCResponse {}",e.getLocalizedMessage(),e);
} catch (InterruptedException e) {
logger.error("Interrupted exception: {}", e.getLocalizedMessage(), e);
+ Thread.currentThread().interrupt();
}
} else {
logger.warn("VFC Heal Restcall failed");
package org.onap.policy.vfc;
import java.io.Serializable;
-import java.time.LocalDateTime;
import com.google.gson.annotations.SerializedName;
package org.onap.policy.vfc;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.onap.policy.vfc.VFCRequest;
-import org.onap.policy.vfc.VFCHealRequest;
-import org.onap.policy.vfc.VFCHealAdditionalParams;
-import org.onap.policy.vfc.VFCHealActionVmInfo;
-import org.onap.policy.vfc.VFCResponse;
-import org.onap.policy.vfc.VFCResponseDescriptor;
+import java.util.LinkedList;
+
import org.junit.Test;
import org.onap.policy.vfc.util.Serialization;
-import java.util.LinkedList;
-import java.util.List;
public class TestDemo {
responseDescriptor.errorCode = null;
responseDescriptor.responseId = "11";
- response.responseDescriptor.responseHistoryList = new LinkedList();
+ response.responseDescriptor.responseHistoryList = new LinkedList<>();
response.responseDescriptor.responseHistoryList.add(responseDescriptor);
body = Serialization.gsonPretty.toJson(response);
private static class PolicyNodeWrapper implements NodeWrapper {
private static final long serialVersionUID = 8170162175653823082L;
- private Policy policy;
+ private transient Policy policy;
public PolicyNodeWrapper(Policy operPolicy) {
this.policy = operPolicy;
package org.onap.policy.simulators;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
import java.util.HashMap;
import org.junit.AfterClass;
import org.junit.BeforeClass;
-import org.junit.Ignore;
import org.junit.Test;
import org.onap.policy.drools.http.server.HttpServletServer;
-import org.onap.policy.vfc.VFCResponse;
-import org.onap.policy.vfc.util.Serialization;
import org.onap.policy.rest.RESTManager;
import org.onap.policy.rest.RESTManager.Pair;
+import org.onap.policy.vfc.VFCResponse;
+import org.onap.policy.vfc.util.Serialization;
public class VfcSimulatorTest {