javax.servlet.sip.URI.getParameter()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(109)

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

URI.getParameter介绍

[英]Returns the value of the named parameter, or null if it is not set. A zero-length String indicates flag parameter.
[中]返回命名参数的值,如果未设置,则返回null。长度为零的字符串表示标志参数。

代码示例

代码示例来源:origin: org.mobicents.servlet.sip.containers/sip-servlets-catalina

public Map<String, String> getParameterMap() {
    // JSR 289 Section 5.6.1 Parameters :
    // For initial requests where a preloaded Route header specified the application to be invoked, the parameters are those of the SIP or SIPS URI in that Route header.
    // For initial requests where the application is invoked the parameters are those present on the request URI, 
    // if this is a SIP or a SIPS URI. For other URI schemes, the parameter set is undefined.
    // For subsequent requests in a dialog, the parameters presented to the application  are those that the application itself 
    // set on the Record-Route header for the initial request or response (see 10.4 Record-Route Parameters). 
    // These will typically be the URI parameters of the top Route header field but if the upstream SIP element is a 
    // "strict router" they may be returned in the request URI (see RFC 3261). 
    // It is the containers responsibility to recognize whether the upstream element is a strict router and determine the right parameter set accordingly.
    HashMap<String, String> retval = new HashMap<String, String>();
    if(this.getPoppedRoute() != null) {
      Iterator<String> parameterNamesIt =  this.getPoppedRoute().getURI().getParameterNames();
      while (parameterNamesIt.hasNext()) {
        String parameterName = parameterNamesIt.next();
        retval.put(parameterName, this.getPoppedRoute().getURI().getParameter(parameterName));			
      }
    } else {
      Iterator<String> parameterNamesIt =  this.getRequestURI().getParameterNames();
      while (parameterNamesIt.hasNext()) {
        String parameterName = parameterNamesIt.next();
        retval.put(parameterName, this.getRequestURI().getParameter(parameterName));			
      }
    }        
    
    return retval;
  }
}

代码示例来源:origin: org.mobicents.servlet.sip/sip-servlets-impl

public String getParameter(String name) {
  // JSR 289 Section 5.6.1 Parameters :
  // For initial requests where a preloaded Route header specified the application to be invoked, the parameters are those of the SIP or SIPS URI in that Route header.
  // For initial requests where the application is invoked the parameters are those present on the request URI, 
  // if this is a SIP or a SIPS URI. For other URI schemes, the parameter set is undefined.
  // For subsequent requests in a dialog, the parameters presented to the application  are those that the application itself 
  // set on the Record-Route header for the initial request or response (see 10.4 Record-Route Parameters). 
  // These will typically be the URI parameters of the top Route header field but if the upstream SIP element is a 
  // "strict router" they may be returned in the request URI (see RFC 3261). 
  // It is the containers responsibility to recognize whether the upstream element is a strict router and determine the right parameter set accordingly.
  if(this.getPoppedRoute() != null) {
    return this.getPoppedRoute().getURI().getParameter(name);
  } else {
    return this.getRequestURI().getParameter(name);
  }
}

代码示例来源:origin: org.mobicents.servlet.sip.containers/sip-servlets-as7

public Map<String, String[]> getParameterMap() {
  // JSR 289 Section 5.6.1 Parameters :
  // For initial requests where a preloaded Route header specified the application to be invoked, the parameters are those of the SIP or SIPS URI in that Route header.
  // For initial requests where the application is invoked the parameters are those present on the request URI, 
  // if this is a SIP or a SIPS URI. For other URI schemes, the parameter set is undefined.
  // For subsequent requests in a dialog, the parameters presented to the application  are those that the application itself 
  // set on the Record-Route header for the initial request or response (see 10.4 Record-Route Parameters). 
  // These will typically be the URI parameters of the top Route header field but if the upstream SIP element is a 
  // "strict router" they may be returned in the request URI (see RFC 3261). 
  // It is the containers responsibility to recognize whether the upstream element is a strict router and determine the right parameter set accordingly.
  HashMap<String, String[]> retval = new HashMap<String, String[]>();
  if(this.getPoppedRoute() != null) {
    Iterator<String> parameterNamesIt =  this.getPoppedRoute().getURI().getParameterNames();
    while (parameterNamesIt.hasNext()) {
      String parameterName = parameterNamesIt.next();
      String [] paramsArray = {this.getPoppedRoute().getURI().getParameter(parameterName)}; //Get the parameter map value to String[]
      retval.put(parameterName, paramsArray); 
    }
  } else {
    Iterator<String> parameterNamesIt =  this.getRequestURI().getParameterNames();
    while (parameterNamesIt.hasNext()) {
      String parameterName = parameterNamesIt.next();
      String [] paramsArray = {this.getPoppedRoute().getURI().getParameter(parameterName)}; //Get the parameter map value to String[]
      retval.put(parameterName, paramsArray);
    }
  }        
  
  return retval;
}

代码示例来源:origin: org.mobicents.servlet.sip.containers/sip-servlets-as8

while (parameterNamesIt.hasNext()) {
  String parameterName = parameterNamesIt.next();
  String[] paramsArray = { this.getPoppedRoute().getURI().getParameter(parameterName) }; // Get the
while (parameterNamesIt.hasNext()) {
  String parameterName = parameterNamesIt.next();
  String[] paramsArray = { this.getPoppedRoute().getURI().getParameter(parameterName) }; // Get the

代码示例来源:origin: org.mobicents.servlet.sip.containers/sip-servlets-as10

while (parameterNamesIt.hasNext()) {
  String parameterName = parameterNamesIt.next();
  String[] paramsArray = { this.getPoppedRoute().getURI().getParameter(parameterName) }; // Get the
while (parameterNamesIt.hasNext()) {
  String parameterName = parameterNamesIt.next();
  String[] paramsArray = { this.getPoppedRoute().getURI().getParameter(parameterName) }; // Get the

相关文章