org.wso2.msf4j.Request.getProperty()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(6.7k)|赞(0)|评价(0)|浏览(186)

本文整理了Java中org.wso2.msf4j.Request.getProperty方法的一些代码示例,展示了Request.getProperty的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.getProperty方法的具体详情如下:
包路径:org.wso2.msf4j.Request
类名称:Request
方法名:getProperty

Request.getProperty介绍

[英]Set a property in the underlining Carbon Message.
[中]在带下划线的碳素消息中设置属性。

代码示例

代码示例来源:origin: wso2/msf4j

  1. /**
  2. * Returns the value of the named attribute as an Object, or null if no attribute of the given name exists.
  3. *
  4. * @param name a {@link String} specifying the name of the attribute
  5. * @return an {@link Object} containing the value of the attribute, or null if the attribute does not exist
  6. */
  7. public Object getAttribute(String name) {
  8. return request.getProperty(name);
  9. }

代码示例来源:origin: org.wso2.msf4j/msf4j-core

  1. /**
  2. * Returns the value of the named attribute as an Object, or null if no attribute of the given name exists.
  3. *
  4. * @param name a {@link String} specifying the name of the attribute
  5. * @return an {@link Object} containing the value of the attribute, or null if the attribute does not exist
  6. */
  7. public Object getAttribute(String name) {
  8. return request.getProperty(name);
  9. }

代码示例来源:origin: org.wso2.carbon.uis/org.wso2.carbon.uis.core

  1. @Override
  2. public String getLocalAddress() {
  3. return (String) msf4jRequest.getProperty(PROPERTY_LOCAL_NAME);
  4. }

代码示例来源:origin: org.wso2.carbon.uiserver/org.wso2.carbon.uiserver

  1. @Override
  2. public String getProtocol() {
  3. return (String) msf4jRequest.getProperty(PROPERTY_HTTP_VERSION);
  4. }

代码示例来源:origin: org.wso2.carbon.uuf/org.wso2.carbon.uuf.httpconnector.msf4j

  1. @Override
  2. public String getProtocol() {
  3. return (String) msf4jRequest.getProperty(PROPERTY_HTTP_VERSION);
  4. }

代码示例来源:origin: org.wso2.carbon.uuf/org.wso2.carbon.uuf.httpconnector.msf4j

  1. @Override
  2. public String getRemoteAddress() {
  3. return (String) msf4jRequest.getProperty(PROPERTY_REMOTE_HOST);
  4. }

代码示例来源:origin: org.wso2.carbon.uis/org.wso2.carbon.uis.core

  1. @Override
  2. public int getRemotePort() {
  3. return (Integer) msf4jRequest.getProperty(PROPERTY_REMOTE_PORT);
  4. }

代码示例来源:origin: wso2/msf4j

  1. @Override
  2. public boolean interceptResponse(Request request, Response response) throws Exception {
  3. String propertyName = "SampleProperty";
  4. String property = (String) request.getProperty(propertyName);
  5. log.info("Value of property {} is {} ", propertyName, property);
  6. return true;
  7. }
  8. }

代码示例来源:origin: wso2/msf4j

  1. @Override
  2. public boolean interceptResponse(Request request, Response response) throws Exception {
  3. String propertyName = "SampleProperty";
  4. String property = (String) request.getProperty(propertyName);
  5. log.info("Value of property {} is {} ", propertyName, property);
  6. return true;
  7. }
  8. }

代码示例来源:origin: org.wso2.msf4j.samples/interceptor-common

  1. @Override
  2. public boolean interceptResponse(Request request, Response response) throws Exception {
  3. String propertyName = "SampleProperty";
  4. String property = (String) request.getProperty(propertyName);
  5. log.info("Value of property {} is {} ", propertyName, property);
  6. return true;
  7. }
  8. }

代码示例来源:origin: org.wso2.carbon.analytics/org.wso2.carbon.sp.jobmanager.core

  1. private static String getUserName(org.wso2.msf4j.Request request) {
  2. Object username = request.getProperty("username");
  3. return username != null ? username.toString() : null;
  4. }

代码示例来源:origin: org.wso2.carbon.analytics/org.wso2.carbon.event.simulator.core

  1. private static String getUserName(Request request) {
  2. Object username = request.getProperty("username");
  3. return username != null ? username.toString() : null;
  4. }

代码示例来源:origin: org.wso2.carbon.analytics/org.wso2.carbon.stream.processor.core

  1. private static String getUserName(Request request) {
  2. Object username = request.getProperty("username");
  3. return username != null ? username.toString() : null;
  4. }

代码示例来源:origin: org.wso2.carbon.identity.gateway/org.wso2.carbon.identity.gateway

  1. public static String getParameter(Request request, String paramName) {
  2. Map<String, String> queryParams = (Map<String, String>) request.getProperty(
  3. org.wso2.carbon.identity.gateway.common.util.Constants.QUERY_PARAMETERS);
  4. Map<String, String> bodyParams = (Map<String, String>) request.getProperty(
  5. org.wso2.carbon.identity.gateway.common.util.Constants.BODY_PARAMETERS);
  6. if (queryParams.get(paramName) != null) {
  7. return queryParams.get(paramName);
  8. } else {
  9. return bodyParams.get(paramName);
  10. }
  11. }

代码示例来源:origin: org.wso2.msf4j/msf4j-core

  1. private void setBaseUri(Request request) {
  2. StringBuilder builder = new StringBuilder();
  3. builder.append(request.getProperty(Constants.PROTOCOL).toString().toLowerCase(Locale.US)).append("://")
  4. .append(request.getHeader(HttpHeaderNames.HOST.toString()));
  5. if (builder.charAt(builder.length() - 1) != '/') {
  6. builder.append("/");
  7. }
  8. try {
  9. MSF4JResponse.setBaseUri(new URI(builder.toString()));
  10. } catch (URISyntaxException e) {
  11. log.error("Error while setting the Base URI. " + e.getMessage(), e);
  12. }
  13. }

代码示例来源:origin: wso2/msf4j

  1. private void setBaseUri(Request request) {
  2. StringBuilder builder = new StringBuilder();
  3. builder.append(request.getProperty(Constants.PROTOCOL).toString().toLowerCase(Locale.US)).append("://")
  4. .append(request.getHeader(HttpHeaderNames.HOST.toString()));
  5. if (builder.charAt(builder.length() - 1) != '/') {
  6. builder.append("/");
  7. }
  8. try {
  9. MSF4JResponse.setBaseUri(new URI(builder.toString()));
  10. } catch (URISyntaxException e) {
  11. log.error("Error while setting the Base URI. " + e.getMessage(), e);
  12. }
  13. }

代码示例来源:origin: wso2/msf4j

  1. @Override
  2. default boolean interceptRequest(Request request, Response response) throws Exception {
  3. Method method = (Method) request.getProperty(MSF4JConstants.METHOD_PROPERTY_NAME);
  4. ServiceMethodInfo serviceMethodInfo = new ServiceMethodInfo(method.getName(), method, request);
  5. request.getProperties().forEach(serviceMethodInfo::setAttribute);
  6. return preCall(request, response, serviceMethodInfo);
  7. }

代码示例来源:origin: org.wso2.msf4j/msf4j-core

  1. @Override
  2. default boolean interceptRequest(Request request, Response response) throws Exception {
  3. Method method = (Method) request.getProperty(MSF4JConstants.METHOD_PROPERTY_NAME);
  4. ServiceMethodInfo serviceMethodInfo = new ServiceMethodInfo(method.getName(), method, request);
  5. request.getProperties().forEach(serviceMethodInfo::setAttribute);
  6. return preCall(request, response, serviceMethodInfo);
  7. }

代码示例来源:origin: org.wso2.msf4j/msf4j-core

  1. @Override
  2. default boolean interceptResponse(Request request, Response response) throws Exception {
  3. Method method = (Method) request.getProperty(MSF4JConstants.METHOD_PROPERTY_NAME);
  4. ServiceMethodInfo serviceMethodInfo = new ServiceMethodInfo(method.getName(), method, request);
  5. request.getProperties().forEach(serviceMethodInfo::setAttribute);
  6. postCall(request, response.getStatusCode(), serviceMethodInfo);
  7. return true;
  8. }

代码示例来源:origin: wso2/msf4j

  1. @Override
  2. default boolean interceptResponse(Request request, Response response) throws Exception {
  3. Method method = (Method) request.getProperty(MSF4JConstants.METHOD_PROPERTY_NAME);
  4. ServiceMethodInfo serviceMethodInfo = new ServiceMethodInfo(method.getName(), method, request);
  5. request.getProperties().forEach(serviceMethodInfo::setAttribute);
  6. postCall(request, response.getStatusCode(), serviceMethodInfo);
  7. return true;
  8. }

相关文章