use of com.creditease.uav.exception.ApphubException in project uavstack by uavorg.
the class GUIService method createGroupInfoCache.
private void createGroupInfoCache() {
Map<String, Object> where = new HashMap<String, Object>();
where.put("state", 1);
Map<String, Object> data = new HashMap<String, Object>();
data.put("where", where);
String dataStr = JSONHelper.toString(data);
Map<String, Object> jsonRequest = new HashMap<String, Object>();
jsonRequest.put("type", "query");
jsonRequest.put("data", dataStr);
HashMap<String, String> dbInfo = new HashMap<String, String>();
dbInfo.put("dataStoreName", "AppHub.group");
dbInfo.put("conllectionName", "uav_groupinfo");
UAVHttpMessage request = new UAVHttpMessage();
request.putRequest("mrd.data", JSONHelper.toString(jsonRequest));
request.putRequest("datastore.name", dbInfo.get("dataStoreName"));
request.putRequest("mgo.coll.name", dbInfo.get("conllectionName"));
String jsonStr = JSONHelper.toString(request);
byte[] datab = null;
try {
datab = jsonStr.getBytes("utf-8");
} catch (Exception e) {
logger.err(this, "GUIService createGroupInfoCache \n" + e.getMessage());
throw new ApphubException(e);
}
logger.info(this, "GUIService createGroupInfoCache");
GroupCacheCallBack groupCacheCb = new GroupCacheCallBack();
doHttpPost("uav.app.manage.apphubmanager.http.addr", "/ah/group", datab, "application/json", "utf-8", groupCacheCb);
}
use of com.creditease.uav.exception.ApphubException in project uavstack by uavorg.
the class GUIService method createAppInfoCache.
private void createAppInfoCache() {
Map<String, Object> where = new HashMap<String, Object>();
where.put("state", 1);
Map<String, Object> data = new HashMap<String, Object>();
data.put("where", where);
String dataStr = JSONHelper.toString(data);
Map<String, Object> jsonRequest = new HashMap<String, Object>();
jsonRequest.put("type", "query");
jsonRequest.put("data", dataStr);
HashMap<String, String> dbInfo = new HashMap<String, String>();
dbInfo.put("dataStoreName", "AppHub.app");
dbInfo.put("conllectionName", "uav_appinfo");
UAVHttpMessage request = new UAVHttpMessage();
request.putRequest("mrd.data", JSONHelper.toString(jsonRequest));
request.putRequest("datastore.name", dbInfo.get("dataStoreName"));
request.putRequest("mgo.coll.name", dbInfo.get("conllectionName"));
String jsonStr = JSONHelper.toString(request);
byte[] datab = null;
try {
datab = jsonStr.getBytes("utf-8");
} catch (Exception e) {
logger.err(this, "GUIService createAppInfoCache \n" + e.getMessage());
throw new ApphubException(e);
}
logger.info(this, "GUIService createAppInfoCache");
AppCacheCallBack appCacheCb = new AppCacheCallBack();
doHttpPost("uav.app.manage.apphubmanager.http.addr", "/ah/app", datab, "application/json", "utf-8", appCacheCb);
}
use of com.creditease.uav.exception.ApphubException in project uavstack by uavorg.
the class ManageRestService method getRequestData.
// tools begin---------------------------------------------------------->
/**
* 打包请求数据
*
* @param type
* @param mapParam
* @return
*/
private byte[] getRequestData(String type, Map<String, Object> mapParam) {
Map<String, String> dbInfo = getDBInfo(type);
UAVHttpMessage request = new UAVHttpMessage();
request.putRequest("mrd.data", JSONHelper.toString(mapParam));
request.putRequest("datastore.name", dbInfo.get("dataStoreName"));
request.putRequest("mgo.coll.name", dbInfo.get("conllectionName"));
String jsonStr = JSONHelper.toString(request);
byte[] datab = null;
try {
datab = jsonStr.getBytes("utf-8");
} catch (Exception e) {
logger.err(this, "ManageBaseRestService getRequestData \n" + e.getMessage());
throw new ApphubException(e);
}
return datab;
}
use of com.creditease.uav.exception.ApphubException in project uavstack by uavorg.
the class AppHubInit method run.
public void run() {
try {
initCheckApp("1000000001", prefixUavApp + "comptest");
initCheckApp("1000000002", prefixUavApp + "godeye");
initCheckApp("1000000003", prefixUavApp + "manage");
initCheckApp("1538364490", prefixUavApp + "baseclassmgt");
initCheckApp("2097707360", prefixUavApp + "godcompass");
initCheckApp("4051451871", prefixUavApp + "betatest");
initCheckApp("2094373133", prefixUavApp + "godfilter");
initCheckGroup("uav_admin");
initCheckGroup("vipgroup");
} catch (Exception e) {
logger.err(this, "AppHubInit RUN FAIL: ", e);
throw new ApphubException(e);
}
}
use of com.creditease.uav.exception.ApphubException in project uavstack by uavorg.
the class AppHubInit method getRequestData.
protected byte[] getRequestData(String type, Map<String, Object> mapParam) {
Map<String, String> dbInfo = getDBInfo(type);
UAVHttpMessage request = new UAVHttpMessage();
request.putRequest("mrd.data", JSONHelper.toString(mapParam));
request.putRequest("datastore.name", dbInfo.get("dataStoreName"));
request.putRequest("mgo.coll.name", dbInfo.get("conllectionName"));
String jsonStr = JSONHelper.toString(request);
byte[] datab = null;
try {
datab = jsonStr.getBytes("utf8");
} catch (Exception e) {
logger.err(this, "ManageBaseRestService getRequestData " + e.getMessage());
throw new ApphubException(e);
}
return datab;
}
Aggregations