get detail of your stream by app name and stream name

@param request The request object containing all parameters for query app stream.
@return the response
439706
public GetAppStreamResponse queryAppStream(GetAppStreamRequest request) {
        checkNotNull(request, "The parameter request should NOT be null.");
        checkStringNotEmpty(request.getApp(), "The parameter app should NOT be null or empty string.");
        checkStringNotEmpty(request.getStream(), "The parameter stream should NOT be null or empty string.");
        InternalRequest internalRequest = createRequest(HttpMethodName.GET, request, LIVE_APP,
                request.getApp(), LIVE_SESSION, request.getStream());
        return invokeHttpClient(internalRequest, GetAppStreamResponse.class);
    }
6447
protected static String getSourceParameter(final HttpServletRequest request, final String... paramNames) {
        if (request != null) {
            val parameterMap = request.getParameterMap();
            return Stream.of(paramNames)
                .filter(p -> parameterMap.containsKey(p) || request.getAttribute(p) != null)
                .findFirst()
                .orElse(null);
        }
        return null;
    }
1041913
public static String getRequestURI(final HttpServletRequest request) {
		return (String) request.getSession(true).getAttribute(STORE_URI_KEY);
	}
960932
public GetAppStreamResponse queryAppStream(String app, String stream) {
        GetAppStreamRequest request = new GetAppStreamRequest();
        request.setApp(app);
        request.setStream(stream);
        return queryAppStream(request);
    }
469603
@SuppressWarnings("unchecked")
	static public Map<String, Object> getParameters(ServletRequest request){
    	Map<String, Object> params = (Map<String, Object>) request.getAttribute(TEMPLATE_PARAMETER_MAP);
    	if (params == null){							// no need to check thread-safe?
    		params = new HashMap<String, Object>();
    		request.setAttribute(TEMPLATE_PARAMETER_MAP, params);
    	}
    	return params;
    }
594315
protected String getChannelName(final HttpServletRequest request) {
        final String path = request.getPathInfo();
        return path == null ? "" : path.startsWith("/") ? path.substring(1) : path;
    }
592739
public GetStatUvResponse getStatUv(GetStatUvRequest request) {
        InternalRequest internalRequest = this.createRequest(request, HttpMethodName.GET, STAT, "uv");
        
        if (request.getStartTime() != null) {
            internalRequest.addParameter("startTime", DateUtils.formatAlternateIso8601Date(request.getStartTime()));
        }
        
        if (request.getEndTime() != null) {
            internalRequest.addParameter("endTime", DateUtils.formatAlternateIso8601Date(request.getEndTime()));
        }
        
        if (request.getDomain() != null) {
            internalRequest.addParameter("domain", request.getDomain());
        }
        
        if (request.getPeriod() != null) {
            internalRequest.addParameter("period", String.valueOf(request.getPeriod()));
        }
        
        return this.invokeHttpClient(internalRequest, GetStatUvResponse.class);
    }
329820
private String getRequestURI(final HttpServletRequest request) {
        String ret = (String) request.getAttribute(Keys.HttpRequest.REQUEST_URI);
        if (StringUtils.isBlank(ret)) {
            ret = request.getRequestURI();
        }

        return ret;
    }
819054
public static String readBody(HttpServletRequest request) {

        BufferedReader input = null;
        try {
            input = new BufferedReader(new InputStreamReader(request.getInputStream()));
            StringBuilder builder = new StringBuilder();
            String buffer;
            while ((buffer = input.readLine()) != null) {
                if (builder.length() > 0) {
                    builder.append("\n");
                }
                builder.append(buffer);
            }
            return builder.toString();
        } catch (IOException e) {
            log.info("http io exception : " + e.getMessage());
        }
        return null;
    }
695234
public static String getRequestBody(HttpServletRequest request) {
		if(request.getMethod().equals("GET") || request.getMethod().equals("DELETE")) {
			return null;
		}
		
		StringBuilder stringBuilder = new StringBuilder();
		BufferedReader bufferedReader = null;
		try {
			InputStream inputStream = request.getInputStream();
			if (inputStream != null) {
				bufferedReader = new BufferedReader(new InputStreamReader(
						inputStream));
				char[] charBuffer = new char[128];
				int bytesRead = -1;
				while ((bytesRead = bufferedReader.read(charBuffer)) > 0) {
					stringBuilder.append(charBuffer, 0, bytesRead);
				}
			} else {
				stringBuilder.append("");
			}
		} catch (IOException ex) {
			// to nothing
		} finally {
			if (bufferedReader != null) {
				try {
					bufferedReader.close();
				} catch (IOException ex) {

				}
			}
		}

		if (!StringUtils.isEmpty(stringBuilder)) {
			return stringBuilder.toString();
		}

		if (request.getParameterMap().keySet().size() > 0) {
			return request.getParameterMap().keySet().toArray()[0].toString();
		}

        return null;
	}
445357
public void updateStreamPresets(UpdateStreamPresetsRequest request) {
        checkNotNull(request, "The parameter request should NOT be null.");

        checkStringNotEmpty(request.getDomain(), "Domain should NOT be empty.");
        checkStringNotEmpty(request.getApp(), "App should NOT be empty");
        checkStringNotEmpty(request.getStream(), "Stream should NOT be empty.");
        // presets can be null for letting stream to use domain's presets,
        // so no need to check if presets is null

        InternalRequest internalRequest = createRequest(HttpMethodName.POST, request, LIVE_DOMAIN,
                request.getDomain(), LIVE_APP, request.getApp(), LIVE_STREAM, request.getStream());
        internalRequest.addParameter("presets", null);
        invokeHttpClient(internalRequest, AbstractBceResponse.class);
    }
60650
public static Map<String, String[]> getParams(ServletRequest request) {
		final Map<String, String[]> map = request.getParameterMap();
		return Collections.unmodifiableMap(map);
	}
354640
public PauseAppStreamResponse pauseAppStream(PauseAppStreamRequest request) {
        checkNotNull(request, "The parameter request should NOT be null.");
        checkStringNotEmpty(request.getApp(), "The parameter app should NOT be null or empty string.");
        checkStringNotEmpty(request.getStream(), "The parameter stream should NOT be null or empty string.");
        InternalRequest internalRequest = createRequest(HttpMethodName.PUT, request, LIVE_APP,
                request.getApp(), LIVE_SESSION, request.getStream());
        internalRequest.addParameter(PAUSE, null);
        return invokeHttpClient(internalRequest, PauseAppStreamResponse.class);
    }
359833
public Response api(Request request) throws IOException {
    Request req = new Request();
    req.setMethod(request.getMethod());
    req.setBaseUri(this.host);
    req.setEndpoint("/" + version + "/" + request.getEndpoint());
    req.setBody(request.getBody());
    for (Map.Entry<String, String> header : this.requestHeaders.entrySet()) {
      req.addHeader(header.getKey(), header.getValue());
    }
    for (Map.Entry<String, String> queryParam : request.getQueryParams().entrySet()) {
      req.addQueryParam(queryParam.getKey(), queryParam.getValue());
    }

    return makeCall(req);
  }
789277
protected String buildQueryString(Request request)
    {
        MultiMap resolvedParameters = null;
        if(parameterFactory != null)
        {
            resolvedParameters = parameterFactory.getParameters();
        }

        if(hasEntries(resolvedParameters))
            resolvedParameters = resolvedParameters.merge(request.getParameters());
        else
            resolvedParameters = request.getParameters();

        if(authorizationFactory != null)
        {
            MultiMap authEntries = authorizationFactory.getParameters();
            if(hasEntries(authEntries))
                resolvedParameters = resolvedParameters.merge(authEntries);
        }


        int ct = 0;
        StringBuilder sb = new StringBuilder(512);
        for (Map.Entry<String, List<String>> entry : resolvedParameters.entries())
        {
            for (String value : entry.getValue())
            {
                if(ct++ > 0)
                    sb.append("&");
                sb.append(encode(entry.getKey())).append("=").append(encode(value));
            }
        }

        return sb.toString();
    }
995152
public static String getFullRequestUrl(HttpServletRequest request) {
        StringBuilder buff = new StringBuilder(
                request.getRequestURL().toString());
        String queryString = request.getQueryString();
        if (queryString != null) {
            buff.append("?").append(queryString);
        }

        return buff.toString();
    }
1349977
public static RequestInfo getRequestInfo(HttpServletRequest request) {
      RequestInfo requestInfo = (RequestInfo) request.getAttribute(REQUEST_INFO);
      if (requestInfo == null) {
         requestInfo = new RequestInfo(request);
         request.setAttribute(REQUEST_INFO, requestInfo);
      }
      
      return requestInfo;
   }