当前位置: 首页>>代码示例>>Java>>正文


Java ApiRequest.setApiId方法代码示例

本文整理汇总了Java中io.apiman.gateway.engine.beans.ApiRequest.setApiId方法的典型用法代码示例。如果您正苦于以下问题:Java ApiRequest.setApiId方法的具体用法?Java ApiRequest.setApiId怎么用?Java ApiRequest.setApiId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在io.apiman.gateway.engine.beans.ApiRequest的用法示例。


在下文中一共展示了ApiRequest.setApiId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: readRequest

import io.apiman.gateway.engine.beans.ApiRequest; //导入方法依赖的package包/类
/**
 * Reads a {@link ApiRequest} from information found in the inbound
 * portion of the http request.
 * @param request the undertow http server request
 * @return a valid {@link ApiRequest}
 * @throws IOException
 */
protected ApiRequest readRequest(HttpServletRequest request) throws Exception {
    ApiRequestPathInfo pathInfo = getEngine().getApiRequestPathParser().parseEndpoint(request.getPathInfo(), wrapMultiMap(request));//parseApiRequestPath(request);
    if (pathInfo.orgId == null) {
        throw new Exception(Messages.i18n.format("GatewayServlet.InvalidApiEndpoint")); //$NON-NLS-1$
    }
    QueryMap queryParams = parseApiRequestQueryParams(request.getQueryString());

    String apiKey = getApiKey(request, queryParams);

    ApiRequest srequest = GatewayThreadContext.getApiRequest();
    srequest.setApiKey(apiKey);
    srequest.setApiOrgId(pathInfo.orgId);
    srequest.setApiId(pathInfo.apiId);
    srequest.setApiVersion(pathInfo.apiVersion);
    srequest.setUrl(request.getRequestURL().toString());
    srequest.setDestination(pathInfo.resource);
    srequest.setQueryParams(queryParams);
    readHeaders(srequest, request);
    srequest.setRawRequest(request);
    srequest.setRemoteAddr(request.getRemoteAddr());
    srequest.setTransportSecure(request.isSecure());
    return srequest;
}
 
开发者ID:apiman,项目名称:apiman,代码行数:31,代码来源:GatewayServlet.java

示例2: parsePath

import io.apiman.gateway.engine.beans.ApiRequest; //导入方法依赖的package包/类
private static void parsePath(HttpServerRequest request, ApiRequest apimanRequest) {
    // NB: The apiman version of the headers has already been parsed, so the headers have already been filtered/modified.
    // Therefore we wrap the original inbound headers (just get) to efficiently access the necessary data.
    ApiRequestPathInfo parsedPath = requestPathParser.parseEndpoint(request.path(), wrapMultiMap(request.headers()));
    apimanRequest.setApiOrgId(parsedPath.orgId);
    apimanRequest.setApiId(parsedPath.apiId);
    apimanRequest.setApiVersion(parsedPath.apiVersion);
    apimanRequest.setUrl(request.absoluteURI());
    apimanRequest.setDestination(parsedPath.resource);
}
 
开发者ID:apiman,项目名称:apiman,代码行数:11,代码来源:HttpApiFactory.java

示例3: createApiRequest

import io.apiman.gateway.engine.beans.ApiRequest; //导入方法依赖的package包/类
/**
 * @return an API request
 */
public ApiRequest createApiRequest() {
    ApiRequest request = new ApiRequest();
    request.setApiOrgId(orgId);
    request.setApiId(apiId);
    request.setApiVersion(String.valueOf(version));
    request.setTransportSecure(true);
    return request;
}
 
开发者ID:apiman,项目名称:apiman,代码行数:12,代码来源:PolicyTester.java


注:本文中的io.apiman.gateway.engine.beans.ApiRequest.setApiId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。