本文整理了Java中org.wso2.msf4j.Request.getProperties
方法的一些代码示例,展示了Request.getProperties
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.getProperties
方法的具体详情如下:
包路径:org.wso2.msf4j.Request
类名称:Request
方法名:getProperties
暂无
代码示例来源:origin: wso2/msf4j
@Override
default boolean interceptRequest(Request request, Response response) throws Exception {
Method method = (Method) request.getProperty(MSF4JConstants.METHOD_PROPERTY_NAME);
ServiceMethodInfo serviceMethodInfo = new ServiceMethodInfo(method.getName(), method, request);
request.getProperties().forEach(serviceMethodInfo::setAttribute);
return preCall(request, response, serviceMethodInfo);
}
代码示例来源:origin: org.wso2.msf4j/msf4j-core
@Override
default boolean interceptRequest(Request request, Response response) throws Exception {
Method method = (Method) request.getProperty(MSF4JConstants.METHOD_PROPERTY_NAME);
ServiceMethodInfo serviceMethodInfo = new ServiceMethodInfo(method.getName(), method, request);
request.getProperties().forEach(serviceMethodInfo::setAttribute);
return preCall(request, response, serviceMethodInfo);
}
代码示例来源:origin: org.wso2.carbon.apimgt/org.wso2.carbon.apimgt.rest.api.webserver
String hostName = String.valueOf(request.getProperties().get("HOST"));
String port = String.valueOf(request.getProperties().get("LISTENER_PORT"));
String protocol = String.valueOf(request.getProperties().get("PROTOCOL"));
String absURL = protocol + "://" + hostName + ":" + port + rawUri;
String path;
代码示例来源:origin: org.wso2.carbon.analytics/org.wso2.carbon.business.rules.core
private Role getUserRole(Request request) {
PermissionProvider permissionProvider = DataHolder.getInstance().getPermissionProvider();
String userName = request.getProperties().get(USER_NAME).toString();
if (permissionProvider.hasPermission(userName, managerPermission)) {
return Role.MANAGER;
}
return Role.VIEWER;
}
代码示例来源:origin: wso2/msf4j
@Override
default boolean interceptResponse(Request request, Response response) throws Exception {
Method method = (Method) request.getProperty(MSF4JConstants.METHOD_PROPERTY_NAME);
ServiceMethodInfo serviceMethodInfo = new ServiceMethodInfo(method.getName(), method, request);
request.getProperties().forEach(serviceMethodInfo::setAttribute);
postCall(request, response.getStatusCode(), serviceMethodInfo);
return true;
}
代码示例来源:origin: org.wso2.msf4j/msf4j-core
@Override
default boolean interceptResponse(Request request, Response response) throws Exception {
Method method = (Method) request.getProperty(MSF4JConstants.METHOD_PROPERTY_NAME);
ServiceMethodInfo serviceMethodInfo = new ServiceMethodInfo(method.getName(), method, request);
request.getProperties().forEach(serviceMethodInfo::setAttribute);
postCall(request, response.getStatusCode(), serviceMethodInfo);
return true;
}
代码示例来源:origin: org.wso2.carbon.analytics/org.wso2.carbon.business.rules.core
private boolean hasPermission(Request request, RequestMethod method) {
PermissionProvider permissionProvider = DataHolder.getInstance().getPermissionProvider();
String userName = request.getProperties().get("username").toString();
if (permissionProvider.hasPermission(userName, managerPermission)) {
return true;
} else if (permissionProvider.hasPermission(userName, viewerPermission)) {
switch (method) {
case GET_BUSINESS_RULES:
case LOAD_BUSINESS_RULE:
case GET_RULE_TEMPLATES:
case GET_RULE_TEMPLATE:
case GET_TEMPLATE_GROUP:
return true;
}
}
return false;
}
}
代码示例来源:origin: org.wso2.carbon.identity.gateway/org.wso2.carbon.identity.gateway.api
/**
* Update GatewayRequestBuilder.
*
* @param builder Builder.
* @param request MS4J request
* @throws GatewayClientException GatewayClientException
*/
protected void create(T builder, Request request)
throws GatewayClientException {
request.getHeaders().getAll().forEach(header -> {
builder.addHeader(header.getName(), header.getValue());
});
builder.setMethod(request.getHttpMethod());
builder.setContentType(request.getContentType());
builder.setRequestURI(request.getUri());
builder.setMethod(request.getHttpMethod());
builder.setAttributes((Map) request.getProperties());
builder.addParameter(Constants.QUERY_PARAMETERS,
(Serializable) request.getProperty(Constants.QUERY_PARAMETERS));
builder.addParameter(Constants.BODY_PARAMETERS, (Serializable) request.getProperty(Constants.BODY_PARAMETERS));
String[] queryStringParams = request.getUri().split("\\?");
if (queryStringParams.length > 1) {
builder.setQueryString(queryStringParams[1]);
} else {
builder.setQueryString(queryStringParams[0]);
}
if (logger.isDebugEnabled()) {
logger.debug("Successfully Updated the request builder in GatewayRequestBuilderFactory.");
}
}
内容来源于网络,如有侵权,请联系作者删除!