ASN 版本恢复1月4号之版本

This commit is contained in:
wangxin
2019-01-18 16:21:20 +08:00
parent ed77da00c4
commit de8496e003
32 changed files with 322 additions and 1203 deletions

View File

@@ -356,7 +356,7 @@ public class ConfigServiceUtil {
}else if(type==2){
url = url+Constants.CALLBACK_CFG;
}else if(type==3) {
url = url+Constants.DELETE_COMMON_REIGON;
url = url+Constants.GROUP_REUSE_SOURCES;
}
//创建连接
WebTarget wt = ClientUtil.getWebTarger(url);
@@ -400,9 +400,9 @@ public class ConfigServiceUtil {
url = url+Constants.MAAT_CFG;
}else if(type==2){
url = url+Constants.CALLBACK_CFG;
}/*else if(type==3) {
}else if(type==3) {
url = url+Constants.GROUP_REUSE_SOURCES;
}*/
}
logger.info("put url:"+url);
//创建连接
try {
@@ -463,43 +463,26 @@ public class ConfigServiceUtil {
return bean;
}
/**
* 分组复用域配置新增,修改,删除
* 分组复用域配置新增
* @param params
* @return
* @throws MaatConvertException
*/
public static ToMaatResult auditCommonGroupRegionSources(String params,Integer action) throws MaatConvertException{
public static ToMaatResult postGroupReuseSources(String params) throws MaatConvertException{
ToMaatResult bean = null;
Response response=null;
try {
logger.warn("postGroupReuseSources start");
long start=System.currentTimeMillis();
String result = null;
String url = "";
if(action.equals(Constants.OPACTION_POST)){
url=Constants.SERVICE_URL+Constants.ADD_COMMON_REGION;
}
if(action.equals(Constants.OPACTION_PUT)){
url=Constants.SERVICE_URL+Constants.UPDATE_COMMON_REIGON;
}
if(action.equals(Constants.OPACTION_DELETE)){
url=Constants.SERVICE_URL+Constants.DELETE_COMMON_REIGON;
}
String url = Constants.SERVICE_URL+Constants.GROUP_REUSE_SOURCES;
//创建连接
WebTarget wt = ClientUtil.getWebTarger(url);
logger.info("auditCommonGroupRegionSources url:"+url);
logger.info("postGroupReuseSources url:"+url);
//获取响应结果
Builder header = wt.request(MediaType.APPLICATION_JSON).header("Content-Type", MediaType.APPLICATION_JSON);
try {
if(action.equals(Constants.OPACTION_POST)){
response= header.post(Entity.entity(params, MediaType.APPLICATION_JSON));
}
if(action.equals(Constants.OPACTION_PUT)){
response= header.put(Entity.entity(params, MediaType.APPLICATION_JSON));
}
if(action.equals(Constants.OPACTION_DELETE)){
response= header.put(Entity.entity(params, MediaType.APPLICATION_JSON));
}
response= header.post(Entity.entity(params, MediaType.APPLICATION_JSON));
if(response != null) {
result=response.readEntity(String.class);
}
@@ -515,7 +498,7 @@ public class ConfigServiceUtil {
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+result);
}
long end=System.currentTimeMillis();
logger.warn("auditCommonGroupRegionSources end,cost:"+(end-start));
logger.warn("postGroupReuseSources end,cost:"+(end-start));
} catch (Exception e) {
throw e;
} finally {
@@ -525,7 +508,6 @@ public class ConfigServiceUtil {
}
return bean;
}
/**
*
* getReport(配置日志总量统计查询)

View File

@@ -13,9 +13,7 @@ public final class Constants {
*/
public static final int IMPORT_LIMIT=Configurations.getIntProperty("import_limit",10000);
public static final Object IMPORT_LOCK=new Object();
public static final String ADD_COMMON_REGION=Configurations.getStringProperty("addRegionToCommonGroup","");
public static final String UPDATE_COMMON_REIGON=Configurations.getStringProperty("updateRegionToCommonGroup","");
public static final String DELETE_COMMON_REIGON=Configurations.getStringProperty("deleteRegionToCommonGroup","");
public static final String GROUP_REUSE_SOURCES=Configurations.getStringProperty("groupReuseSources","groupReuseSources");
public static Integer APP_SPEC_SERVICE_CODE_MIN_VAL=Configurations.getIntProperty("app_spec_service_code_min_val", 300001);
public static Integer APP_SPEC_SERVICE_CODE_MAX_VAL=Configurations.getIntProperty("app_spec_service_code_max_val", 268435455);
public static String APP_CFG_USERREGION_SPLITOR=Configurations.getStringProperty("app_cfg_userregion_splitor", "&");
@@ -496,8 +494,6 @@ public final class Constants {
public static final String HTTP_URL_REGION = Configurations.getStringProperty("http_url_region","http_url");
public static final String VOIP_IP_REGION = Configurations.getStringProperty("voip_ip","av_voip_ip");
public static final String VOIP_ACCOUNT_REGION = Configurations.getStringProperty("voip_account","av_voip_account");
public static final String NTC_ASN_NUMBER = Configurations.getStringProperty("ntc_asn_number","NTC_ASN_NUMBER");
public static final String ASN_KEY = Configurations.getStringProperty("asn_key","AS");
public static final String MAAT_VERSION = Configurations.getStringProperty("maat_version","1.0");
public static final Integer INSERT_ACTION = Configurations.getIntProperty("insert_action",1);
public static final Integer UPDATE_ACTION = Configurations.getIntProperty("update_action",2);

View File

@@ -44,7 +44,7 @@ public class DeleteAsnIpTread implements Callable<Throwable> {
while(!asnNos.isEmpty()) {
asnNos.drainTo(asnNoList,5);
for(Long asnNo:asnNoList) {
AsnGroupInfo configGroupInfo=null;//AsnCacheUtils.get(asnNo);
AsnGroupInfo configGroupInfo=AsnCacheUtils.get(asnNo);
if(configGroupInfo==null) {
configGroupInfo=new AsnGroupInfo();
configGroupInfo.setAsnId(asnNo);
@@ -85,7 +85,7 @@ public class DeleteAsnIpTread implements Callable<Throwable> {
}
sb.deleteCharAt(sb.toString().lastIndexOf(","));
asnIpCfgDao.delete(sb.toString());
new AsnIpCfgService().asnIPRegionSendToMaat(listPage, Constants.VALID_NO,1);
new AsnIpCfgService().asnIPRegionSendToMaat(listPage, Constants.VALID_NO);
transactionManager.commit(status);
listPage.clear();
} catch (Throwable e) {

View File

@@ -112,7 +112,7 @@ public class SaveAsnIpThread implements Callable<Throwable>{
_cfg.setAsnIpGroup(asnNoMaps.get(1).get(Long.parseLong(_cfg.getUserRegion1())));
}else {
// ConfigGroupInfo info=asnIpCfgService.getConfigGroupInfoByAsnNo(Long.parseLong(_cfg.getUserRegion1()));
AsnGroupInfo info=null;//AsnCacheUtils.get(Long.parseLong(_cfg.getUserRegion1()));
AsnGroupInfo info=AsnCacheUtils.get(Long.parseLong(_cfg.getUserRegion1()));
if(info==null) {
info=new AsnGroupInfo();
info.setAsnId(Long.parseLong(_cfg.getUserRegion1()));
@@ -166,7 +166,7 @@ public class SaveAsnIpThread implements Callable<Throwable>{
this.save(cfgs);
// splitAndSend(toAddRegionAsnIpCfgs,Constants.VALID_YES);
if(toAddRegionAsnIpCfgs.size()>0) {
new AsnIpCfgService().asnIPRegionSendToMaat(toAddRegionAsnIpCfgs,Constants.VALID_YES,1);
new AsnIpCfgService().asnIPRegionSendToMaat(toAddRegionAsnIpCfgs,Constants.VALID_YES);
}
cfgs.clear();
toAddRegionAsnIpCfgs.clear();