本文整理汇总了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;
}
示例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);
}
示例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;
}