use of com.creditease.agent.http.api.UAVHttpMessage in project uavstack by uavorg.
the class InvokeChainQueryServerWorker method adaptRequest.
@Override
protected UAVHttpMessage adaptRequest(HttpMessage message) {
String messageBody = message.getRequestBodyAsString("UTF-8");
if (log.isDebugEnable()) {
log.debug(this, "InvokeChainQueryServerWorker Request: " + messageBody);
}
UAVHttpMessage msg = new UAVHttpMessage(messageBody);
return msg;
}
use of com.creditease.agent.http.api.UAVHttpMessage in project uavstack by uavorg.
the class MDFListenServer method adaptRequest.
@Override
protected UAVHttpMessage adaptRequest(HttpMessage message) {
String messageBody = message.getRequestBodyAsString("UTF-8");
if (log.isDebugEnable()) {
log.debug(this, "MDFListenServer Request: " + messageBody);
}
UAVHttpMessage msg = new UAVHttpMessage();
msg.putRequest(UAVHttpMessage.BODY, messageBody);
return msg;
}
use of com.creditease.agent.http.api.UAVHttpMessage in project uavstack by uavorg.
the class NotificaitonScheduleWorker method executeNCHttpTestcase.
public void executeNCHttpTestcase() {
String url = "http://localhost:8766/nc/update";
UAVHttpMessage request = new UAVHttpMessage();
String nceventKey = "127.0.0.1@notificationEvent@NotificaitonScheduleWorker@notifytestagent@-1172353146";
request.putRequest("ncevent", nceventKey);
String content = JSONHelper.toString(request);
executeHttpCommand(url, content);
}
use of com.creditease.agent.http.api.UAVHttpMessage in project uavstack by uavorg.
the class LogNodeOperAction method doAction.
@Override
public void doAction(ActionContext context) throws Exception {
AgentFeatureComponent afc = (AgentFeatureComponent) getConfigManager().getComponent(feature, "LogAgent");
if (afc == null) {
return;
}
UAVHttpMessage data = (UAVHttpMessage) context.getParam("msg");
String strategy = data.getRequest("strategy");
try {
afc.exchange("logagent.strategy", strategy);
data.putResponse("rs", "OK");
} catch (Exception e) {
log.err(this, "exchange logagent strategy FAILED. " + strategy, e);
data.putResponse("rs", "ERR");
data.putResponse("msg", "设置日志抓取策略出错!");
}
}
use of com.creditease.agent.http.api.UAVHttpMessage in project uavstack by uavorg.
the class HttpTestApphubManager method getRequestData.
// tools---------------------------------------------------》
/**
* 打包请求数据
*
* @param type
* @param paramPath
* @return
*/
private static byte[] getRequestData(bussinessType type, String paramPath) {
Map<String, String> dbInfo = getDBInfo(type);
UAVHttpMessage request = new UAVHttpMessage();
String dataStr = getFileData(paramPath);
request.putRequest(DataStoreProtocol.MONGO_REQUEST_DATA, dataStr);
request.putRequest(DataStoreProtocol.DATASTORE_NAME, dbInfo.get(k_dataStoreName));
request.putRequest(DataStoreProtocol.MONGO_COLLECTION_NAME, dbInfo.get(k_conllectionName));
String jsonStr = JSONHelper.toString(request);
byte[] datab = null;
try {
datab = jsonStr.getBytes("utf-8");
} catch (UnsupportedEncodingException e) {
LOG.info("HttpTestApphub getRequestData \n" + e.getMessage());
}
return datab;
}
Aggregations