Creates a map from the session attributes in the specified request.

@param request the request
161517
public static Map<String, Object> createSessionMap(HttpServletRequest request) {
        Map<String, Object> sessionMap = new HashMap<>();
        HttpSession session = request.getSession(false);

        if (session != null) {
            for (Enumeration attributeNameEnum = session.getAttributeNames(); attributeNameEnum.hasMoreElements(); ) {
                String attributeName = (String)attributeNameEnum.nextElement();
                sessionMap.put(attributeName, session.getAttribute(attributeName));
            }
        }

        return sessionMap;
    }
971920
private void addPostParams(final Request request) {
        if (body != null) {
            request.addPostParam("Body", body);
        }

        if (attributes != null) {
            request.addPostParam("Attributes", attributes);
        }
    }
594729
private void addQueryParams(final Request request) {
        if (startDate != null) {
            request.addQueryParam("StartDate", DateConverter.dateStringFromLocalDate(startDate));
        }

        if (endDate != null) {
            request.addQueryParam("EndDate", DateConverter.dateStringFromLocalDate(endDate));
        }

        if (identity != null) {
            for (String prop : identity) {
                request.addQueryParam("Identity", prop);
            }
        }

        if (tag != null) {
            for (String prop : tag) {
                request.addQueryParam("Tag", prop);
            }
        }

        if (getPageSize() != null) {
            request.addQueryParam("PageSize", Integer.toString(getPageSize()));
        }
    }
317669
public static <T> MultivaluedMap<String, String> getBodyAsMultiValuedMap(Request<T> request) {
		MultivaluedMap<String, String> map = new BodyMultivaluedMap();

		Class<?> referenceClazz = request.getClass();
		List<Field> fields = ClassUtil.getAnnotatedFields(referenceClazz, Body.class);
		for (Field field : fields) {
			Body body = field.getAnnotation(Body.class);
			String parameter = body.value();

			// in case the value() is null or empty
			if (parameter == null || (parameter != null && parameter.isEmpty())) {
				parameter = field.getName();
			}
			String value = ClassUtil.getValueOf(field, request, referenceClazz, String.class);

			map.putSingle(parameter, value);
		}

		return map;
	}
931687
@Override
    public Collection<String> createResources(Request request)
            throws InvalidQueryException, ResourceNotFoundException, ResourceAlreadyExistsException {

        Collection<String> relativeUrls = new ArrayList<>();
        AtlasQuery atlasQuery = queryFactory.createEntityQuery(request);
        Collection<String> guids = new ArrayList<>();
        for (Map<String, Object> entityMap: atlasQuery.execute()) {
            guids.add(String.valueOf(entityMap.get("id")));
        }

        Collection<Map<String, String>> tagMaps = request.getProperty("tags");
        for (Map<String, String> tagMap : tagMaps) {
            Result termResult = getTermQueryResult(tagMap.get("name"));
            relativeUrls.addAll(tagEntities(guids, termResult.getPropertyMaps().iterator().next()));
        }
        return relativeUrls;
    }
1136210
@SuppressWarnings("unchecked")
    protected Map<IPortletWindowId, IPortletRenderExecutionWorker> getPortletRenderingMap(
            HttpServletRequest request) {
        synchronized (PortalWebUtils.getRequestAttributeMutex(request)) {
            Map<IPortletWindowId, IPortletRenderExecutionWorker> portletRenderingMap =
                    (Map<IPortletWindowId, IPortletRenderExecutionWorker>)
                            request.getAttribute(PORTLET_RENDERING_MAP);
            if (portletRenderingMap == null) {
                portletRenderingMap =
                        new ConcurrentHashMap<IPortletWindowId, IPortletRenderExecutionWorker>();
                request.setAttribute(PORTLET_RENDERING_MAP, portletRenderingMap);
            }
            return portletRenderingMap;
        }
    }
1108309
public static Map<String, Object> createHeadersMap(HttpServletRequest request) {
        Map<String, Object> headersMap = new HashMap<>();
        for (Enumeration headerNameEnum = request.getHeaderNames(); headerNameEnum.hasMoreElements(); ) {
            String headerName = (String)headerNameEnum.nextElement();
            List<String> headerValues = new ArrayList<String>();

            CollectionUtils.addAll(headerValues, request.getHeaders(headerName));

            if (headerValues.size() == 1) {
                headersMap.put(headerName, headerValues.get(0));
            } else {
                headersMap.put(headerName, headerValues.toArray(new String[headerValues.size()]));
            }
        }

        return headersMap;
    }
821017
public static Map<String, FileItem[]> getRequestFileItems(final HttpServletRequest request) {
		if (request.getAttribute(REQUEST_PROCESSED_KEY) == null) {
			setupRequestParameters(request);
		}
		return (Map<String, FileItem[]>) request.getAttribute(REQUEST_FILES_KEY);
	}
853030
@Override
	public void serviceRequest(final Request request) {
		// Get the expected session token
		UIContext uic = UIContextHolder.getCurrent();
		String expected = uic.getEnvironment().getSessionToken();

		// Get the session token from the request
		String got = request.getParameter(Environment.SESSION_TOKEN_VARIABLE);

		// Check tokens match (Both null if new session)
		// or processing a GET and no token
		if (Util.equals(expected, got) || (got == null && "GET".equals(request.getMethod()))) {
			// Process request
			getBackingComponent().serviceRequest(request);
		} else {  // Invalid token
			String msg;
			if (expected == null && got != null) {
				msg = "Session for token [" + got + "] is no longer valid or timed out.";
			} else {
				msg = "Wrong session token detected for servlet request. Expected token [" + expected
						+ "] but got token [" + got + "].";
			}
			LOG.error(msg);
			String message = I18nUtilities.format(uic.getLocale(),
					InternalMessages.DEFAULT_SESSION_TOKEN_ERROR);
			throw new SystemException(message);
		}

	}
378044
def _create_request_map(cls, input_map):
        """"""
        field_map = cls._get_attributes_map()
        return {field_map[k]: v for k, v in input_map.items() if k in field_map}
157145
public static void removeScopedSessionAttr( String attrName, HttpServletRequest request )
    {
        HttpSession session = request.getSession( false );
        
        if ( session != null )
        {
            session.removeAttribute( getScopedSessionAttrName( attrName, request ) );
        }
    }
551644
public static void registerList(final String key, final Request request) {
		request.setSessionAttribute(DATA_LIST_UIC_SESSION_KEY, UIContextHolder.getCurrentPrimaryUIContext());
	}
723013
public static Map<String, List<StringValue>> getPageParametersMap(final Request request)
	{
		final Map<String, List<StringValue>> map = new HashMap<>();
		addToParameters(request.getRequestParameters(), map);
		addToParameters(request.getQueryParameters(), map);
		addToParameters(request.getPostParameters(), map);
		return map;
	}
233217
public GetSessionStatisticsResponse getSessionStatistics(GetSessionStatisticsRequest request) {
        checkNotNull(request, "The parameter request should NOT be null.");
        checkStringNotEmpty(request.getSessionId(), "The parameter sessionId should NOT be null or empty string.");
        InternalRequest internalRequest = createRequest(HttpMethodName.GET, request, STATISTICS, LIVE_SESSION,
                request.getSessionId());
        if (request.getStartDate() != null) {
            internalRequest.addParameter("startDate", request.getStartDate());
        }
        if (request.getEndDate() != null) {
            internalRequest.addParameter("endDate", request.getEndDate());
        }
        if (request.getAggregate() != null) {
            internalRequest.addParameter("aggregate", request.getAggregate().toString());
        }
        return invokeHttpClient(internalRequest, GetSessionStatisticsResponse.class);
    }
330027
public RefreshSessionResponse refreshSession(RefreshSessionRequest request) {
        checkNotNull(request, "The parameter request should NOT be null.");
        checkStringNotEmpty(request.getSessionId(), "The parameter sessionId should NOT be null or empty string.");
        InternalRequest internalRequest = createRequest(HttpMethodName.PUT, request, LIVE_SESSION,
                request.getSessionId());
        internalRequest.addParameter(REFRESH, null);
        return invokeHttpClient(internalRequest, RefreshSessionResponse.class);
    }
1289181
public static Map<String, String[]> getParameterMap(final Request request)
	{
		final Map<String, String[]> map = new HashMap<>();
		addParameters(request.getRequestParameters(), map);
		addParameters(request.getQueryParameters(), map);
		addParameters(request.getPostParameters(), map);
		return map;
	}
775549
protected Map<String,String> convertParametersTextToMap(HTTPRequest request)
    {
        //init data structure
        Map<String,String> map=new HashMap<String,String>();

        //get parameters text
        String parametersText=request.getParametersText();
        
        if(parametersText!=null)
        {
            //split to key/value pairs (key=value)
            String[] keyValuePairs=parametersText.split("&");
            
            //get amount
            int pairsAmount=keyValuePairs.length;
            
            String keyValuePair=null;
            String[] parts=null;
            String key=null;
            String value=null;
            for(int index=0;index<pairsAmount;index++)
            {
                //get next key/value pair
                keyValuePair=keyValuePairs[index];
                
                //split to key and value
                parts=keyValuePair.split("=");
                if(parts.length==2)
                {
                    //get key
                    key=parts[0];
                    if(key.length()>0)
                    {
                        //decode key
                        key=SpiUtil.urlDecode(key);

                        //get value
                        value=parts[1].trim();

                        //decode value
                        value=SpiUtil.urlDecode(value);
                        
                        //put in data structure
                        map.put(key,value);
                    }
                }
            }
        }
        
        return map;
    }