Search in sources :

Example 1 with ApiParser

use of com.navercorp.pinpoint.common.server.trace.ApiParser in project pinpoint by naver.

the class RecordFactory method getApi.

private Api getApi(final Align align) {
    final AnnotationBo annotation = AnnotationUtils.findAnnotationBo(align.getAnnotationBoList(), AnnotationKey.API_METADATA);
    if (annotation != null) {
        final ApiMetaDataBo apiMetaData = (ApiMetaDataBo) annotation.getValue();
        String apiInfo = apiMetaData.getDescription();
        if (apiMetaData.getMethodTypeEnum() == MethodTypeEnum.DEFAULT) {
            ApiParser parser = apiParserProvider.getParser();
            return parser.parse(apiMetaData);
        }
        // parse error
        return new Api(apiInfo, "", apiInfo, apiMetaData.getMethodTypeEnum());
    } else {
        AnnotationKey apiMetaDataError = getApiMetaDataError(align.getAnnotationBoList());
        return new Api(apiMetaDataError.getName(), "", "", MethodTypeEnum.DEFAULT);
    }
}
Also used : AnnotationBo(com.navercorp.pinpoint.common.server.bo.AnnotationBo) AnnotationKey(com.navercorp.pinpoint.common.trace.AnnotationKey) ApiMetaDataBo(com.navercorp.pinpoint.common.server.bo.ApiMetaDataBo) ApiParser(com.navercorp.pinpoint.common.server.trace.ApiParser) Api(com.navercorp.pinpoint.common.server.trace.Api)

Aggregations

AnnotationBo (com.navercorp.pinpoint.common.server.bo.AnnotationBo)1 ApiMetaDataBo (com.navercorp.pinpoint.common.server.bo.ApiMetaDataBo)1 Api (com.navercorp.pinpoint.common.server.trace.Api)1 ApiParser (com.navercorp.pinpoint.common.server.trace.ApiParser)1 AnnotationKey (com.navercorp.pinpoint.common.trace.AnnotationKey)1