TermList termEntry = new TermList();
termEntry.setTermName(ruleName);
- termEntry.setSrcIPList(srcListInsert);
- termEntry.setDestIPList(destListInsert);
+ termEntry.setSrcIpList(srcListInsert);
+ termEntry.setDestIpList(destListInsert);
termEntry.setProtocolList("null");
termEntry.setPortList("null");
termEntry.setSrcPortList("null");
termEntry.setDestPortList(destPortListInsert);
termEntry.setAction(action);
termEntry.setDescription(description);
- termEntry.setFromZones(fromZoneInsert);
- termEntry.setToZones(toZoneInsert);
+ termEntry.setFromZone(fromZoneInsert);
+ termEntry.setToZone(toZoneInsert);
termEntry.setUserCreatedBy(userInfo);
dbConnection.save(termEntry);
TermList termEntry = new TermList();
termEntry.setTermName(ruleName);
- termEntry.setSrcIPList(srcListInsert);
- termEntry.setDestIPList(destListInsert);
+ termEntry.setSrcIpList(srcListInsert);
+ termEntry.setDestIpList(destListInsert);
termEntry.setProtocolList("null");
termEntry.setPortList("null");
termEntry.setSrcPortList("null");
termEntry.setDestPortList(destPortListInsert);
termEntry.setAction(action);
termEntry.setDescription(description);
- termEntry.setFromZones(fromZoneInsert);
- termEntry.setToZones(toZoneInsert);
+ termEntry.setFromZone(fromZoneInsert);
+ termEntry.setToZone(toZoneInsert);
termEntry.setUserCreatedBy(userInfo);
dbConnection.save(termEntry);
serviceListEntry.setServiceName(groupName);
serviceListEntry.setServiceDescription(description);
serviceListEntry.setServiceType(type);
- serviceListEntry.setServiceTransProtocol(transportProtocol);
+ serviceListEntry.setServiceTransportProtocol(transportProtocol);
serviceListEntry.setServiceAppProtocol("null");
serviceListEntry.setServicePorts(ports);
dbConnection.save(serviceListEntry);
import org.onap.policy.rest.jpa.OnapName;
import org.onap.policy.rest.jpa.PepOptions;
import org.onap.policy.rest.jpa.UserInfo;
-import org.onap.policy.rest.jpa.VNFType;
-import org.onap.policy.rest.jpa.VSCLAction;
+import org.onap.policy.rest.jpa.VnfType;
+import org.onap.policy.rest.jpa.VsclAction;
import org.onap.policy.rest.jpa.VarbindDictionary;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
public class ClosedLoopDictionaryController {
private static CommonClassDao commonClassDao;
- private static String vsclaction = "vsclaction";
+ private static String vsclaction = "action";
private static String operation = "operation";
- private static String vnftype = "vnftype";
+ private static String vnftype = "type";
private static String pepName = "pepName";
private static String varbindName = "varbindName";
private static String serviceName = "serviceName";
produces = MediaType.APPLICATION_JSON_VALUE)
public void getVSCLActionDictionaryByNameEntityData(HttpServletResponse response) {
DictionaryUtils utils = getDictionaryUtilsInstance();
- utils.getDataByEntity(response, vsclActionDatas, vsclaction, VSCLAction.class);
+ utils.getDataByEntity(response, vsclActionDatas, vsclaction, VsclAction.class);
}
@RequestMapping(
produces = MediaType.APPLICATION_JSON_VALUE)
public void getVSCLActionDictionaryEntityData(HttpServletResponse response) {
DictionaryUtils utils = getDictionaryUtilsInstance();
- utils.getData(response, vsclActionDatas, VSCLAction.class);
+ utils.getData(response, vsclActionDatas, VsclAction.class);
}
@RequestMapping(
produces = MediaType.APPLICATION_JSON_VALUE)
public void getVNFTypeDictionaryByNameEntityData(HttpServletResponse response) {
DictionaryUtils utils = getDictionaryUtilsInstance();
- utils.getDataByEntity(response, vnfTypeDatas, vnftype, VNFType.class);
+ utils.getDataByEntity(response, vnfTypeDatas, vnftype, VnfType.class);
}
@RequestMapping(
produces = MediaType.APPLICATION_JSON_VALUE)
public void getVNFTypeDictionaryEntityData(HttpServletResponse response) {
DictionaryUtils utils = getDictionaryUtilsInstance();
- utils.getData(response, vnfTypeDatas, VNFType.class);
+ utils.getData(response, vnfTypeDatas, VnfType.class);
}
@RequestMapping(
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
JsonNode root = mapper.readTree(request.getReader());
- VSCLAction vSCLAction;
+ VsclAction vSCLAction;
String userId = null;
if (fromAPI) {
- vSCLAction = mapper.readValue(root.get(dictionaryFields).toString(), VSCLAction.class);
+ vSCLAction = mapper.readValue(root.get(dictionaryFields).toString(), VsclAction.class);
userId = "API";
} else {
- vSCLAction = mapper.readValue(root.get("vsclActionDictionaryData").toString(), VSCLAction.class);
+ vSCLAction = mapper.readValue(root.get("vsclActionDictionaryData").toString(), VsclAction.class);
userId = root.get(userid).textValue();
}
UserInfo userInfo = utils.getUserInfo(userId);
List<Object> duplicateData =
- commonClassDao.checkDuplicateEntry(vSCLAction.getVsclaction(), vsclaction, VSCLAction.class);
+ commonClassDao.checkDuplicateEntry(vSCLAction.getAction(), vsclaction, VsclAction.class);
boolean duplicateflag = false;
if (!duplicateData.isEmpty()) {
- VSCLAction data = (VSCLAction) duplicateData.get(0);
+ VsclAction data = (VsclAction) duplicateData.get(0);
if (request.getParameter(operation) != null && "update".equals(request.getParameter(operation))) {
vSCLAction.setId(data.getId());
} else if ((request.getParameter(operation) != null
vSCLAction.setModifiedDate(new Date());
commonClassDao.update(vSCLAction);
}
- responseString = mapper.writeValueAsString(commonClassDao.getData(VSCLAction.class));
+ responseString = mapper.writeValueAsString(commonClassDao.getData(VsclAction.class));
} else {
responseString = duplicateResponseString;
}
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
JsonNode root = mapper.readTree(request.getReader());
- VNFType vNFType;
+ VnfType vNFType;
String userId = null;
if (fromAPI) {
- vNFType = mapper.readValue(root.get(dictionaryFields).toString(), VNFType.class);
+ vNFType = mapper.readValue(root.get(dictionaryFields).toString(), VnfType.class);
userId = "API";
} else {
- vNFType = mapper.readValue(root.get("vnfTypeDictionaryData").toString(), VNFType.class);
+ vNFType = mapper.readValue(root.get("vnfTypeDictionaryData").toString(), VnfType.class);
userId = root.get(userid).textValue();
}
UserInfo userInfo = utils.getUserInfo(userId);
List<Object> duplicateData =
- commonClassDao.checkDuplicateEntry(vNFType.getVnftype(), vnftype, VNFType.class);
+ commonClassDao.checkDuplicateEntry(vNFType.getType(), vnftype, VnfType.class);
boolean duplicateflag = false;
if (!duplicateData.isEmpty()) {
- VNFType data = (VNFType) duplicateData.get(0);
+ VnfType data = (VnfType) duplicateData.get(0);
if (request.getParameter(operation) != null && "update".equals(request.getParameter(operation))) {
vNFType.setId(data.getId());
} else if ((request.getParameter(operation) != null
vNFType.setModifiedDate(new Date());
commonClassDao.update(vNFType);
}
- responseString = mapper.writeValueAsString(commonClassDao.getData(VNFType.class));
+ responseString = mapper.writeValueAsString(commonClassDao.getData(VnfType.class));
} else {
responseString = duplicateResponseString;
}
@RequestMapping(value = {"/cl_dictionary/remove_vnfType"}, method = {RequestMethod.POST})
public void removeVnfType(HttpServletRequest request, HttpServletResponse response) throws IOException {
DictionaryUtils utils = getDictionaryUtilsInstance();
- utils.removeData(request, response, vnfTypeDatas, VNFType.class);
+ utils.removeData(request, response, vnfTypeDatas, VnfType.class);
}
@RequestMapping(value = {"/cl_dictionary/save_pepOptions"}, method = {RequestMethod.POST})
@RequestMapping(value = {"/cl_dictionary/remove_pepOptions"}, method = {RequestMethod.POST})
public void removePEPOptions(HttpServletRequest request, HttpServletResponse response) throws IOException {
DictionaryUtils utils = getDictionaryUtilsInstance();
- utils.removeData(request, response, pepOptionDatas, VNFType.class);
+ utils.removeData(request, response, pepOptionDatas, VnfType.class);
}
@RequestMapping(value = {"/cl_dictionary/save_service"}, method = {RequestMethod.POST})
@RequestMapping(value = {"/cl_dictionary/remove_Service"}, method = {RequestMethod.POST})
public void removeServiceType(HttpServletRequest request, HttpServletResponse response) throws IOException {
DictionaryUtils utils = getDictionaryUtilsInstance();
- utils.removeData(request, response, closedLoopDatas, VNFType.class);
+ utils.removeData(request, response, closedLoopDatas, VnfType.class);
}
@RequestMapping(value = {"/cl_dictionary/save_siteName"}, method = {RequestMethod.POST})
@RequestMapping(value = {"/cl_dictionary/remove_site"}, method = {RequestMethod.POST})
public void removeSiteType(HttpServletRequest request, HttpServletResponse response) throws IOException {
DictionaryUtils utils = getDictionaryUtilsInstance();
- utils.removeData(request, response, closedLoopSiteDatas, VNFType.class);
+ utils.removeData(request, response, closedLoopSiteDatas, VnfType.class);
}
@RequestMapping(value = {"/cl_dictionary/save_varbind"}, method = {RequestMethod.POST})
@RequestMapping(value = {"/cl_dictionary/remove_varbindDict"}, method = {RequestMethod.POST})
public void removeVarbind(HttpServletRequest request, HttpServletResponse response) throws IOException {
DictionaryUtils utils = getDictionaryUtilsInstance();
- utils.removeData(request, response, varbindDatas, VNFType.class);
+ utils.removeData(request, response, varbindDatas, VnfType.class);
}
}
import org.onap.policy.rest.jpa.ServiceList;
import org.onap.policy.rest.jpa.TermList;
import org.onap.policy.rest.jpa.UserInfo;
-import org.onap.policy.rest.jpa.VNFType;
-import org.onap.policy.rest.jpa.VSCLAction;
+import org.onap.policy.rest.jpa.VnfType;
+import org.onap.policy.rest.jpa.VsclAction;
import org.onap.policy.rest.jpa.VarbindDictionary;
import org.onap.policy.rest.jpa.Zone;
import org.springframework.beans.factory.annotation.Autowired;
if (dictionaryName.startsWith("VNFType")) {
for (int i = 1; i < dictSheet.size(); i++) {
- VNFType attribute = new VNFType();
+ VnfType attribute = new VnfType();
UserInfo userinfo = new UserInfo();
userinfo.setUserLoginId(userId);
attribute.setUserCreatedBy(userinfo);
for (int j = 0; j < rows.length; j++) {
if ("vnf_type".equalsIgnoreCase(dictSheet.get(0)[j])
|| "VNF Type".equalsIgnoreCase(dictSheet.get(0)[j])) {
- attribute.setVnftype(rows[j]);
+ attribute.setType(rows[j]);
}
if (DESCRIPTION.equalsIgnoreCase(dictSheet.get(0)[j])) {
attribute.setDescription(rows[j]);
}
if (dictionaryName.startsWith("VSCLAction")) {
for (int i = 1; i < dictSheet.size(); i++) {
- VSCLAction attribute = new VSCLAction();
+ VsclAction attribute = new VsclAction();
UserInfo userinfo = new UserInfo();
userinfo.setUserLoginId(userId);
attribute.setUserCreatedBy(userinfo);
for (int j = 0; j < rows.length; j++) {
if ("vscl_action".equalsIgnoreCase(dictSheet.get(0)[j])
|| "VSCL Action".equalsIgnoreCase(dictSheet.get(0)[j])) {
- attribute.setVsclaction(rows[j]);
+ attribute.setAction(rows[j]);
}
if (DESCRIPTION.equalsIgnoreCase(dictSheet.get(0)[j])) {
attribute.setDescription(rows[j]);
}
if ("varbind_oid".equalsIgnoreCase(dictSheet.get(0)[j])
|| "Varbind OID".equalsIgnoreCase(dictSheet.get(0)[j])) {
- attribute.setVarbindOID(rows[j]);
+ attribute.setVarbindOid(rows[j]);
}
}
commonClassDao.save(attribute);
}
if ("serviceTrasProtocol".equalsIgnoreCase(dictSheet.get(0)[j])
|| "Transport Protocol".equalsIgnoreCase(dictSheet.get(0)[j])) {
- attribute.setServiceTransProtocol(rows[j]);
+ attribute.setServiceTransportProtocol(rows[j]);
}
if ("serviceAppProtocol".equalsIgnoreCase(dictSheet.get(0)[j])
|| "APP Protocol".equalsIgnoreCase(dictSheet.get(0)[j])) {
}
if ("fromZone".equalsIgnoreCase(dictSheet.get(0)[j])
|| "From Zone".equalsIgnoreCase(dictSheet.get(0)[j])) {
- attribute.setFromZones(rows[j]);
+ attribute.setFromZone(rows[j]);
}
if ("toZone".equalsIgnoreCase(dictSheet.get(0)[j])
|| "To Zone".equalsIgnoreCase(dictSheet.get(0)[j])) {
- attribute.setToZones(rows[j]);
+ attribute.setToZone(rows[j]);
}
if ("srcIPList".equalsIgnoreCase(dictSheet.get(0)[j])
|| "Source-IP-List".equalsIgnoreCase(dictSheet.get(0)[j])) {
- attribute.setSrcIPList(rows[j]);
+ attribute.setSrcIpList(rows[j]);
}
if ("destIPList".equalsIgnoreCase(dictSheet.get(0)[j])
|| "Destination-IP-List".equalsIgnoreCase(dictSheet.get(0)[j])) {
- attribute.setDestIPList(rows[j]);
+ attribute.setDestIpList(rows[j]);
}
if ("srcPortList".equalsIgnoreCase(dictSheet.get(0)[j])
|| "Source-Port-List".equalsIgnoreCase(dictSheet.get(0)[j])) {
mapper.readValue(root.get("serviceListDictionaryData").toString(), GridData.class);
}
serviceList
- .setServiceTransProtocol(utils.appendKey(serviceListGridData.getTransportProtocols(), option, ","));
+ .setServiceTransportProtocol(utils.appendKey(serviceListGridData.getTransportProtocols(), option, ","));
serviceList.setServiceAppProtocol(utils.appendKey(serviceListGridData.getAppProtocols(), option, ","));
serviceList.setServiceType("SERVICE");
List<Object> duplicateData =
userId = root.get(userid).textValue();
}
- termList.setFromZones(utils.appendKey(termListDatas.getFromZoneDatas(), option, ","));
- termList.setToZones(utils.appendKey(termListDatas.getToZoneDatas(), option, ","));
- termList.setSrcIPList(utils.appendKey(termListDatas.getSourceListDatas(), option, ","));
- termList.setDestIPList(utils.appendKey(termListDatas.getDestinationListDatas(), option, ","));
+ termList.setFromZone(utils.appendKey(termListDatas.getFromZoneDatas(), option, ","));
+ termList.setToZone(utils.appendKey(termListDatas.getToZoneDatas(), option, ","));
+ termList.setSrcIpList(utils.appendKey(termListDatas.getSourceListDatas(), option, ","));
+ termList.setDestIpList(utils.appendKey(termListDatas.getDestinationListDatas(), option, ","));
termList.setSrcPortList(utils.appendKey(termListDatas.getSourceServiceDatas(), option, ","));
termList.setDestPortList(utils.appendKey(termListDatas.getDestinationServiceDatas(), option, ","));
termList.setAction(utils.appendKey(termListDatas.getActionListDatas(), option, ","));
}
UserInfo userInfo = utils.getUserInfo(userId);
List<Object> duplicateData =
- commonClassDao.checkDuplicateEntry(riskTypeData.getRiskName(), "name", RiskType.class);
+ commonClassDao.checkDuplicateEntry(riskTypeData.getName(), "name", RiskType.class);
boolean duplicateflag = false;
if (!duplicateData.isEmpty()) {
RiskType data = (RiskType) duplicateData.get(0);
import org.onap.policy.rest.jpa.RiskType;
import org.onap.policy.rest.jpa.SafePolicyWarning;
import org.onap.policy.rest.jpa.TermList;
-import org.onap.policy.rest.jpa.VNFType;
-import org.onap.policy.rest.jpa.VSCLAction;
+import org.onap.policy.rest.jpa.VnfType;
+import org.onap.policy.rest.jpa.VsclAction;
import org.onap.policy.rest.jpa.VarbindDictionary;
import org.onap.policy.utils.PolicyUtils;
import org.onap.policy.xacml.api.XACMLErrorConstants;
policyList = searchElkDatabase(closedloop, jsonBodyData, "*" + value + "*");
break;
case clVnf:
- VNFType vNFType = mapper.readValue(root.get("data").toString(), VNFType.class);
- value = vNFType.getVnftype();
+ VnfType vNFType = mapper.readValue(root.get("data").toString(), VnfType.class);
+ value = vNFType.getType();
policyList = searchElkDatabase(closedloop, jsonBodyData, "*" + value + "*");
break;
case clVSCL:
- VSCLAction vsclAction = mapper.readValue(root.get("data").toString(), VSCLAction.class);
- value = vsclAction.getVsclaction();
+ VsclAction vsclAction = mapper.readValue(root.get("data").toString(), VsclAction.class);
+ value = vsclAction.getAction();
policyList = searchElkDatabase(closedloop, jsonBodyData, "*" + value + "*");
break;
case decision:
break;
case safeRisk:
RiskType riskType = mapper.readValue(root.get("data").toString(), RiskType.class);
- value = riskType.getRiskName();
+ value = riskType.getName();
policyList = searchElkDatabase(config, "riskType", value);
break;
case safePolicyWarning:
<class>org.onap.policy.rest.jpa.RuleAlgorithms</class>
<class>org.onap.policy.rest.jpa.SecurityZone</class>
<class>org.onap.policy.rest.jpa.ServiceList</class>
- <class>org.onap.policy.rest.jpa.SystemLogDB</class>
+ <class>org.onap.policy.rest.jpa.SystemLogDb</class>
<class>org.onap.policy.rest.jpa.TermList</class>
<class>org.onap.policy.rest.jpa.VarbindDictionary</class>
- <class>org.onap.policy.rest.jpa.VMType</class>
- <class>org.onap.policy.rest.jpa.VNFType</class>
- <class>org.onap.policy.rest.jpa.VSCLAction</class>
+ <class>org.onap.policy.rest.jpa.VmType</class>
+ <class>org.onap.policy.rest.jpa.VnfType</class>
+ <class>org.onap.policy.rest.jpa.VsclAction</class>
<class>org.onap.policy.rest.jpa.Zone</class>
<!-- unique to PolicyEngineUtils -->
<class>org.onap.policy.jpa.BackUpMonitorEntity</class>
// Verify
Mockito.verify(httpServletResponse).setStatus(HttpServletResponse.SC_OK);
//
- // Check VNFType
+ // Check VnfType
//
httpServletRequest = Mockito.mock(HttpServletRequest.class);
httpServletResponse = Mockito.mock(MockHttpServletResponse.class);
import org.onap.policy.rest.jpa.ClosedLoopSite;
import org.onap.policy.rest.jpa.PepOptions;
import org.onap.policy.rest.jpa.UserInfo;
-import org.onap.policy.rest.jpa.VNFType;
-import org.onap.policy.rest.jpa.VSCLAction;
+import org.onap.policy.rest.jpa.VnfType;
+import org.onap.policy.rest.jpa.VsclAction;
import org.onap.policy.rest.jpa.VarbindDictionary;
import org.springframework.mock.web.MockHttpServletResponse;
userInfo.setUserLoginId("Test");
userInfo.setUserName("Test");
- doNothing().when(commonClassDao).delete(new VSCLAction());
- doNothing().when(commonClassDao).save(new VSCLAction());
+ doNothing().when(commonClassDao).delete(new VsclAction());
+ doNothing().when(commonClassDao).save(new VsclAction());
controller = new ClosedLoopDictionaryController();
controller.setCommonClassDao(commonClassDao);
@Test
public void testGetVSCLActionDictionaryByNameEntityData() {
- when(commonClassDao.getDataByColumn(VSCLAction.class, "vsclaction")).thenReturn(data);
+ when(commonClassDao.getDataByColumn(VsclAction.class, "vsclaction")).thenReturn(data);
controller.getVSCLActionDictionaryByNameEntityData(response);
try {
assertTrue(response.getContentAsString() != null
@Test
public void testGetVSCLActionDictionaryEntityData() {
- when(commonClassDao.getData(VSCLAction.class)).thenReturn(new ArrayList<>());
+ when(commonClassDao.getData(VsclAction.class)).thenReturn(new ArrayList<>());
controller.getVSCLActionDictionaryEntityData(response);
try {
assertTrue(response.getContentAsString() != null
@Test
public void testGetVNFTypeDictionaryByNameEntityData() {
- when(commonClassDao.getDataByColumn(VNFType.class, "vnftype")).thenReturn(data);
+ when(commonClassDao.getDataByColumn(VnfType.class, "vnftype")).thenReturn(data);
controller.getVNFTypeDictionaryByNameEntityData(response);
try {
assertTrue(response.getContentAsString() != null
@Test
public void testGetVNFTypeDictionaryEntityData() {
- when(commonClassDao.getData(VNFType.class)).thenReturn(new ArrayList<>());
+ when(commonClassDao.getData(VnfType.class)).thenReturn(new ArrayList<>());
controller.getVNFTypeDictionaryEntityData(response);
try {
assertTrue(response.getContentAsString() != null
<class>org.onap.policy.rest.jpa.RuleAlgorithms</class>
<class>org.onap.policy.rest.jpa.SecurityZone</class>
<class>org.onap.policy.rest.jpa.ServiceList</class>
- <class>org.onap.policy.rest.jpa.SystemLogDB</class>
+ <class>org.onap.policy.rest.jpa.SystemLogDb</class>
<class>org.onap.policy.rest.jpa.TermList</class>
<class>org.onap.policy.rest.jpa.VarbindDictionary</class>
- <class>org.onap.policy.rest.jpa.VMType</class>
- <class>org.onap.policy.rest.jpa.VNFType</class>
- <class>org.onap.policy.rest.jpa.VSCLAction</class>
+ <class>org.onap.policy.rest.jpa.VmType</class>
+ <class>org.onap.policy.rest.jpa.VnfType</class>
+ <class>org.onap.policy.rest.jpa.VsclAction</class>
<class>org.onap.policy.rest.jpa.Zone</class>
<!-- unique to PolicyEngineUtils -->
<class>org.onap.policy.jpa.BackUpMonitorEntity</class>
* ONAP-REST
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
package org.onap.policy.rest.jpa;
+import java.io.Serializable;
+
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
-
import javax.persistence.NamedQuery;
import javax.persistence.OrderBy;
import javax.persistence.Table;
-import java.io.Serializable;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
/**
* The persistent class for the RainyDayTreatment database table.
- *
*/
@Entity
-@Table(name="RainyDayTreatments")
-@NamedQuery(name="RainyDayTreatments.findAll", query="SELECT e FROM RainyDayTreatments e")
+@Table(name = "RainyDayTreatments")
+@NamedQuery(name = "RainyDayTreatments.findAll", query = "SELECT e FROM RainyDayTreatments e")
+@Getter
+@Setter
+@NoArgsConstructor
public class RainyDayTreatments implements Serializable {
- /**
- *
- */
private static final long serialVersionUID = -2491410352490381323L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
- @Column(name="id")
+ @Column(name = "id")
private int id;
- @Column(name="bbid", nullable=false, length=255)
+ @Column(name = "bbid", nullable = false, length = 255)
@OrderBy("asc")
private String bbid;
- @Column(name="workstep", nullable=true, length=255)
+ @Column(name = "workstep", nullable = true, length = 255)
private String workstep;
- @Column(name="treatments", nullable=true, length=1028)
+ @Column(name = "treatments", nullable = true, length = 1028)
private String treatments;
-
- public RainyDayTreatments() {
- // Empty constructor
- }
-
- public int getId() {
- return id;
- }
-
- public void setId(int id) {
- this.id = id;
- }
-
- /**
- * @return the bbid
- */
- public String getBbid() {
- return bbid;
- }
-
- /**
- * @param bbid the bbid to set
- */
- public void setBbid(String bbid) {
- this.bbid = bbid;
- }
-
- /**
- * @return the workstep
- */
- public String getWorkstep() {
- return workstep;
- }
-
- /**
- * @param workstep the workstep to set
- */
- public void setWorkstep(String workstep) {
- this.workstep = workstep;
- }
-
- /**
- * @return the treatments
- */
- public String getTreatments() {
- return treatments;
- }
-
- /**
- * @param treatments the treatments to set
- */
- public void setTreatments(String treatments) {
- this.treatments = treatments;
- }
-
-
}
\ No newline at end of file
* ONAP-REST
* ================================================================================
* Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
package org.onap.policy.rest.jpa;
-/*
- */
+
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.OrderBy;
import javax.persistence.Table;
+import lombok.Getter;
+import lombok.Setter;
@Entity
-@Table(name="RemoteCatalogValues")
-@NamedQuery(name="RemoteCatalogValues.findAll", query="SELECT e FROM RemoteCatalogValues e ")
+@Table(name = "RemoteCatalogValues")
+@NamedQuery(name = "RemoteCatalogValues.findAll", query = "SELECT e FROM RemoteCatalogValues e ")
+@Getter
+@Setter
public class RemoteCatalogValues implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
- @Column(name="id")
+ @Column(name = "id")
private int id;
- @Column(name="name", nullable=false)
+ @Column(name = "name", nullable = false)
@OrderBy("asc")
private String name;
- @Column(name="value")
+ @Column(name = "value")
private String value;
-
- public String getValue() {
- return value;
- }
-
- public void setValue(String value) {
- this.value = value;
- }
-
- public int getId() {
- return this.id;
- }
-
- public void setId(int id) {
- this.id = id;
- }
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- this.name = name;
-
- }
-
}
* ONAP-REST
* ================================================================================
* Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
package org.onap.policy.rest.jpa;
-/*
- */
+
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
+import lombok.Getter;
+import lombok.Setter;
+/**
+ * The Class RiskType.
+ */
@Entity
-@Table(name="RiskType")
-@NamedQuery(name="RiskType.findAll", query="SELECT e FROM RiskType e ")
+@Table(name = "RiskType")
+@NamedQuery(name = "RiskType.findAll", query = "SELECT e FROM RiskType e ")
+@Getter
+@Setter
public class RiskType implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
- @Column(name="id")
+ @Column(name = "id")
private int id;
- @Column(name="name", nullable=false, unique=true)
+ @Column(name = "name", nullable = false, unique = true)
@OrderBy("asc")
private String name;
@Temporal(TemporalType.TIMESTAMP)
- @Column(name="created_date", updatable=false)
+ @Column(name = "created_date", updatable = false)
private Date createdDate;
- @Column(name="description", nullable=true, length=2048)
+ @Column(name = "description", nullable = true, length = 2048)
private String description;
@Temporal(TemporalType.TIMESTAMP)
- @Column(name="modified_date", nullable=false)
+ @Column(name = "modified_date", nullable = false)
private Date modifiedDate;
@ManyToOne(optional = false)
- @JoinColumn(name="created_by")
+ @JoinColumn(name = "created_by")
private UserInfo userCreatedBy;
@ManyToOne(optional = false)
- @JoinColumn(name="modified_by")
+ @JoinColumn(name = "modified_by")
private UserInfo userModifiedBy;
- public UserInfo getUserCreatedBy() {
- return userCreatedBy;
- }
-
- public void setUserCreatedBy(UserInfo userCreatedBy) {
- this.userCreatedBy = userCreatedBy;
- }
-
- public UserInfo getUserModifiedBy() {
- return userModifiedBy;
- }
-
- public void setUserModifiedBy(UserInfo userModifiedBy) {
- this.userModifiedBy = userModifiedBy;
- }
-
+ /**
+ * Pre persist.
+ */
@PrePersist
- public void prePersist() {
+ public void prePersist() {
Date date = new Date();
this.createdDate = date;
this.modifiedDate = date;
}
+ /**
+ * Pre update.
+ */
@PreUpdate
public void preUpdate() {
this.modifiedDate = new Date();
}
- public String getRiskName() {
- return this.name;
- }
-
- public void setRiskName(String riskName) {
- this.name = riskName;
-
- }
- public int getId() {
- return this.id;
- }
-
- public void setId(int id) {
- this.id = id;
- }
-
- public Date getCreatedDate() {
- return this.createdDate;
- }
-
- public void setCreatedDate(Date createdDate) {
- this.createdDate = createdDate;
- }
-
- public String getDescription() {
- return this.description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public Date getModifiedDate() {
- return this.modifiedDate;
- }
-
- public void setModifiedDate(Date modifiedDate) {
- this.modifiedDate = modifiedDate;
- }
-
}
* ONAP-REST
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* limitations under the License.
* ============LICENSE_END=========================================================
*/
+
package org.onap.policy.rest.jpa;
+import com.att.research.xacml.api.Identifier;
+
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Table;
import javax.persistence.Transient;
-import com.att.research.xacml.api.Identifier;
+import lombok.Getter;
+import lombok.Setter;
+/**
+ * The Class RuleAlgorithms.
+ */
@Entity
-@Table(name="RuleAlgorithms")
-@NamedQuery(name="RuleAlgorithms.findAll", query="SELECT d FROM RuleAlgorithms d")
+@Table(name = "RuleAlgorithms")
+@NamedQuery(name = "RuleAlgorithms.findAll", query = "SELECT d FROM RuleAlgorithms d")
+@Getter
+@Setter
public class RuleAlgorithms implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
- @Column(name="id")
+ @Column(name = "id")
private int id;
- @Column(name="is_standard", nullable=false)
+ @Column(name = "is_standard", nullable = false)
private char isStandard;
- @Column(name="xacml_id", nullable=false, unique=true, length=255)
+ @Column(name = "xacml_id", nullable = false, unique = true, length = 255)
private String xacmlId;
- @Column(name="short_name", nullable=false, length=64)
+ @Column(name = "short_name", nullable = false, length = 64)
private String shortName;
+ /**
+ * Instantiates a new rule algorithms.
+ *
+ * @param id the id
+ * @param standard the standard
+ */
public RuleAlgorithms(Identifier id, char standard) {
if (id != null) {
this.xacmlId = id.stringValue();
}
this.isStandard = standard;
}
+
+ /**
+ * Instantiates a new rule algorithms.
+ *
+ * @param id the id
+ */
public RuleAlgorithms(Identifier id) {
this(id, RuleAlgorithms.STANDARD);
}
+ /**
+ * Instantiates a new rule algorithms.
+ */
public RuleAlgorithms() {
this(null, RuleAlgorithms.STANDARD);
}
- public int getId() {
- return this.id;
- }
-
- public void setId(int id) {
- this.id = id;
- }
-
- public char getIsStandard() {
- return this.isStandard;
- }
-
- public void setIsStandard(char isStandard) {
- this.isStandard = isStandard;
- }
-
@Transient
public boolean isStandard() {
return this.isStandard == RuleAlgorithms.STANDARD;
public boolean isCustom() {
return this.isStandard == RuleAlgorithms.CUSTOM;
}
-
- public String getXacmlId() {
- return this.xacmlId;
- }
-
- public void setXacmlId(String xacmlId) {
- this.xacmlId = xacmlId;
- }
-
- public String getShortName() {
- return shortName;
- }
-
- public void setShortName(String shortName) {
- this.shortName = shortName;
- }
-
}
* ONAP-REST
* ================================================================================
* Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
package org.onap.policy.rest.jpa;
-/*
- */
+
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.OrderBy;
import javax.persistence.Table;
+import lombok.Getter;
+import lombok.Setter;
@Entity
-@Table(name="SafePolicyWarning")
-@NamedQuery(name="SafePolicyWarning.findAll", query="SELECT e FROM SafePolicyWarning e ")
+@Table(name = "SafePolicyWarning")
+@NamedQuery(name = "SafePolicyWarning.findAll", query = "SELECT e FROM SafePolicyWarning e ")
+@Getter
+@Setter
public class SafePolicyWarning implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
- @Column(name="id")
+ @Column(name = "id")
private int id;
- @Column(name="name", nullable=false)
+ @Column(name = "name", nullable = false)
@OrderBy("asc")
private String name;
- @Column(name="message")
- private String message ;
-
- @Column(name="riskType")
- private String riskType ;
-
- public String getRiskType() {
- return riskType;
- }
- public void setRiskType(String riskType) {
- this.riskType = riskType;
- }
-
- public int getId() {
- return this.id;
- }
-
- public void setId(int id) {
- this.id = id;
- }
- public String getName() {
- return this.name;
- }
-
- public String getMessage() {
- return message;
- }
- public void setMessage(String message) {
- this.message = message;
- }
- public void setName(String name) {
- this.name = name;
-
- }
+ @Column(name = "message")
+ private String message;
+ @Column(name = "riskType")
+ private String riskType;
}
* ONAP-REST
* ================================================================================
* Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
package org.onap.policy.rest.jpa;
-/*
- */
+
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.OrderBy;
import javax.persistence.Table;
+import lombok.Getter;
+import lombok.Setter;
+
@Entity
-@Table(name="securityzone")
-@NamedQuery(name="SecurityZone.findAll", query="SELECT e FROM SecurityZone e ")
+@Table(name = "securityzone")
+@NamedQuery(name = "SecurityZone.findAll", query = "SELECT e FROM SecurityZone e ")
+@Getter
+@Setter
public class SecurityZone implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
- @Column(name="id")
+ @Column(name = "id")
private int id;
- @Column(name="name", nullable=false)
+ @Column(name = "name", nullable = false)
@OrderBy("asc")
private String zoneName;
- @Column(name="value")
+ @Column(name = "value")
private String zoneValue;
-
- public int getId() {
- return this.id;
- }
-
- public void setId(int id) {
- this.id = id;
- }
- public String getZoneName() {
- return this.zoneName;
- }
-
- public void setZoneName(String zoneName) {
- this.zoneName = zoneName;
-
- }
- public String getZoneValue() {
- return this.zoneValue;
- }
-
- public void setZoneValue(String zoneValue) {
- this.zoneValue = zoneValue;
- }
-
}
* ONAP-REST
* ================================================================================
* Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
package org.onap.policy.rest.jpa;
-/*
- */
+
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.OrderBy;
import javax.persistence.Table;
+import lombok.Getter;
+import lombok.Setter;
+
@Entity
-@Table(name="servicegroup")
-@NamedQuery(name="ServiceList.findAll", query="SELECT e FROM ServiceList e ")
+@Table(name = "servicegroup")
+@NamedQuery(name = "ServiceList.findAll", query = "SELECT e FROM ServiceList e ")
+@Getter
+@Setter
public class ServiceList implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
- @Column(name="id")
+ @Column(name = "id")
private int id;
- @Column(name="name", nullable=false)
+ @Column(name = "name", nullable = false)
@OrderBy("asc")
private String serviceName;
- @Column(name="description")
- private String serviceDesc;
+ @Column(name = "description")
+ private String serviceDescription;
- @Column(name="type")
+ @Column(name = "type")
private String serviceType;
- @Column(name="transportprotocol")
- private String serviceTrasProtocol;
+ @Column(name = "transportprotocol")
+ private String serviceTransportProtocol;
- @Column(name="appprotocol ")
+ @Column(name = "appprotocol ")
private String serviceAppProtocol;
- @Column(name="ports")
+ @Column(name = "ports")
private String servicePorts;
-
- public int getId() {
- return this.id;
- }
-
- public void setId(int id) {
- this.id = id;
- }
- public String getServiceName() {
- return this.serviceName;
- }
-
- public void setServiceName(String serviceName) {
- this.serviceName = serviceName;
-
- }
-
- public String getServiceDescription() {
- return this.serviceDesc;
- }
-
- public void setServiceDescription(String serviceDesc) {
- this.serviceDesc = serviceDesc;
-
- }
-
- public String getServiceType() {
- return this.serviceType;
- }
-
- public void setServiceType(String serviceType) {
- this.serviceType = serviceType;
- }
-
- public String getServiceTransProtocol() {
- return this.serviceTrasProtocol;
- }
-
- public void setServiceTransProtocol(String serviceTrasProtocol) {
- this.serviceTrasProtocol = serviceTrasProtocol;
-
- }
-
- public String getServiceAppProtocol() {
- return this.serviceAppProtocol;
- }
-
- public void setServiceAppProtocol(String serviceAppProtocol) {
- this.serviceAppProtocol = serviceAppProtocol;
-
- }
- public String getServicePorts() {
- return this.servicePorts;
- }
-
- public void setServicePorts(String servicePorts) {
- this.servicePorts = servicePorts;
-
- }
}
* ONAP-REST
* ================================================================================
* Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* limitations under the License.
* ============LICENSE_END=========================================================
*/
+
package org.onap.policy.rest.jpa;
import java.io.Serializable;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
+import lombok.Getter;
+import lombok.Setter;
+
/**
- * The persistent class for the system log database table.
- *
-*/
+ * The persistent class for the system log database table.
+ */
@Entity
-@Table(name="SystemLogDB")
-@NamedQuery(name="SystemLogDB.findAll", query="SELECT o FROM SystemLogDB o")
-public class SystemLogDB implements Serializable {
+@Table(name = "SystemLogDb")
+@NamedQuery(name = "SystemLogDb.findAll", query = "SELECT o FROM SystemLogDb o")
+@Getter
+@Setter
+public class SystemLogDb implements Serializable {
private static final long serialVersionUID = 1L;
-
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
- @Column(name="id")
+ @Column(name = "id")
private int id;
- @Column(name="type", nullable=false)
+ @Column(name = "type", nullable = false)
private String type;
- @Column(name="system", nullable=false, length=255)
+ @Column(name = "system", nullable = false, length = 255)
private String system;
- @Column(name="description", nullable=true, length=2048)
+ @Column(name = "description", nullable = true, length = 2048)
private String description;
- @Column(name="remote", nullable=false, length=255)
+ @Column(name = "remote", nullable = false, length = 255)
private String remote;
- @Column(name="logtype", nullable=false, length=255)
+ @Column(name = "logtype", nullable = false, length = 255)
private String logtype;
@Temporal(TemporalType.TIMESTAMP)
- @Column(name="date", nullable=false, updatable=false)
+ @Column(name = "date", nullable = false, updatable = false)
private Date date;
- public SystemLogDB() {
+ /**
+ * Instantiates a new system log db.
+ */
+ public SystemLogDb() {
super();
}
- public SystemLogDB(int id, String system, String description, String remote,
- String type, String logtype) {
+ /**
+ * Instantiates a new system log db.
+ *
+ * @param id the id
+ * @param system the system
+ * @param description the description
+ * @param remote the remote
+ * @param type the type
+ * @param logtype the logtype
+ */
+ public SystemLogDb(int id, String system, String description, String remote, String type, String logtype) {
this.id = id;
this.system = system;
this.description = description;
this.type = type;
this.logtype = logtype;
}
-
- public int getId() {
- return this.id;
- }
-
- public void setId(int id) {
- this.id = id;
- }
-
- public Date getDate(){
- return this.date;
- }
-
- public void setDate(Date date){
- this.date = date;
- }
-
- public String getDescription() {
- return this.description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public String getType() {
- return this.type;
- }
-
- public void setType(String type) {
- this.type = type;
-
- }
-
- public String getSystem() {
- return this.system;
- }
-
- public void setSystem(String system) {
- this.system = system;
- }
-
- public String getRemote() {
- return this.remote;
- }
-
- public void setRemote(String remote) {
- this.remote = remote;
-
- }
- public String getLogtype() {
- return this.logtype;
- }
-
- public void setLogtype(String logtype) {
- this.logtype = logtype;
-
- }
}
* ONAP-REST
* ================================================================================
* Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import java.io.Serializable;
import java.util.Date;
+
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
+import lombok.Getter;
+import lombok.Setter;
+/**
+ * The Class TermList.
+ */
@Entity
-@Table(name="TERM")
-@NamedQuery(name="TermList.findAll", query="SELECT e FROM TermList e")
+@Table(name = "TERM")
+@NamedQuery(name = "TermList.findAll", query = "SELECT e FROM TermList e")
+@Getter
+@Setter
public class TermList implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
- @Column(name="id")
+ @Column(name = "id")
private int id;
- @Column(name="termName", nullable=false)
+ @Column(name = "termName", nullable = false)
@OrderBy("asc")
private String termName;
- @Column(name="description")
- private String termDescription;
+ @Column(name = "description")
+ private String description;
- @Column(name="fromzone")
+ @Column(name = "fromzone")
private String fromZone;
- @Column(name="tozone")
+ @Column(name = "tozone")
private String toZone;
- @Column(name="srcIPList")
- private String srcIPList;
+ @Column(name = "srcIPList")
+ private String srcIpList;
- @Column(name="destIPList")
- private String destIPList;
+ @Column(name = "destIPList")
+ private String destIpList;
- @Column(name="protocolList")
+ @Column(name = "protocolList")
private String protocolList;
- @Column(name="portList")
+ @Column(name = "portList")
private String portList;
- @Column(name="srcPortList")
+ @Column(name = "srcPortList")
private String srcPortList;
- @Column(name="destPortList")
+ @Column(name = "destPortList")
private String destPortList;
- @Column(name="action")
+ @Column(name = "action")
private String action;
@Temporal(TemporalType.TIMESTAMP)
- @Column(name="created_date", updatable=false)
+ @Column(name = "created_date", updatable = false)
private Date createdDate;
@Temporal(TemporalType.TIMESTAMP)
- @Column(name="modified_date", nullable=false)
+ @Column(name = "modified_date", nullable = false)
private Date modifiedDate;
@ManyToOne(optional = false)
- @JoinColumn(name="created_by")
+ @JoinColumn(name = "created_by")
private UserInfo userCreatedBy;
@ManyToOne(optional = false)
- @JoinColumn(name="modified_by")
+ @JoinColumn(name = "modified_by")
private UserInfo userModifiedBy;
+ /**
+ * Instantiates a new term list.
+ */
public TermList() {
this.modifiedDate = new Date();
}
- public Date getCreatedDate() {
- return this.createdDate;
- }
- public void setCreatedDate(Date createdDate) {
- this.createdDate = createdDate;
- }
-
- public Date getModifiedDate() {
- return this.modifiedDate;
- }
- public void setModifiedDate(Date modifiedDate) {
- this.modifiedDate = modifiedDate;
- }
-
- public UserInfo getUserCreatedBy() {
- return userCreatedBy;
- }
-
- public void setUserCreatedBy(UserInfo userCreatedBy) {
- this.userCreatedBy = userCreatedBy;
- }
-
- public UserInfo getUserModifiedBy() {
- return userModifiedBy;
- }
-
- public void setUserModifiedBy(UserInfo userModifiedBy) {
- this.userModifiedBy = userModifiedBy;
- }
-
+ /**
+ * Pre persist.
+ */
@PrePersist
- public void prePersist() {
+ public void prePersist() {
Date date = new Date();
this.createdDate = date;
this.modifiedDate = date;
}
+ /**
+ * Pre update.
+ */
@PreUpdate
public void preUpdate() {
this.modifiedDate = new Date();
}
-
- public int getId() {
- return this.id;
- }
-
- public void setId(int id) {
- this.id = id;
- }
-
- public String getTermName() {
- return this.termName;
- }
-
- public void setTermName(String termName) {
- this.termName = termName;
- }
-
- public String getTermDescription() {
- return this.termDescription;
- }
-
- public void setDescription(String termDescription) {
- this.termDescription = termDescription;
- }
-
- public String getFromZone() {
- return this.fromZone;
- }
-
- public void setFromZones(String fromZone) {
- this.fromZone = fromZone;
- }
-
- public String getToZone() {
- return this.toZone;
- }
-
- public void setToZones(String toZone) {
- this.toZone = toZone;
- }
-
- public String getSrcIPList() {
- return this.srcIPList;
- }
-
- public void setSrcIPList(String srcIPList) {
- this.srcIPList = srcIPList;
- }
-
- public String getDestIPList() {
- return this.destIPList;
- }
-
- public void setDestIPList(String destIPList) {
- this.destIPList = destIPList;
- }
-
- public String getProtocolList() {
- return this.protocolList;
- }
-
- public void setProtocolList(String protocolList) {
- this.protocolList = protocolList;
- }
-
- public String getPortList() {
- return this.portList;
- }
-
- public void setPortList(String portList) {
- this.portList = portList;
- }
-
- public String getSrcPortList() {
- return this.srcPortList;
- }
-
- public void setSrcPortList(String srcPortList) {
- this.srcPortList = srcPortList;
- }
-
- public String getDestPortList() {
- return this.destPortList;
- }
-
- public void setDestPortList(String destPortList) {
- this.destPortList = destPortList;
- }
-
-
- public String getAction() {
- return this.action;
- }
-
- public void setAction(String action) {
- this.action = action;
- }
-
}
* ONAP-REST
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
package org.onap.policy.rest.jpa;
+import com.att.research.xacml.api.Identifier;
+import com.att.research.xacml.std.IdentifierImpl;
+import com.fasterxml.jackson.annotation.JsonBackReference;
+
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Table;
import javax.persistence.Transient;
-import com.att.research.xacml.api.Identifier;
-import com.att.research.xacml.std.IdentifierImpl;
-import com.fasterxml.jackson.annotation.JsonBackReference;
+import lombok.Getter;
+import lombok.Setter;
@Entity
@Table(name = "UserInfo")
-@NamedQuery(name="UserInfo.findAll", query="SELECT u FROM UserInfo u ")
+@NamedQuery(name = "UserInfo.findAll", query = "SELECT u FROM UserInfo u ")
+@Getter
+@Setter
public class UserInfo implements Serializable {
private static final long serialVersionUID = 1L;
@Id
- @Column(name="loginid", nullable=false, length=45)
+ @Column(name = "loginid", nullable = false, length = 45)
private String userLoginId;
@Column(name = "name", nullable = false, unique = true)
private String userName;
- public UserInfo(){
+ public UserInfo() {
this.userLoginId = userName;
}
- public String getUserLoginId() {
- return userLoginId;
- }
-
- public void setUserLoginId(String loginid) {
- this.userLoginId = loginid;
- }
-
- public String getUserName() {
- return userName;
- }
-
- public void setUserName(String userName) {
- this.userName = userName;
- }
-
@Transient
@JsonBackReference
public Identifier getIdentiferByUserId() {
* ONAP-REST
* ================================================================================
* Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import java.io.Serializable;
import java.util.Date;
+
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * The Class VarbindDictionary.
+ */
@Entity
-@Table(name="VarbindDictionary")
+@Table(name = "VarbindDictionary")
@NamedQuery(name = "VarbindDictionary.findAll", query = "Select v FROM VarbindDictionary v")
-public class VarbindDictionary implements Serializable{
+@Getter
+@Setter
+public class VarbindDictionary implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Column(name = "Id")
private int id;
- @Column(name ="varbind_Name", nullable = false, unique = true)
+ @Column(name = "varbind_Name", nullable = false, unique = true)
@OrderBy("asc")
private String varbindName;
private String varbindDescription;
@Column(name = "varbind_oid", nullable = false)
- private String varbindOID;
+ private String varbindOid;
@Temporal(TemporalType.TIMESTAMP)
- @Column(name="created_date", updatable=false)
+ @Column(name = "created_date", updatable = false)
private Date createdDate;
@Temporal(TemporalType.TIMESTAMP)
- @Column(name="modified_date", nullable=false)
+ @Column(name = "modified_date", nullable = false)
private Date modifiedDate;
@ManyToOne(optional = false)
- @JoinColumn(name="created_by")
+ @JoinColumn(name = "created_by")
private UserInfo userCreatedBy;
@ManyToOne(optional = false)
- @JoinColumn(name="modified_by")
+ @JoinColumn(name = "modified_by")
private UserInfo userModifiedBy;
+ /**
+ * Instantiates a new varbind dictionary.
+ */
public VarbindDictionary() {
this.setModifiedDate(new Date());
}
-
- public UserInfo getUserCreatedBy() {
- return userCreatedBy;
- }
-
- public void setUserCreatedBy(UserInfo userCreatedBy) {
- this.userCreatedBy = userCreatedBy;
- }
-
- public UserInfo getUserModifiedBy() {
- return userModifiedBy;
- }
-
- public void setUserModifiedBy(UserInfo userModifiedBy) {
- this.userModifiedBy = userModifiedBy;
- }
-
+ /**
+ * Pre persist.
+ */
@PrePersist
- public void prePersist() {
+ public void prePersist() {
Date date = new Date();
this.createdDate = date;
this.modifiedDate = date;
}
+ /**
+ * Pre update.
+ */
@PreUpdate
public void preUpdate() {
this.modifiedDate = new Date();
}
-
- public int getId() {
- return this.id;
- }
-
- public void setId(int id) {
- this.id = id;
- }
-
- public String getVarbindName() {
- return varbindName;
- }
-
- public void setVarbindName(String varbindName) {
- this.varbindName = varbindName;
- }
-
- public String getVarbindDescription() {
- return varbindDescription;
- }
-
- public void setVarbindDescription(String varbindDescription) {
- this.varbindDescription = varbindDescription;
- }
-
- public String getVarbindOID() {
- return varbindOID;
- }
-
- public void setVarbindOID(String varbindOID) {
- this.varbindOID = varbindOID;
- }
-
- public Date getCreatedDate() {
- return createdDate;
- }
-
- public void setCreatedDate(Date createdDate) {
- this.createdDate = createdDate;
- }
-
- public Date getModifiedDate() {
- return modifiedDate;
- }
-
- public void setModifiedDate(Date modifiedDate) {
- this.modifiedDate = modifiedDate;
- }
-
-
}
* ONAP-REST
* ================================================================================
* Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
package org.onap.policy.rest.jpa;
-/*
- */
+
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.OrderBy;
import javax.persistence.Table;
+import lombok.Getter;
+import lombok.Setter;
@Entity
-@Table(name="VMType")
-@NamedQuery(name="VMType.findAll", query="SELECT e FROM VMType e ")
-public class VMType implements Serializable {
+@Table(name = "VmType")
+@NamedQuery(name = "VmType.findAll", query = "SELECT e FROM VmType e ")
+@Getter
+@Setter
+public class VmType implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
- @Column(name="id")
+ @Column(name = "id")
private int id;
- @Column(name="name", nullable=false)
+ @Column(name = "name", nullable = false)
@OrderBy("asc")
private String name;
- @Column(name="description")
+ @Column(name = "description")
private String description;
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public int getId() {
- return this.id;
- }
-
- public void setId(int id) {
- this.id = id;
- }
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- this.name = name;
-
- }
-
}
* ONAP-REST
* ================================================================================
* Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import java.io.Serializable;
import java.util.Date;
+
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
+import lombok.Getter;
+import lombok.Setter;
-
+/**
+ * The Class VnfType.
+ */
@Entity
-@Table(name="VNFType")
-@NamedQuery(name="VNFType.findAll", query="SELECT v FROM VNFType v ")
-public class VNFType implements Serializable {
+@Table(name = "VnfType")
+@NamedQuery(name = "VnfType.findAll", query = "SELECT v FROM VnfType v ")
+@Getter
+@Setter
+public class VnfType implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
- @Column(name="id")
+ @Column(name = "id")
private int id;
- @Column(name="vnf_type", nullable=false, unique=true)
+ @Column(name = "vnf_type", nullable = false, unique = true)
@OrderBy("asc")
- private String vnftype;
+ private String type;
@Temporal(TemporalType.TIMESTAMP)
- @Column(name="created_date", updatable=false)
+ @Column(name = "created_date", updatable = false)
private Date createdDate;
- @Column(name="description", nullable=true, length=2048)
+ @Column(name = "description", nullable = true, length = 2048)
private String description;
@Temporal(TemporalType.TIMESTAMP)
- @Column(name="modified_date", nullable=false)
+ @Column(name = "modified_date", nullable = false)
private Date modifiedDate;
@ManyToOne(optional = false)
- @JoinColumn(name="created_by")
+ @JoinColumn(name = "created_by")
private UserInfo userCreatedBy;
@ManyToOne(optional = false)
- @JoinColumn(name="modified_by")
+ @JoinColumn(name = "modified_by")
private UserInfo userModifiedBy;
- public VNFType() {
+ /**
+ * Instantiates a new VNF type.
+ */
+ public VnfType() {
this.modifiedDate = new Date();
}
- public UserInfo getUserCreatedBy() {
- return userCreatedBy;
- }
-
- public void setUserCreatedBy(UserInfo userCreatedBy) {
- this.userCreatedBy = userCreatedBy;
- }
-
- public UserInfo getUserModifiedBy() {
- return userModifiedBy;
- }
-
- public void setUserModifiedBy(UserInfo userModifiedBy) {
- this.userModifiedBy = userModifiedBy;
- }
-
- public String getVnftype() {
- return vnftype;
- }
-
- public void setVnftype(String vnftype) {
- this.vnftype = vnftype;
- }
-
+ /**
+ * Pre persist.
+ */
@PrePersist
- public void prePersist() {
+ public void prePersist() {
Date date = new Date();
this.createdDate = date;
this.modifiedDate = date;
}
+ /**
+ * Pre update.
+ */
@PreUpdate
public void preUpdate() {
this.modifiedDate = new Date();
}
-
- public int getId() {
- return this.id;
- }
-
- public void setId(int id) {
- this.id = id;
- }
-
- public Date getCreatedDate() {
- return this.createdDate;
- }
-
- public void setCreatedDate(Date createdDate) {
- this.createdDate = createdDate;
- }
-
- public String getDescription() {
- return this.description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public Date getModifiedDate() {
- return this.modifiedDate;
- }
-
- public void setModifiedDate(Date modifiedDate) {
- this.modifiedDate = modifiedDate;
- }
}
* ONAP-REST
* ================================================================================
* Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import java.io.Serializable;
import java.util.Date;
+
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
+import lombok.Getter;
+import lombok.Setter;
+/**
+ * The Class VsclAction.
+ */
@Entity
-@Table(name="VSCLAction")
-@NamedQuery(name="VSCLAction.findAll", query="SELECT v FROM VSCLAction v ")
-public class VSCLAction implements Serializable {
+@Table(name = "VsclAction")
+@NamedQuery(name = "VsclAction.findAll", query = "SELECT v FROM VsclAction v ")
+@Getter
+@Setter
+public class VsclAction implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
- @Column(name="id")
+ @Column(name = "id")
private int id;
- @Column(name="vscl_action", nullable=false, unique=true)
+ @Column(name = "vscl_action", nullable = false, unique = true)
@OrderBy("asc")
- private String vsclaction;
+ private String action;
@Temporal(TemporalType.TIMESTAMP)
- @Column(name="created_date", updatable=false)
+ @Column(name = "created_date", updatable = false)
private Date createdDate;
- @Column(name="description", nullable=true, length=2048)
+ @Column(name = "description", nullable = true, length = 2048)
private String description;
@Temporal(TemporalType.TIMESTAMP)
- @Column(name="modified_date", nullable=false)
+ @Column(name = "modified_date", nullable = false)
private Date modifiedDate;
@ManyToOne(optional = false)
- @JoinColumn(name="created_by")
+ @JoinColumn(name = "created_by")
private UserInfo userCreatedBy;
@ManyToOne(optional = false)
- @JoinColumn(name="modified_by")
+ @JoinColumn(name = "modified_by")
private UserInfo userModifiedBy;
- public VSCLAction() {
+ /**
+ * Instantiates a new vscl action.
+ */
+ public VsclAction() {
this.setModifiedDate(new Date());
}
- public UserInfo getUserCreatedBy() {
- return userCreatedBy;
- }
-
- public void setUserCreatedBy(UserInfo userCreatedBy) {
- this.userCreatedBy = userCreatedBy;
- }
-
- public UserInfo getUserModifiedBy() {
- return userModifiedBy;
- }
-
- public void setUserModifiedBy(UserInfo userModifiedBy) {
- this.userModifiedBy = userModifiedBy;
- }
-
+ /**
+ * Pre persist.
+ */
@PrePersist
- public void prePersist() {
+ public void prePersist() {
Date date = new Date();
this.createdDate = date;
this.modifiedDate = date;
}
+ /**
+ * Pre update.
+ */
@PreUpdate
public void preUpdate() {
this.modifiedDate = new Date();
}
- public int getId() {
- return this.id;
- }
-
- public void setId(int id) {
- this.id = id;
- }
-
- public String getVsclaction() {
- return vsclaction;
- }
-
- public void setVsclaction(String vsclaction) {
- this.vsclaction = vsclaction;
- }
-
-
- public Date getCreatedDate() {
- return this.createdDate;
- }
-
- public void setCreatedDate(Date createdDate) {
- this.createdDate = createdDate;
- }
-
- public String getDescription() {
- return this.description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public Date getModifiedDate() {
- return this.modifiedDate;
- }
-
- public void setModifiedDate(Date modifiedDate) {
- this.modifiedDate = modifiedDate;
- }
}
* ONAP-REST
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
package org.onap.policy.rest.jpa;
-/*
- *
- *
- * */
import java.io.Serializable;
-import java.util.Objects;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.OrderBy;
import javax.persistence.Table;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.Setter;
+
@Entity
@Table(name = "WatchPolicyNotificationTable")
-@NamedQuery(name="WatchPolicyNotificationTable.findAll", query="SELECT e FROM WatchPolicyNotificationTable e ")
-public class WatchPolicyNotificationTable implements Serializable{
+@NamedQuery(name = "WatchPolicyNotificationTable.findAll", query = "SELECT e FROM WatchPolicyNotificationTable e ")
+@Getter
+@Setter
+@EqualsAndHashCode
+public class WatchPolicyNotificationTable implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
- @Column(name="id")
+ @Column(name = "id")
private int id;
- @Column(name="policyName", nullable=false, unique=true)
+ @Column(name = "policyName", nullable = false, unique = true)
@OrderBy("asc")
private String policyName;
- @Column(name="loginIds", nullable=false, unique=true)
+ @Column(name = "loginIds", nullable = false, unique = true)
@OrderBy("asc")
private String loginIds;
-
- public int getId() {
- return id;
- }
-
- public void setId(int id) {
- this.id = id;
- }
-
- public String getPolicyName() {
- return policyName;
- }
-
- public void setPolicyName(String policyName) {
- this.policyName = policyName;
- }
-
- public String getLoginIds() {
- return loginIds;
- }
-
- public void setLoginIds(String loginIds) {
- this.loginIds = loginIds;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(id, policyName, loginIds);
- }
-
- @Override
- public boolean equals(Object obj) {
- if(obj == null){
- return false;
- }
- if(obj == this){
- return true;
- }
- if(!(obj instanceof WatchPolicyNotificationTable)){
- return false;
- }
-
- return id == ((WatchPolicyNotificationTable)obj).id &&
- policyName.equals(((WatchPolicyNotificationTable)obj).policyName) &&
- loginIds.equals(((WatchPolicyNotificationTable)obj).loginIds);
- }
-
-
}
* ONAP-REST
* ================================================================================
* Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
package org.onap.policy.rest.jpa;
-/*
- */
+
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.OrderBy;
import javax.persistence.Table;
+import lombok.Getter;
+import lombok.Setter;
+
@Entity
-@Table(name="zone")
-@NamedQuery(name="Zone.findAll", query="SELECT e FROM Zone e ")
+@Table(name = "zone")
+@NamedQuery(name = "Zone.findAll", query = "SELECT e FROM Zone e ")
+@Getter
+@Setter
public class Zone implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
- @Column(name="id")
+ @Column(name = "id")
private int id;
- @Column(name="zonename", nullable=false)
+ @Column(name = "zonename", nullable = false)
@OrderBy("asc")
private String zoneName;
- @Column(name="zonevalue")
+ @Column(name = "zonevalue")
private String zoneValue;
-
- public int getId() {
- return this.id;
- }
-
- public void setId(int id) {
- this.id = id;
- }
- public String getZoneName() {
- return this.zoneName;
- }
-
- public void setZoneName(String zoneName) {
- this.zoneName = zoneName;
-
- }
- public String getZoneValue() {
- return this.zoneValue;
- }
-
- public void setZoneValue(String zoneValue) {
- this.zoneValue = zoneValue;
- }
-
}
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import org.onap.policy.rest.jpa.PolicyEntity;
import org.onap.policy.rest.jpa.PolicyRoles;
import org.onap.policy.rest.jpa.PolicyVersion;
-import org.onap.policy.rest.jpa.SystemLogDB;
+import org.onap.policy.rest.jpa.SystemLogDb;
import org.onap.policy.rest.jpa.UserInfo;
import org.onap.policy.rest.jpa.WatchPolicyNotificationTable;
import org.springframework.orm.hibernate4.LocalSessionFactoryBuilder;
/**
* Set up all unit tests.
- *
+ *
* @throws SQLException on SQL exceptions
*/
@BeforeClass
PolicyValidationDaoImpl.setSessionfactory(sessionFactory);
// PolicyController.setLogTableLimit("1");
// HibernateSession.setSession(sessionFactory);
- SystemLogDB data1 = new SystemLogDB();
+ SystemLogDb data1 = new SystemLogDb();
data1.setDate(new Date());
data1.setLogtype("INFO");
data1.setRemote("Test");
data1.setSystem("Test");
data1.setType("Test");
- SystemLogDB data2 = new SystemLogDB();
+ SystemLogDb data2 = new SystemLogDb();
data2.setDate(new Date());
data2.setLogtype("error");
data2.setRemote("Test");
assertTrue(dataCur.size() == 1);
assertTrue(dataCur.get(0) instanceof WatchPolicyNotificationTable);
assertEquals(watch, dataCur.get(0));
+
+ WatchPolicyNotificationTable table0 = new WatchPolicyNotificationTable();
+ WatchPolicyNotificationTable table1 = new WatchPolicyNotificationTable();
+ assertEquals(table0, table0);
+ assertEquals(table0, table1);
+ assertNotEquals(table0, null);
+ String helloString = "Hello";
+ Object helloObject = helloString;
+ assertNotEquals(table0, helloObject);
+
+ table0.setId(1);
+ assertNotEquals(table0, table1);
+ table1.setId(1);
+ assertEquals(table0, table1);
+
+ table0.setPolicyName("GoToOz");
+ assertNotEquals(table0, table1);
+ table1.setPolicyName("GoToOz");
+ assertEquals(table0, table1);
+ table1.setPolicyName(null);
+ assertNotEquals(table0, table1);
+ table0.setPolicyName(null);
+ assertEquals(table0, table1);
+ table1.setPolicyName("GoToOz");
+ assertNotEquals(table0, table1);
+ table0.setPolicyName("GoToOz");
+ assertEquals(table0, table1);
+ assertEquals(table0, table1);
+ table1.setPolicyName("InOz");
+ assertNotEquals(table0, table1);
+ table0.setPolicyName("InOz");
+ assertEquals(table0, table1);
+
+ table0.setLoginIds("Wizard");
+ assertNotEquals(table0, table1);
+ table1.setLoginIds("Wizard");
+ assertEquals(table0, table1);
+ table1.setLoginIds(null);
+ assertNotEquals(table0, table1);
+ table0.setLoginIds(null);
+ assertEquals(table0, table1);
+ table0.setLoginIds("Wizard");
+ assertNotEquals(table0, table1);
+ table1.setLoginIds("Wizard");
+ assertEquals(table0, table1);
+ table1.setLoginIds(null);
+ table1.setLoginIds("Witch");
+ assertNotEquals(table0, table1);
+ table0.setLoginIds("Witch");
+ assertEquals(table0, table1);
+
+ assertNotNull(table0.hashCode());
+ assertNotNull(table1.hashCode());
+ assertEquals(table0.hashCode(), table0.hashCode());
+
+ table0.setLoginIds("Witci");
+ assertNotEquals(table0, table1);
+ assertNotEquals(table0.hashCode(), table1.hashCode());
}
/*
UserInfo userInfo = new UserInfo();
userInfo.setUserLoginId("TestID");
userInfo.setUserName("Test");
+ assertEquals("Test", userInfo.getIdentiferByUserId().getUri().getPath());
commonClassDao.save(userInfo);
List<String> multipleData = new ArrayList<>();
multipleData.add("TestID:Test1");
data.setXacmlId("Test");
assertTrue("Test".equals(data.getXacmlId()));
data.toString();
+
+ RuleAlgorithms ra0 = new RuleAlgorithms(new DummyIdentifier());
+ assertTrue(ra0.isStandard());
+ assertFalse(ra0.isCustom());
+ RuleAlgorithms ra1 = new RuleAlgorithms(new DummyIdentifier(), 'C');
+ assertFalse(ra1.isStandard());
+ assertTrue(ra1.isCustom());
}
@Test
*/
@Test
public void testVsclAction() {
- VSCLAction data = new VSCLAction();
+ VsclAction data = new VsclAction();
data.preUpdate();
data.prePersist();
data.setId(1);
assertTrue(1 == data.getId());
- data.setVsclaction("Test");
- assertTrue("Test".equals(data.getVsclaction()));
+ data.setAction("Test");
+ assertTrue("Test".equals(data.getAction()));
data.setDescription("Test");
assertTrue("Test".equals(data.getDescription()));
data.setCreatedDate(new Date());
*/
@Test
public void testVnfType() {
- VNFType data = new VNFType();
+ VnfType data = new VnfType();
data.preUpdate();
data.prePersist();
data.setId(1);
assertTrue(1 == data.getId());
- data.setVnftype("Test");
- assertTrue("Test".equals(data.getVnftype()));
+ data.setType("Test");
+ assertTrue("Test".equals(data.getType()));
data.setDescription("Test");
assertTrue("Test".equals(data.getDescription()));
data.setCreatedDate(new Date());
assertTrue("Test".equals(data.getVarbindName()));
data.setVarbindDescription("Test");
assertTrue("Test".equals(data.getVarbindDescription()));
- data.setVarbindOID("Test");
- assertTrue("Test".equals(data.getVarbindOID()));
+ data.setVarbindOid("Test");
+ assertTrue("Test".equals(data.getVarbindOid()));
data.setCreatedDate(new Date());
assertTrue(data.getCreatedDate() != null);
data.setModifiedDate(new Date());
data.prePersist();
data.setId(1);
assertTrue(1 == data.getId());
- data.setRiskName("Test");
- assertTrue("Test".equals(data.getRiskName()));
+ data.setName("Test");
+ assertTrue("Test".equals(data.getName()));
data.setDescription("Test");
assertTrue("Test".equals(data.getDescription()));
data.setCreatedDate(new Date());
assertTrue("Test".equals(data.getServiceDescription()));
data.setServiceType("Test");
assertTrue("Test".equals(data.getServiceType()));
- data.setServiceTransProtocol("Test");
- assertTrue("Test".equals(data.getServiceTransProtocol()));
+ data.setServiceTransportProtocol("Test");
+ assertTrue("Test".equals(data.getServiceTransportProtocol()));
data.setServiceAppProtocol("Test");
assertTrue("Test".equals(data.getServiceAppProtocol()));
data.setServicePorts("Test");
data.setTermName("Test");
assertTrue("Test".equals(data.getTermName()));
data.setDescription("Test");
- assertTrue("Test".equals(data.getTermDescription()));
- data.setFromZones("Test");
+ assertTrue("Test".equals(data.getDescription()));
+ data.setFromZone("Test");
assertTrue("Test".equals(data.getFromZone()));
- data.setToZones("Test");
+ data.setToZone("Test");
assertTrue("Test".equals(data.getToZone()));
- data.setSrcIPList("Test");
- assertTrue("Test".equals(data.getSrcIPList()));
- data.setDestIPList("Test");
- assertTrue("Test".equals(data.getDestIPList()));
+ data.setSrcIpList("Test");
+ assertTrue("Test".equals(data.getSrcIpList()));
+ data.setDestIpList("Test");
+ assertTrue("Test".equals(data.getDestIpList()));
data.setProtocolList("Test");
assertTrue("Test".equals(data.getProtocolList()));
data.setPortList("Test");
*/
@Test
public void testVmType() {
- VMType data = new VMType();
+ VmType data = new VmType();
data.setId(1);
assertTrue(1 == data.getId());
data.setName("Test");
package org.onap.policy.rest.jpa;
+import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
PolicyEntity entity0 = new PolicyEntity();
PolicyEntity entity1 = new PolicyEntity();
- assertTrue(entity0.equals(entity0));
- assertTrue(entity0.equals(entity1));
- assertFalse(entity0.equals(null));
+ assertEquals(entity0, entity0);
+ assertEquals(entity0, entity1);
+ assertNotEquals(entity0, null);
String helloString = "Hello";
Object helloObject = helloString;
- assertFalse(entity0.equals(helloObject));
+ assertNotEquals(entity0, helloObject);
entity0.setPolicyId(1);
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity1.setPolicyId(1);
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
entity0.setPolicyId(2);
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity1.setPolicyId(2);
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
entity0.setPolicyName("GoToOz");
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity1.setPolicyName("GoToOz");
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
entity1.setPolicyName(null);
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity0.setPolicyName(null);
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
entity1.setPolicyName("GoToOz");
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity0.setPolicyName("GoToOz");
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
entity1.setPolicyName("GoToOzNow");
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity0.setPolicyName("GoToOzNow");
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
entity0.setScope("All");
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity1.setScope("All");
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
entity1.setScope(null);
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity0.setScope(null);
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
entity1.setScope("All");
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity0.setScope("All");
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
entity1.setScope("AllIn");
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity0.setScope("AllIn");
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
entity0.setVersion(1);
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity1.setVersion(1);
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
entity0.setPolicyVersion(1);
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity1.setPolicyVersion(1);
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
entity0.setPolicyVersion(2);
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity1.setPolicyVersion(2);
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
entity0.setPolicyData("SomeData");
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity1.setPolicyData("SomeData");
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
entity1.setPolicyData(null);
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity0.setPolicyData(null);
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
entity1.setPolicyData("SomeData");
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity0.setPolicyData("SomeData");
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
entity1.setPolicyData("SomeMoreData");
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity0.setPolicyData("SomeMoreData");
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
ConfigurationDataEntity cde0 = new ConfigurationDataEntity();
entity0.setConfigurationDataEntity(cde0);
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity1.setConfigurationDataEntity(cde0);
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
entity1.setConfigurationDataEntity(null);
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity0.setConfigurationDataEntity(null);
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
ConfigurationDataEntity cde1 = new ConfigurationDataEntity();
entity1.setConfigurationDataEntity(cde1);
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity0.setConfigurationDataEntity(cde1);
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
ActionBodyEntity abe0 = new ActionBodyEntity();
entity0.setActionBodyEntity(abe0);
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity1.setActionBodyEntity(abe0);
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
entity1.setActionBodyEntity(null);
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity0.setActionBodyEntity(null);
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
entity1.setActionBodyEntity(abe0);
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity0.setActionBodyEntity(abe0);
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
ActionBodyEntity abe1 = new ActionBodyEntity();
entity1.setActionBodyEntity(abe1);
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity0.setActionBodyEntity(abe1);
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
entity0.setDescription("Description");
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity1.setDescription("Description");
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
entity1.setDescription(null);
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity0.setDescription(null);
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
entity1.setDescription("Description");
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity0.setDescription("Description");
- assertTrue(entity0.equals(entity1));
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
+ assertEquals(entity0, entity1);
entity1.setDescription("Description Extra");
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity0.setDescription("Description Extra");
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
entity0.setDeleted(true);
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity1.setDeleted(true);
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
entity0.setDeleted(false);
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity1.setDeleted(false);
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
entity0.setDeleteReasonCode("NoReason");
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity1.setDeleteReasonCode("NoReason");
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
entity1.setDeleteReasonCode(null);
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity0.setDeleteReasonCode(null);
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
entity1.setDeleteReasonCode("NoReason");
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity0.setDeleteReasonCode("NoReason");
- assertTrue(entity0.equals(entity1));
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
+ assertEquals(entity0, entity1);
entity1.setDeleteReasonCode("NoOtherReason");
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity0.setDeleteReasonCode("NoOtherReason");
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
entity0.setCreatedBy("Dorothy");
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity1.setCreatedBy("Dorothy");
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
entity1.setCreatedBy(null);
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity0.setCreatedBy(null);
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
entity1.setCreatedBy("Dorothy");
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity0.setCreatedBy("Dorothy");
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
entity1.setCreatedBy("Toto");
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity0.setCreatedBy("Toto");
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
entity0.setCreatedDate(new Date(12345L));
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity1.setCreatedDate(new Date(12345L));
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
entity1.setCreatedDate(null);
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity0.setCreatedDate(null);
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
entity1.setCreatedDate(new Date(12345L));
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity0.setCreatedDate(new Date(12345L));
- assertTrue(entity0.equals(entity1));
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
+ assertEquals(entity0, entity1);
entity1.setCreatedDate(new Date(123456L));
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity0.setCreatedDate(new Date(123456L));
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
entity0.setModifiedBy("Dorothy");
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity1.setModifiedBy("Dorothy");
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
entity1.setModifiedBy(null);
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity0.setModifiedBy(null);
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
entity1.setModifiedBy("Dorothy");
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity0.setModifiedBy("Dorothy");
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
entity1.setModifiedBy("Toto");
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity0.setModifiedBy("Toto");
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
entity0.setModifiedDate(new Date(12345L));
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity1.setModifiedDate(new Date(12345L));
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
entity1.setModifiedDate(null);
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity0.setModifiedDate(null);
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
entity1.setModifiedDate(new Date(12345L));
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity0.setModifiedDate(new Date(12345L));
- assertTrue(entity0.equals(entity1));
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
+ assertEquals(entity0, entity1);
entity1.setModifiedDate(new Date(123456L));
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity0.setModifiedDate(new Date(123456L));
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
entity0.setDeletedBy("Dorothy");
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity1.setDeletedBy("Dorothy");
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
entity1.setDeletedBy(null);
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity0.setDeletedBy(null);
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
entity1.setDeletedBy("Dorothy");
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity0.setDeletedBy("Dorothy");
- assertTrue(entity0.equals(entity1));
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
+ assertEquals(entity0, entity1);
entity1.setDeletedBy("Toto");
- assertFalse(entity0.equals(entity1));
+ assertNotEquals(entity0, entity1);
entity0.setDeletedBy("Toto");
- assertTrue(entity0.equals(entity1));
+ assertEquals(entity0, entity1);
assertNotNull(entity0.hashCode());
assertNotNull(entity1.hashCode());
+ assertEquals(entity0.hashCode(), entity0.hashCode());
+
+ entity0.setDeletedBy("Totp");
+ assertNotEquals(entity0, entity1);
+ assertNotEquals(entity0.hashCode(), entity1.hashCode());
}
/**
assertTrue(data.isDeleted());
assertTrue(data.getCreatedDate() != null);
assertTrue(data.getModifiedDate() != null);
- data.equals(new ConfigurationDataEntity());
+ String helloString = "Hello";
+ Object helloObject = helloString;
+ assertNotEquals(data, helloObject);
data.hashCode();
}
package org.onap.policy.rest.jpa;
-import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
PolicyVersion version0 = new PolicyVersion();
PolicyVersion version1 = new PolicyVersion();
- assertTrue(version0.equals(version0));
- assertTrue(version0.equals(version1));
- assertFalse(version0.equals(null));
+ assertEquals(version0, version0);
+ assertEquals(version0, version1);
+ assertNotEquals(version0, null);
String helloString = "Hello";
Object helloObject = helloString;
- assertFalse(version0.equals(helloObject));
+ assertNotEquals(version0, helloObject);
version0.setId(1);
- assertFalse(version0.equals(version1));
+ assertNotEquals(version0, version1);
version1.setId(1);
- assertTrue(version0.equals(version1));
+ assertEquals(version0, version1);
version0.setActiveVersion(1);
- assertFalse(version0.equals(version1));
+ assertNotEquals(version0, version1);
version1.setActiveVersion(1);
- assertTrue(version0.equals(version1));
+ assertEquals(version0, version1);
version0.setCreatedBy("Dorothy");
- assertFalse(version0.equals(version1));
+ assertNotEquals(version0, version1);
version1.setCreatedBy("Dorothy");
- assertTrue(version0.equals(version1));
+ assertEquals(version0, version1);
version1.setCreatedBy(null);
- assertFalse(version0.equals(version1));
+ assertNotEquals(version0, version1);
version0.setCreatedBy(null);
- assertTrue(version0.equals(version1));
+ assertEquals(version0, version1);
version1.setCreatedBy("Dorothy");
- assertFalse(version0.equals(version1));
+ assertNotEquals(version0, version1);
version0.setCreatedBy("Dorothy");
- assertTrue(version0.equals(version1));
+ assertEquals(version0, version1);
version0.setCreatedDate(new Date(12345L));
- assertFalse(version0.equals(version1));
+ assertNotEquals(version0, version1);
version1.setCreatedDate(new Date(12345L));
- assertTrue(version0.equals(version1));
+ assertEquals(version0, version1);
version1.setCreatedDate(null);
- assertFalse(version0.equals(version1));
+ assertNotEquals(version0, version1);
version0.setCreatedDate(null);
- assertTrue(version0.equals(version1));
+ assertEquals(version0, version1);
version1.setCreatedDate(new Date(12345L));
- assertFalse(version0.equals(version1));
+ assertNotEquals(version0, version1);
version0.setCreatedDate(new Date(12345L));
- assertTrue(version0.equals(version1));
+ assertEquals(version0, version1);
version0.setHigherVersion(1);
- assertFalse(version0.equals(version1));
+ assertNotEquals(version0, version1);
version1.setHigherVersion(1);
- assertTrue(version0.equals(version1));
+ assertEquals(version0, version1);
version0.setModifiedBy("Dorothy");
- assertFalse(version0.equals(version1));
+ assertNotEquals(version0, version1);
version1.setModifiedBy("Dorothy");
- assertTrue(version0.equals(version1));
+ assertEquals(version0, version1);
version1.setModifiedBy(null);
- assertFalse(version0.equals(version1));
+ assertNotEquals(version0, version1);
version0.setModifiedBy(null);
- assertTrue(version0.equals(version1));
+ assertEquals(version0, version1);
version1.setModifiedBy("Dorothy");
- assertFalse(version0.equals(version1));
+ assertNotEquals(version0, version1);
version0.setModifiedBy("Dorothy");
- assertTrue(version0.equals(version1));
+ assertEquals(version0, version1);
version0.setModifiedDate(new Date(12345L));
- assertFalse(version0.equals(version1));
+ assertNotEquals(version0, version1);
version1.setModifiedDate(new Date(12345L));
- assertTrue(version0.equals(version1));
+ assertEquals(version0, version1);
version1.setModifiedDate(null);
- assertFalse(version0.equals(version1));
+ assertNotEquals(version0, version1);
version0.setModifiedDate(null);
- assertTrue(version0.equals(version1));
+ assertEquals(version0, version1);
version1.setModifiedDate(new Date(12345L));
- assertFalse(version0.equals(version1));
+ assertNotEquals(version0, version1);
version0.setModifiedDate(new Date(12345L));
- assertTrue(version0.equals(version1));
+ assertEquals(version0, version1);
version0.setPolicyName("GoToOz");
- assertFalse(version0.equals(version1));
+ assertNotEquals(version0, version1);
version1.setPolicyName("GoToOz");
- assertTrue(version0.equals(version1));
+ assertEquals(version0, version1);
version1.setPolicyName(null);
- assertFalse(version0.equals(version1));
+ assertNotEquals(version0, version1);
version0.setPolicyName(null);
- assertTrue(version0.equals(version1));
+ assertEquals(version0, version1);
version1.setPolicyName("GoToOz");
- assertFalse(version0.equals(version1));
+ assertNotEquals(version0, version1);
version0.setPolicyName("GoToOz");
- assertTrue(version0.equals(version1));
+ assertEquals(version0, version1);
assertNotNull(version0.hashCode());
assertNotNull(version1.hashCode());
+ assertEquals(version0.hashCode(), version0.hashCode());
+
+ version0.setPolicyName("GoToOy");
+ assertNotEquals(version0, version1);
+ assertNotEquals(version0.hashCode(), version1.hashCode());
}
/**
* Test system log DB.
*/
@Test
- public void testSystemLogDB() {
- SystemLogDB data = new SystemLogDB();
- new SystemLogDB(1, "", "", "", "", "");
+ public void testSystemLogDb() {
+ SystemLogDb data = new SystemLogDb();
+ new SystemLogDb(1, "", "", "", "", "");
data.setId(1);
assertTrue(1 == data.getId());
data.setDescription("Test");
import org.onap.policy.common.logging.flexlogger.FlexLogger;
import org.onap.policy.common.logging.flexlogger.Logger;
import org.onap.policy.controller.PolicyController;
-import org.onap.policy.rest.jpa.SystemLogDB;
+import org.onap.policy.rest.jpa.SystemLogDb;
@SuppressWarnings("deprecation")
public class HibernateSession {
prop.setProperty("hibernate.connection.driver_class", PolicyController.getLogdbDriver());
prop.setProperty("show_sql", "false");
logSessionFactory = new Configuration().addPackage("org.onap.policy.*").addProperties(prop)
- .addAnnotatedClass(SystemLogDB.class).buildSessionFactory();
+ .addAnnotatedClass(SystemLogDb.class).buildSessionFactory();
} catch (Exception ex) {
LOGGER.error("Exception Occured while creating Log database Hibernate session" + ex);
}
try {
varbindId =
(VarbindDictionary) commonclassdao.getEntityItem(VarbindDictionary.class, "varbindName", attrib);
- return varbindId.getVarbindOID();
+ return varbindId.getVarbindOid();
} catch (Exception e) {
policyLogger.error("Error during retrieving varbindName " + attrib, e);
return attrib;
List<Object> tmList = commonClassDao.getDataById(TermList.class, "termName", id);
jpaTermList = (TermList) tmList.get(0);
if (jpaTermList != null) {
- ruleSrcList = jpaTermList.getSrcIPList();
+ ruleSrcList = jpaTermList.getSrcIpList();
if ((ruleSrcList != null) && (!ruleSrcList.isEmpty()) && !"null".equals(ruleSrcList)) {
- displayString.append("Source IP List: " + jpaTermList.getSrcIPList());
+ displayString.append("Source IP List: " + jpaTermList.getSrcIpList());
displayString.append(" ; \t\n");
for (String srcList : ruleSrcList.split(",")) {
if (srcList.startsWith(GROUP)) {
}
displayString.append("\n");
}
- ruleDestList = jpaTermList.getDestIPList();
+ ruleDestList = jpaTermList.getDestIpList();
if (ruleDestList != null && (!ruleDestList.isEmpty()) && !"null".equals(ruleDestList)) {
- displayString.append("Destination IP List: " + jpaTermList.getDestIPList());
+ displayString.append("Destination IP List: " + jpaTermList.getDestIpList());
displayString.append(" ; \t\n");
for (String destList : ruleDestList.split(",")) {
if (destList.startsWith(GROUP)) {
displayString.append("\n\t" + "Name: " + sl.getServiceName());
displayString.append("\n\t" + "Description: " + sl.getServiceDescription());
displayString.append(
- "\n\t" + "Transport-Protocol: " + sl.getServiceTransProtocol());
+ "\n\t" + "Transport-Protocol: " + sl.getServiceTransportProtocol());
displayString.append("\n\t" + "Ports: " + sl.getServicePorts());
displayString.append("\n");
}
displayString.append("\n\t" + "Name: " + sl.getServiceName());
displayString.append("\n\t" + "Description: " + sl.getServiceDescription());
displayString
- .append("\n\t" + "Transport-Protocol: " + sl.getServiceTransProtocol());
+ .append("\n\t" + "Transport-Protocol: " + sl.getServiceTransportProtocol());
displayString.append("\n\t" + "Ports: " + sl.getServicePorts());
displayString.append("\n");
}
for (int j = 0; j < termListData.size(); j++) {
jpaTermList = (TermList) termListData.get(j);
if (jpaTermList.getTermName().equals(termCollectorList.get(tl))) {
- ruleDesc = jpaTermList.getTermDescription();
+ ruleDesc = jpaTermList.getDescription();
if ((ruleDesc != null) && (!ruleDesc.isEmpty())) {
targetTerm.setDescription(ruleDesc);
}
mapToZone = new HashMap<>();
mapToZone.put(tl, ruleToZone);
}
- ruleSrcPrefixList = jpaTermList.getSrcIPList();
+ ruleSrcPrefixList = jpaTermList.getSrcIpList();
if ((ruleSrcPrefixList != null) && (!ruleSrcPrefixList.isEmpty())) {
mapSrcIp = new HashMap<>();
mapSrcIp.put(tl, ruleSrcPrefixList);
}
- ruleDestPrefixList = jpaTermList.getDestIPList();
+ ruleDestPrefixList = jpaTermList.getDestIpList();
if ((ruleDestPrefixList != null) && (!ruleDestPrefixList.isEmpty())) {
mapDestIP = new HashMap<>();
mapDestIP.put(tl, ruleDestPrefixList);
sl = mappingServiceList(t);
targetSl.setName(sl.getServiceName());
targetSl.setDescription(sl.getServiceDescription());
- targetSl.setTransportProtocol(sl.getServiceTransProtocol());
+ targetSl.setTransportProtocol(sl.getServiceTransportProtocol());
targetSl.setType(sl.getServiceType());
targetSl.setPorts(sl.getServicePorts());
servListArray.add(targetSl);
targetSl.setName(expandGroupSl.getServiceName());
targetSl.setDescription(expandGroupSl.getServiceDescription());
- targetSl.setTransportProtocol(expandGroupSl.getServiceTransProtocol());
+ targetSl.setTransportProtocol(expandGroupSl.getServiceTransportProtocol());
targetSl.setType(expandGroupSl.getServiceType());
targetSl.setPorts(expandGroupSl.getServicePorts());
servListArray.add(targetSl);
import java.util.List;
-import org.onap.policy.rest.jpa.SystemLogDB;
+import org.onap.policy.rest.jpa.SystemLogDb;
public abstract interface SystemLogDbDao {
- public abstract List<SystemLogDB> getLoggingData();
+ public abstract List<SystemLogDb> getLoggingData();
- public abstract List<SystemLogDB> getSystemAlertData();
+ public abstract List<SystemLogDb> getSystemAlertData();
}
import org.onap.policy.conf.HibernateSession;
import org.onap.policy.controller.PolicyController;
import org.onap.policy.dao.SystemLogDbDao;
-import org.onap.policy.rest.jpa.SystemLogDB;
+import org.onap.policy.rest.jpa.SystemLogDb;
import org.onap.policy.xacml.api.XACMLErrorConstants;
import org.springframework.stereotype.Service;
@SuppressWarnings("unchecked")
@Override
- public List<SystemLogDB> getLoggingData() {
+ public List<SystemLogDb> getLoggingData() {
Session session = HibernateSession.getSession();
Transaction tx = session.beginTransaction();
- List<SystemLogDB> system = null;
+ List<SystemLogDb> system = null;
try {
String sqlWhere = null;
if (PolicyController.isjUnit()) {
sqlWhere = "date > DATE_SUB(curdate(), INTERVAL 5 DAY) ORDER BY date DESC limit "
+ PolicyController.getLogTableLimit() + "";
}
- Criteria cr = session.createCriteria(SystemLogDB.class);
+ Criteria cr = session.createCriteria(SystemLogDb.class);
cr.add(Restrictions.sqlRestriction(sqlWhere));
system = cr.list();
tx.commit();
} catch (Exception e) {
- logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying SystemLogDB Table" + e);
+ logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying SystemLogDb Table" + e);
} finally {
try {
session.close();
@SuppressWarnings("unchecked")
@Override
- public List<SystemLogDB> getSystemAlertData() {
+ public List<SystemLogDb> getSystemAlertData() {
Session session = HibernateSession.getSession();
Transaction tx = session.beginTransaction();
- List<SystemLogDB> system = null;
+ List<SystemLogDb> system = null;
try {
String sqlWhere = null;
if (PolicyController.isjUnit()) {
sqlWhere = "date > DATE_SUB(curdate(), INTERVAL 5 DAY) and logtype = 'error' ORDER BY date DESC limit "
+ PolicyController.getSystemAlertTableLimit() + "";
}
- Criteria cr = session.createCriteria(SystemLogDB.class);
+ Criteria cr = session.createCriteria(SystemLogDb.class);
cr.add(Restrictions.sqlRestriction(sqlWhere));
system = cr.list();
tx.commit();
} catch (Exception e) {
- logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying SystemLogDB Table" + e);
+ logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying SystemLogDb Table" + e);
} finally {
try {
session.close();
ServiceList serviceList = new ServiceList();
serviceList.setServiceName("Test");
serviceList.setServiceType("SERVICE");
- serviceList.setServiceTransProtocol("Test");
+ serviceList.setServiceTransportProtocol("Test");
serviceList.setServiceAppProtocol("Test");
serviceList.setServicePorts("8080");
serviceListData.add(serviceList);
termListData = new ArrayList<>();
TermList termList = new TermList();
termList.setTermName("Test");
- termList.setFromZones("Test");
- termList.setToZones("Test");
- termList.setSrcIPList("Test");
- termList.setDestIPList("Test");
+ termList.setFromZone("Test");
+ termList.setToZone("Test");
+ termList.setSrcIpList("Test");
+ termList.setDestIpList("Test");
termList.setSrcPortList("Test");
termList.setDestPortList("Test");
termList.setAction("Test");
import org.onap.policy.rest.jpa.PolicyEntity;
import org.onap.policy.rest.jpa.PolicyRoles;
import org.onap.policy.rest.jpa.PolicyVersion;
-import org.onap.policy.rest.jpa.SystemLogDB;
+import org.onap.policy.rest.jpa.SystemLogDb;
import org.onap.policy.rest.jpa.UserInfo;
import org.onap.policy.rest.jpa.WatchPolicyNotificationTable;
import org.springframework.orm.hibernate4.LocalSessionFactoryBuilder;
CommonClassDaoImpl.setSessionfactory(sessionFactory);
PolicyController.setLogTableLimit("1");
HibernateSession.setSession(sessionFactory);
- SystemLogDB data1 = new SystemLogDB();
+ SystemLogDb data1 = new SystemLogDb();
data1.setDate(new Date());
data1.setLogtype("INFO");
data1.setRemote("Test");
data1.setSystem("Test");
data1.setType("Test");
- SystemLogDB data2 = new SystemLogDB();
+ SystemLogDb data2 = new SystemLogDb();
data2.setDate(new Date());
data2.setLogtype("error");
data2.setRemote("Test");