Last transient/serializable issues.
Throw a dedicated exception for DateUtil class
Unused imports
Make the enclosing method "static" or remove this set.
Issue-ID: POLICY-115
Change-Id: I366f85922c4d4d290b320e0b88678c805de59872
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
/**
* @param vnfItemVnfId the vnfItemVnfId to set
*/
- private void setVnfItemVnfId(String vnfItemVnfId) {
+ private static void setVnfItemVnfId(String vnfItemVnfId) {
SOActorServiceProvider.vnfItemVnfId = vnfItemVnfId;
}
/**
* @param serviceItemServiceInstanceId the serviceItemServiceInstanceId to set
*/
- private void setServiceItemServiceInstanceId(
+ private static void setServiceItemServiceInstanceId(
String serviceItemServiceInstanceId) {
SOActorServiceProvider.serviceItemServiceInstanceId = serviceItemServiceInstanceId;
}
public class PIPEngineGetHistory extends StdConfigurableEngine{
+
private interface DateUtil{
+ public class DateUtilException extends Exception {
+ private static final long serialVersionUID = 2612662650481443076L;
+
+ public DateUtilException(String message) {
+ super(message);
+ }
+
+ }
+
public long getMs();
- public DateUtil init(String sqlValUnit) throws Exception;
+ public DateUtil init(String sqlValUnit) throws DateUtilException;
}
private static final Logger logger = LoggerFactory.getLogger(PIPEngineGetHistory.class);
private double multiplier = 0;
@Override
- public DateUtil init(String sqlValUnit) throws Exception{
+ public DateUtil init(String sqlValUnit) throws DateUtilException{
String[] split = sqlValUnit.split(" ");
if(split.length != 2){
- throw new Exception("Invalid Value Unit pair for SQL");
+ throw new DateUtilException("Invalid Value Unit pair for SQL");
}
ms = Long.parseLong(split[0]);
package org.onap.policy.aai;
+import java.io.Serializable;
import java.util.LinkedList;
import java.util.List;
import com.google.gson.annotations.SerializedName;
-public class RelatedToProperty {
+public class RelatedToProperty implements Serializable {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 2088088164920423658L;
@SerializedName("related-to-property")
public List<RelatedToPropertyItem> relatedTo = new LinkedList<RelatedToPropertyItem>();
package org.onap.policy.aai;
import java.util.List;
+import java.io.Serializable;
import java.util.LinkedList;
import com.google.gson.annotations.SerializedName;
-public class RelationshipData {
+public class RelationshipData implements Serializable {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 6809180843309562121L;
@SerializedName("relationship-data")
public List<RelationshipDataItem> relationshipData = new LinkedList<>();
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
-import org.onap.policy.aai.AAIGETResponse;
import org.onap.policy.aai.AAIGETVnfResponse;
-import org.onap.policy.aai.AAINQInstanceFilters;
import org.onap.policy.aai.AAIManager;
+import org.onap.policy.aai.AAINQInstanceFilters;
import org.onap.policy.aai.AAINQNamedQuery;
import org.onap.policy.aai.AAINQQueryParameters;
import org.onap.policy.aai.AAINQRequest;