Search in sources :

Example 56 with UAVHttpMessage

use of com.creditease.agent.http.api.UAVHttpMessage in project uavstack by uavorg.

the class APMRestService method queryJavaThreadAnalysis.

@POST
@Path("jta/q")
@Produces(MediaType.APPLICATION_JSON + ";charset=utf-8")
public void queryJavaThreadAnalysis(String data, @Suspended final AsyncResponse response) {
    UAVHttpMessage msg = new UAVHttpMessage(data);
    this.doHttpPost("uav.app.apm.jta.http.addr", "/jta/q", msg, new HttpClientCallback() {

        @Override
        public void completed(HttpClientCallbackResult result) {
            response.resume(result.getReplyData());
        }

        @Override
        public void failed(HttpClientCallbackResult result) {
            String reStr = result.getReplyDataAsString();
            response.resume(reStr);
            logger.err(this, "query jta http server FAILED. retCode=" + result.getRetCode() + ", msg=" + reStr, result.getException());
        }
    });
}
Also used : HttpClientCallback(com.creditease.uav.httpasync.HttpClientCallback) UAVHttpMessage(com.creditease.agent.http.api.UAVHttpMessage) HttpClientCallbackResult(com.creditease.uav.httpasync.HttpClientCallbackResult) Path(javax.ws.rs.Path) POST(javax.ws.rs.POST) Produces(javax.ws.rs.Produces)

Example 57 with UAVHttpMessage

use of com.creditease.agent.http.api.UAVHttpMessage in project uavstack by uavorg.

the class APMRestService method queryIVCData.

@POST
@Path("ivcdata/q")
@Produces(MediaType.APPLICATION_JSON + ";charset=utf-8")
public void queryIVCData(String data, @Suspended AsyncResponse response) {
    UAVHttpMessage msg = new UAVHttpMessage(data);
    this.doHttpPost("uav.app.apm.ivc.http.addr", "/slw/q", msg, new IVCCallback(response));
}
Also used : UAVHttpMessage(com.creditease.agent.http.api.UAVHttpMessage) Path(javax.ws.rs.Path) POST(javax.ws.rs.POST) Produces(javax.ws.rs.Produces)

Example 58 with UAVHttpMessage

use of com.creditease.agent.http.api.UAVHttpMessage in project uavstack by uavorg.

the class ThreadAnalysisQueryServerWorker method adaptRequest.

@Override
protected UAVHttpMessage adaptRequest(HttpMessage message) {
    String messageBody = message.getRequestBodyAsString("UTF-8");
    if (log.isDebugEnable()) {
        log.debug(this, "ThreadAnalysisQueryServerWorker Request: " + messageBody);
    }
    UAVHttpMessage msg = new UAVHttpMessage(messageBody);
    return msg;
}
Also used : UAVHttpMessage(com.creditease.agent.http.api.UAVHttpMessage)

Aggregations

UAVHttpMessage (com.creditease.agent.http.api.UAVHttpMessage)58 Path (javax.ws.rs.Path)25 Produces (javax.ws.rs.Produces)25 POST (javax.ws.rs.POST)22 HashMap (java.util.HashMap)14 HttpClientCallback (com.creditease.uav.httpasync.HttpClientCallback)5 HttpClientCallbackResult (com.creditease.uav.httpasync.HttpClientCallbackResult)5 ArrayList (java.util.ArrayList)5 List (java.util.List)5 ApphubException (com.creditease.uav.exception.ApphubException)4 UnsupportedEncodingException (java.io.UnsupportedEncodingException)4 LinkedHashMap (java.util.LinkedHashMap)4 Map (java.util.Map)4 IOException (java.io.IOException)3 SimpleDateFormat (java.text.SimpleDateFormat)3 GET (javax.ws.rs.GET)3 AbstractSystemInvoker (com.creditease.agent.spi.AbstractSystemInvoker)2 AgentFeatureComponent (com.creditease.agent.spi.AgentFeatureComponent)2 BASE64DecoderUrl (com.creditease.uav.helpers.url.BASE64DecoderUrl)2 Date (java.util.Date)2