1、增加maat结构配置对象类,以及界面配置转换maat配置的测试类

This commit is contained in:
zhangwei
2018-05-22 16:04:18 +08:00
parent 01dacab37d
commit c6a9ac126d
4 changed files with 742 additions and 291 deletions

View File

@@ -9,6 +9,7 @@
package com.nis.domain.maat;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import com.google.gson.annotations.Expose;
@@ -27,80 +28,518 @@ import com.nis.domain.configuration.NumBoundaryCfg;
*/
public class MaatCfg implements Serializable {
/**
* @Fields serialVersionUID:TODO用一句话描述这个变量表示什么
*
* @since 1.0.0
*/
private Integer compileId;
private Integer action;
@SerializedName("service")
private Integer serviceId;
@SerializedName("contType")
private String classify;//分类
@SerializedName("attrType")
private String attribute;//性质
@SerializedName("contLabel")
private String lable;//标签
private Integer taskId;
@SerializedName("guaranteeId")
private Integer functionId;
@SerializedName("effectiveRange")
private String areaEffectiveIds ;
private Integer doBlackList;
private Integer doLog;
private Integer activeSys;
private Integer configPercent;
private Integer configOption;
private Date startTime;
private Date endTime;
private String userRegion;
private Integer groupNum;
private Integer fatherCfgId;
@SerializedName("opTime")
private Date auditTime;
private List<GroupCfg> groupRelationList;
private List<StringCfg> strRegionList;
private List<IpCfg> ipRegionList;
private List<NumBoundaryCfg> numRegionList;
private List<DigestCfg> digestRegionList;
private static final long serialVersionUID = -7745084076394247318L;
@Expose
@SerializedName("strCfg")
private List<BaseStringCfg> strCfg;
@Expose
@SerializedName("ipCfg")
private List<BaseIpCfg> ipCfg;
@Expose
@SerializedName("numCfg")
private List<NumBoundaryCfg> numCfg;
@Expose
@SerializedName("complexStrCfg")
private List<ComplexkeywordCfg> complexStrCfg;
/**
* strCfg
* @return strCfg
*/
public List<BaseStringCfg> getStrCfg() {
return strCfg;
public static class GroupCfg{
private Integer groupId;
private Integer compileId;
private Integer isValid;
private Date opTime;
public Integer getGroupId() {
return groupId;
}
public void setGroupId(Integer groupId) {
this.groupId = groupId;
}
public Integer getCompileId() {
return compileId;
}
public void setCompileId(Integer compileId) {
this.compileId = compileId;
}
public Integer getIsValid() {
return isValid;
}
public void setIsValid(Integer isValid) {
this.isValid = isValid;
}
public Date getOpTime() {
return opTime;
}
public void setOpTime(Date opTime) {
this.opTime = opTime;
}
}
/**
* @param strCfg the strCfg to set
*/
public void setStrCfg(List<BaseStringCfg> strCfg) {
this.strCfg = strCfg;
public static class StringCfg{
private Integer regionId;
private Integer groupId;
@SerializedName("tableName")
private String cfgType;
private String district;
@SerializedName("keywords")
private String cfgKeywords;
private Integer exprType;
private Integer matchMethod;
private Integer isHexbin;
private Integer isValid;
private Date opTime;
public Integer getRegionId() {
return regionId;
}
public void setRegionId(Integer regionId) {
this.regionId = regionId;
}
public Integer getGroupId() {
return groupId;
}
public void setGroupId(Integer groupId) {
this.groupId = groupId;
}
public String getCfgType() {
return cfgType;
}
public void setCfgType(String cfgType) {
this.cfgType = cfgType;
}
public String getDistrict() {
return district;
}
public void setDistrict(String district) {
this.district = district;
}
public String getCfgKeywords() {
return cfgKeywords;
}
public void setCfgKeywords(String cfgKeywords) {
this.cfgKeywords = cfgKeywords;
}
public Integer getExprType() {
return exprType;
}
public void setExprType(Integer exprType) {
this.exprType = exprType;
}
public Integer getMatchMethod() {
return matchMethod;
}
public void setMatchMethod(Integer matchMethod) {
this.matchMethod = matchMethod;
}
public Integer getIsHexbin() {
return isHexbin;
}
public void setIsHexbin(Integer isHexbin) {
this.isHexbin = isHexbin;
}
public Integer getIsValid() {
return isValid;
}
public void setIsValid(Integer isValid) {
this.isValid = isValid;
}
public Date getOpTime() {
return opTime;
}
public void setOpTime(Date opTime) {
this.opTime = opTime;
}
}
/**
* ipCfg
* @return ipCfg
*/
public List<BaseIpCfg> getIpCfg() {
return ipCfg;
public static class IpCfg{
private Integer regionId;
private Integer groupId;
@SerializedName("tableName")
private String cfgType;
private Integer ipType;
private String srcIp;
private String srcIpMask ;
private String srcPort ;
private String srcPortMask ;
private String dstIp ;
private String dstIpMask ;
private String dstPort ;
private String dstPortMask ;
private Integer direction ;
private Integer protocol ;
private Integer isValid;
private Date opTime;
public Integer getRegionId() {
return regionId;
}
public void setRegionId(Integer regionId) {
this.regionId = regionId;
}
public Integer getGroupId() {
return groupId;
}
public void setGroupId(Integer groupId) {
this.groupId = groupId;
}
public String getCfgType() {
return cfgType;
}
public void setCfgType(String cfgType) {
this.cfgType = cfgType;
}
public Integer getIpType() {
return ipType;
}
public void setIpType(Integer ipType) {
this.ipType = ipType;
}
public String getSrcIp() {
return srcIp;
}
public void setSrcIp(String srcIp) {
this.srcIp = srcIp;
}
public String getSrcIpMask() {
return srcIpMask;
}
public void setSrcIpMask(String srcIpMask) {
this.srcIpMask = srcIpMask;
}
public String getSrcPort() {
return srcPort;
}
public void setSrcPort(String srcPort) {
this.srcPort = srcPort;
}
public String getSrcPortMask() {
return srcPortMask;
}
public void setSrcPortMask(String srcPortMask) {
this.srcPortMask = srcPortMask;
}
public String getDstIp() {
return dstIp;
}
public void setDstIp(String dstIp) {
this.dstIp = dstIp;
}
public String getDstIpMask() {
return dstIpMask;
}
public void setDstIpMask(String dstIpMask) {
this.dstIpMask = dstIpMask;
}
public String getDstPort() {
return dstPort;
}
public void setDstPort(String dstPort) {
this.dstPort = dstPort;
}
public String getDstPortMask() {
return dstPortMask;
}
public void setDstPortMask(String dstPortMask) {
this.dstPortMask = dstPortMask;
}
public Integer getDirection() {
return direction;
}
public void setDirection(Integer direction) {
this.direction = direction;
}
public Integer getProtocol() {
return protocol;
}
public void setProtocol(Integer protocol) {
this.protocol = protocol;
}
public Integer getIsValid() {
return isValid;
}
public void setIsValid(Integer isValid) {
this.isValid = isValid;
}
public Date getOpTime() {
return opTime;
}
public void setOpTime(Date opTime) {
this.opTime = opTime;
}
}
/**
* @param ipCfg the ipCfg to set
*/
public void setIpCfg(List<BaseIpCfg> ipCfg) {
this.ipCfg = ipCfg;
public static class NumBoundaryCfg{
private Integer regionId;
private Integer groupId;
@SerializedName("tableName")
private String cfgType;
private Integer lowBoundary;
private Integer upBoundary;
private Integer isValid;
private Date opTime;
public Integer getRegionId() {
return regionId;
}
public void setRegionId(Integer regionId) {
this.regionId = regionId;
}
public Integer getGroupId() {
return groupId;
}
public void setGroupId(Integer groupId) {
this.groupId = groupId;
}
public String getCfgType() {
return cfgType;
}
public void setCfgType(String cfgType) {
this.cfgType = cfgType;
}
public Integer getLowBoundary() {
return lowBoundary;
}
public void setLowBoundary(Integer lowBoundary) {
this.lowBoundary = lowBoundary;
}
public Integer getUpBoundary() {
return upBoundary;
}
public void setUpBoundary(Integer upBoundary) {
this.upBoundary = upBoundary;
}
public Integer getIsValid() {
return isValid;
}
public void setIsValid(Integer isValid) {
this.isValid = isValid;
}
public Date getOpTime() {
return opTime;
}
public void setOpTime(Date opTime) {
this.opTime = opTime;
}
}public static class DigestCfg{
private Integer regionId;
private Integer groupId;
@SerializedName("tableName")
private String cfgType;
private Integer rawLen;
private String digest;
private Integer cfdsLevel;
private Integer isValid;
private Date opTime;
public Integer getRegionId() {
return regionId;
}
public void setRegionId(Integer regionId) {
this.regionId = regionId;
}
public Integer getGroupId() {
return groupId;
}
public void setGroupId(Integer groupId) {
this.groupId = groupId;
}
public String getCfgType() {
return cfgType;
}
public void setCfgType(String cfgType) {
this.cfgType = cfgType;
}
public Integer getRawLen() {
return rawLen;
}
public void setRawLen(Integer rawLen) {
this.rawLen = rawLen;
}
public String getDigest() {
return digest;
}
public void setDigest(String digest) {
this.digest = digest;
}
public Integer getCfdsLevel() {
return cfdsLevel;
}
public void setCfdsLevel(Integer cfdsLevel) {
this.cfdsLevel = cfdsLevel;
}
public Integer getIsValid() {
return isValid;
}
public void setIsValid(Integer isValid) {
this.isValid = isValid;
}
public Date getOpTime() {
return opTime;
}
public void setOpTime(Date opTime) {
this.opTime = opTime;
}
}
/**
* numCfg
* @return numCfg
*/
public List<NumBoundaryCfg> getNumCfg() {
return numCfg;
public Integer getCompileId() {
return compileId;
}
/**
* @param numCfg the numCfg to set
*/
public void setNumCfg(List<NumBoundaryCfg> numCfg) {
this.numCfg = numCfg;
public void setCompileId(Integer compileId) {
this.compileId = compileId;
}
/**
* complexStrCfg
* @return complexStrCfg
*/
public List<ComplexkeywordCfg> getComplexStrCfg() {
return complexStrCfg;
public Integer getAction() {
return action;
}
/**
* @param complexStrCfg the complexStrCfg to set
*/
public void setComplexStrCfg(List<ComplexkeywordCfg> complexStrCfg) {
this.complexStrCfg = complexStrCfg;
public void setAction(Integer action) {
this.action = action;
}
public Integer getServiceId() {
return serviceId;
}
public void setServiceId(Integer serviceId) {
this.serviceId = serviceId;
}
public String getClassify() {
return classify;
}
public void setClassify(String classify) {
this.classify = classify;
}
public String getAttribute() {
return attribute;
}
public void setAttribute(String attribute) {
this.attribute = attribute;
}
public String getLable() {
return lable;
}
public void setLable(String lable) {
this.lable = lable;
}
public Integer getTaskId() {
return taskId;
}
public void setTaskId(Integer taskId) {
this.taskId = taskId;
}
public Integer getFunctionId() {
return functionId;
}
public void setFunctionId(Integer functionId) {
this.functionId = functionId;
}
public String getAreaEffectiveIds() {
return areaEffectiveIds;
}
public void setAreaEffectiveIds(String areaEffectiveIds) {
this.areaEffectiveIds = areaEffectiveIds;
}
public Integer getDoBlackList() {
return doBlackList;
}
public void setDoBlackList(Integer doBlackList) {
this.doBlackList = doBlackList;
}
public Integer getDoLog() {
return doLog;
}
public void setDoLog(Integer doLog) {
this.doLog = doLog;
}
public Integer getActiveSys() {
return activeSys;
}
public void setActiveSys(Integer activeSys) {
this.activeSys = activeSys;
}
public Integer getConfigPercent() {
return configPercent;
}
public void setConfigPercent(Integer configPercent) {
this.configPercent = configPercent;
}
public Integer getConfigOption() {
return configOption;
}
public void setConfigOption(Integer configOption) {
this.configOption = configOption;
}
public Date getStartTime() {
return startTime;
}
public void setStartTime(Date startTime) {
this.startTime = startTime;
}
public Date getEndTime() {
return endTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
public String getUserRegion() {
return userRegion;
}
public void setUserRegion(String userRegion) {
this.userRegion = userRegion;
}
public Integer getGroupNum() {
return groupNum;
}
public void setGroupNum(Integer groupNum) {
this.groupNum = groupNum;
}
public Integer getFatherCfgId() {
return fatherCfgId;
}
public void setFatherCfgId(Integer fatherCfgId) {
this.fatherCfgId = fatherCfgId;
}
public Date getAuditTime() {
return auditTime;
}
public void setAuditTime(Date auditTime) {
this.auditTime = auditTime;
}
public List<GroupCfg> getGroupRelationList() {
return groupRelationList;
}
public void setGroupRelationList(List<GroupCfg> groupRelationList) {
this.groupRelationList = groupRelationList;
}
public List<StringCfg> getStrRegionList() {
return strRegionList;
}
public void setStrRegionList(List<StringCfg> strRegionList) {
this.strRegionList = strRegionList;
}
public List<IpCfg> getIpRegionList() {
return ipRegionList;
}
public void setIpRegionList(List<IpCfg> ipRegionList) {
this.ipRegionList = ipRegionList;
}
public List<NumBoundaryCfg> getNumRegionList() {
return numRegionList;
}
public void setNumRegionList(List<NumBoundaryCfg> numRegionList) {
this.numRegionList = numRegionList;
}
public List<DigestCfg> getDigestRegionList() {
return digestRegionList;
}
public void setDigestRegionList(List<DigestCfg> digestRegionList) {
this.digestRegionList = digestRegionList;
}
}

View File

@@ -9,11 +9,11 @@
package com.nis.domain.maat;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import com.nis.domain.configuration.AreaIpCfg;
/**
* @ClassName: ToMaatBean.java
@@ -24,219 +24,52 @@ import com.nis.domain.configuration.AreaIpCfg;
*/
public class ToMaatBean implements Serializable{
/**
*
*/
private static final long serialVersionUID = -3468862666445104490L;
/**
* @Fields serialVersionUID:TODO转换为maat格式的java bean
*
* @since 1.0.0
*/
private static final long serialVersionUID = 5123156423588372849L;
@Expose
@SerializedName("serviceCfg")
private List<MaatCfg> serviceCfg;
@Expose
@SerializedName("areaCfg")
private List<AreaIpCfg> areaCfg;
@Expose
@SerializedName("action")
private Integer action;
@Expose
@SerializedName("areaEffectiveIds")
private String areaEffectiveIds;
@Expose
@SerializedName("attribute")
private String attribute;
@Expose
@SerializedName("classify")
private String classify;
@Expose
@SerializedName("lable")
private String lable;
@Expose
@SerializedName("compileId")
private Integer compileId;
@Expose
@SerializedName("isAreaEffective")
private Integer isAreaEffective;
@Expose
@SerializedName("isValid")
private Integer isValid;
@Expose
@SerializedName("requestId")
private Integer requestId;
@Expose
@SerializedName("serviceId")
private Integer serviceId;
/**
* serviceCfg
* @return serviceCfg
*/
public List<MaatCfg> getServiceCfg() {
return serviceCfg;
private String version;
@SerializedName("operator")
private String creatorName;
@SerializedName("opTime")
private Date auditTime;
private List<MaatCfg> configCompileList;
public String getVersion() {
return version;
}
/**
* @param serviceCfg the serviceCfg to set
*/
public void setServiceCfg(List<MaatCfg> serviceCfg) {
this.serviceCfg = serviceCfg;
public void setVersion(String version) {
this.version = version;
}
/**
* areaCfg
* @return areaCfg
*/
public List<AreaIpCfg> getAreaCfg() {
return areaCfg;
public String getCreatorName() {
return creatorName;
}
/**
* @param areaCfg the areaCfg to set
*/
public void setAreaCfg(List<AreaIpCfg> areaCfg) {
this.areaCfg = areaCfg;
public void setCreatorName(String creatorName) {
this.creatorName = creatorName;
}
/**
* action
* @return action
*/
public Integer getAction() {
return action;
public Date getAuditTime() {
return auditTime;
}
/**
* @param action the action to set
*/
public void setAction(Integer action) {
this.action = action;
public void setAuditTime(Date auditTime) {
this.auditTime = auditTime;
}
/**
* areaEffectiveIds
* @return areaEffectiveIds
*/
public String getAreaEffectiveIds() {
return areaEffectiveIds;
public List<MaatCfg> getConfigCompileList() {
return configCompileList;
}
/**
* @param areaEffectiveIds the areaEffectiveIds to set
*/
public void setAreaEffectiveIds(String areaEffectiveIds) {
this.areaEffectiveIds = areaEffectiveIds;
}
/**
* attribute
* @return attribute
*/
public String getAttribute() {
return attribute;
}
/**
* @param attribute the attribute to set
*/
public void setAttribute(String attribute) {
this.attribute = attribute;
}
/**
* classify
* @return classify
*/
public String getClassify() {
return classify;
}
/**
* @param classify the classify to set
*/
public void setClassify(String classify) {
this.classify = classify;
}
/**
* lable
* @return lable
*/
public String getLable() {
return lable;
}
/**
* @param lable the lable to set
*/
public void setLable(String lable) {
this.lable = lable;
}
/**
* compileId
* @return compileId
*/
public Integer getCompileId() {
return compileId;
}
/**
* @param compileId the compileId to set
*/
public void setCompileId(Integer compileId) {
this.compileId = compileId;
}
/**
* isAreaEffective
* @return isAreaEffective
*/
public Integer getIsAreaEffective() {
return isAreaEffective;
}
/**
* @param isAreaEffective the isAreaEffective to set
*/
public void setIsAreaEffective(Integer isAreaEffective) {
this.isAreaEffective = isAreaEffective;
}
/**
* isValid
* @return isValid
*/
public Integer getIsValid() {
return isValid;
}
/**
* @param isValid the isValid to set
*/
public void setIsValid(Integer isValid) {
this.isValid = isValid;
}
/**
* requestId
* @return requestId
*/
public Integer getRequestId() {
return requestId;
}
/**
* @param requestId the requestId to set
*/
public void setRequestId(Integer requestId) {
this.requestId = requestId;
}
/**
* serviceId
* @return serviceId
*/
public Integer getServiceId() {
return serviceId;
}
/**
* @param serviceId the serviceId to set
*/
public void setServiceId(Integer serviceId) {
this.serviceId = serviceId;
public void setConfigCompileList(List<MaatCfg> configCompileList) {
this.configCompileList = configCompileList;
}
public static void main(String[] args) {