(1)ASN IP配置提交

(2)ASN 策略提交
This commit is contained in:
wangxin
2018-08-30 21:21:00 +08:00
parent 57229721a1
commit 84bfc2f199
30 changed files with 3052 additions and 24 deletions

View File

@@ -19,11 +19,13 @@ import org.glassfish.jersey.media.multipart.FormDataMultiPart;
import org.glassfish.jersey.media.multipart.file.FileDataBodyPart;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import com.google.gson.Gson;
import com.nis.domain.basics.AsnIpCfg;
import com.nis.domain.configuration.BaseIpCfg;
import com.nis.domain.log.SearchReport;
import com.nis.domain.maat.ToMaatResult;
import com.nis.domain.report.ReportResult;
import com.nis.domain.maat.MaatCfg.IpCfg;
import com.nis.exceptions.MaatConvertException;
import com.nis.util.httpclient.ClientUtil;
@@ -250,7 +252,7 @@ public class ConfigServiceUtil {
/**
* 配置状态修改
* @param params
* @param type,1表示maat配置取消2表示回调配置取消
* @param type,1表示maat配置取消2表示回调配置取消3,分组复用删除域
* @return
*/
public static ToMaatResult put(String params,Integer type) throws MaatConvertException{
@@ -261,6 +263,8 @@ public class ConfigServiceUtil {
url = url+Constants.MAAT_CFG;
}else if(type==2){
url = url+Constants.CALLBACK_CFG;
}else if(type==3) {
url = url+Constants.GROUP_REUSE_SOURCES;
}
//创建连接
WebTarget wt = ClientUtil.getWebTarger(url);
@@ -305,6 +309,33 @@ public class ConfigServiceUtil {
}
return bean;
}
/**
* 分组复用域配置新增
* @param params
* @return
* @throws MaatConvertException
*/
public static ToMaatResult postGroupReuseSources(String params) throws MaatConvertException{
String result = null;
ToMaatResult bean = null;
String url = Constants.SERVICE_URL+Constants.GROUP_REUSE_SOURCES;
//创建连接
WebTarget wt = ClientUtil.getWebTarger(url);
logger.info("postGroupReuseSources url:"+url);
//获取响应结果
Builder header = wt.request(MediaType.APPLICATION_JSON).header("Content-Type", MediaType.APPLICATION_JSON);
Response response= header.post(Entity.entity(params, MediaType.APPLICATION_JSON));
if( response.getStatus() == 200){
result= response.readEntity(String.class);
JsonConfig config=new JsonConfig();
config.setExcludes(new String[]{"configCompileList"});
JSONObject resObject = JSONObject.fromObject(result,config);
bean = (ToMaatResult) JSONObject.toBean(resObject,ToMaatResult.class);
}else{
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+response.readEntity(String.class));
}
return bean;
}
/**
*
* getReport(配置日志总量统计查询)