This method is called to select the appropriate logic for this request URI.

@return The logic to be used in generating the response or null if no logic could be
matched.
501720
protected Logic resolveLogic (String path)
    {
        // look for a cached logic instance
        String lclass = _app.generateClass(path);
        Logic logic = _logic.get(lclass);

        if (logic == null) {
            logic = instantiateLogic(path, lclass);

            // if something failed, use a dummy in it's place so that we don't sit around all day
            // freaking out about our inability to instantiate the proper logic class
            if (logic == null) {
                logic = new DummyLogic();
            }

            // cache the resolved logic instance
            _logic.put(lclass, logic);
        }

        return logic;
    }
803918
public String getRequestURI() {
    if ((message == null) || (((Request) message).getRequestURI() == null)) {
      return "";
    }

    return ((Request) message).getRequestURI().toString();
  }
920890
private boolean responseIsInValid() {
        if (response == null) {
            return true;
        }
        else if (!response.isHeadless() && validityCheck) {
            return request.getTransactionID() != response.getTransactionID();
        }
        else {
            return false;
        }
    }
1139276
public QueryResult<T> first() {
        if (response != null && response.size() > 0) {
            return response.get(0);
        }
        return null;
    }
493471
public UriComponentsBuilder uri(URI uri) {
		Assert.notNull(uri, "'uri' must not be null");
		this.scheme = uri.getScheme();
		if (uri.isOpaque()) {
			this.ssp = uri.getRawSchemeSpecificPart();
			resetHierarchicalComponents();
		}
		else {
			if (uri.getRawUserInfo() != null) {
				this.userInfo = uri.getRawUserInfo();
			}
			if (uri.getHost() != null) {
				this.host = uri.getHost();
			}
			if (uri.getPort() != -1) {
				this.port = String.valueOf(uri.getPort());
			}
			if (StringUtils.hasLength(uri.getRawPath())) {
				this.pathBuilder = new CompositePathComponentBuilder(uri.getRawPath());
			}
			if (StringUtils.hasLength(uri.getRawQuery())) {
				this.queryParams.clear();
				query(uri.getRawQuery());
			}
			resetSchemeSpecificPart();
		}
		if (uri.getRawFragment() != null) {
			this.fragment = uri.getRawFragment();
		}
		return this;
	}
1328043
public static <T> Predicate<T> notNull() {
        return new Predicate<T>() {
            @Override
            public boolean test(T testValue) {
                return testValue != null;
            }
        };
    }
102963
public static String getRequestURI(HttpServletRequest httpRequest) {
        final StringBuilder url = new StringBuilder(100).append(httpRequest.getRequestURI());
        if (httpRequest.getQueryString() != null) {
            url.append('?').append(httpRequest.getQueryString());
        }

        return url.toString();
    }
893093
@Restricted(DoNotUse.class)
    public static String getFrom() {
        String from = null, returnValue = null;
        final StaplerRequest request = Stapler.getCurrentRequest();

        // Try to obtain a return point either from the Session
        // or from the QueryParameter in this order
        if (request != null
                && request.getSession(false) != null) {
            from = (String) request.getSession().getAttribute("from");
        } else if (request != null) {
            from = request.getParameter("from");
        }

        // If entry point was not found, try to deduce it from the request URI
        // except pages related to login process
        if (from == null
                && request != null
                && request.getRequestURI() != null
                && !request.getRequestURI().equals("/loginError")
                && !request.getRequestURI().equals("/login")) {

                from = request.getRequestURI();
        }

        // If deduced entry point isn't deduced yet or the content is a blank value
        // use the root web point "/" as a fallback
        from = StringUtils.defaultIfBlank(from, "/").trim();
        
        // Encode the return value
        try {
            returnValue = java.net.URLEncoder.encode(from, "UTF-8");
        } catch (UnsupportedEncodingException e) { }

        // Return encoded value or at least "/" in the case exception occurred during encode()
        // or if the encoded content is blank value
        return StringUtils.isBlank(returnValue) ? "/" : returnValue;
    }
1366439
protected Object getNewSelection(final Request request) {
		String paramValue = request.getParameter(getId());

		if (paramValue == null) {
			return null;
		}

		// Figure out which option has been selected.
		List<?> options = getOptions();

		if (options == null || options.isEmpty()) {
			if (!isEditable()) {
				// User could not have made a selection.
				return null;
			}

			options = Collections.EMPTY_LIST;
		}

		int optionIndex = 0;

		for (Object option : options) {
			if (option instanceof OptionGroup) {
				List<?> groupOptions = ((OptionGroup) option).getOptions();
				if (groupOptions != null) {
					for (Object nestedOption : groupOptions) {
						if (paramValue.equals(optionToCode(nestedOption, optionIndex++))) {
							return nestedOption;
						}
					}
				}
			} else if (paramValue.equals(optionToCode(option, optionIndex++))) {
				return option;
			}
		}

		// Option not found, but if editable, user entered text
		if (isEditable()) {
			return paramValue;
		}

		// Invalid option. Ignore and use the current selection
		LOG.warn(
				"Option \"" + paramValue + "\" on the request is not a valid option. Will be ignored.");
		Object currentOption = getValue();
		return currentOption;
	}
1086443
public boolean isSipURI() {
    if ((message == null) || (((Request) message).getRequestURI() == null)) {
      return false;
    }

    return ((Request) message).getRequestURI().isSipURI();
  }
842219
protected String resolveResponseEncoding() {
        String encoding = getRequestRule().getEncoding();
        if (encoding == null) {
            encoding = resolveRequestEncoding();
        }
        return encoding;
    }
690359
public java.lang.String getOnselect() {
        return (java.lang.String) getStateHelper().eval(PropertyKeys.onselect);

    }
129667
public String getRequestInfo()
	{
		final String method = request.getMethod();
		final String uri = request.getRequestURI();
		final String qs = request.getQueryString();

		if (StringUtils.isEmpty(qs))
			return method + " " + uri;
		else
			return method + " " + uri + "?" + qs;
	}
25310
public E get(String uri) {
		
		if(map==empty)
			return null;
		
		synchronized (map) {
			return map.get(uri);
		}
	}
233051
public URI getLocation() {
        if (locationURI == null) {
            locationURI = moduleRef != null ? moduleRef.getLocation() : null;
            if (locationURI == null) {
                locationURI = classpathElement.getURI();
            }
        }
        return locationURI;
    }
336341
public URI getURI() {
		final javax.sip.address.URI localUri = getAddress().getURI();
		if (localUri instanceof javax.sip.address.SipURI)
			return new SipURIImpl((javax.sip.address.SipURI) localUri, isModifiable);
		else if (localUri instanceof javax.sip.address.TelURL)
			return new TelURLImpl((javax.sip.address.TelURL) localUri);
		else if (localUri instanceof javax.sip.address.URI) {			
			URI uri = new GenericURIImpl((javax.sip.address.URI) localUri);
			// setting the value to make sure jain sip runs scheme validation on it
			((Parameterable)uri).setValue(localUri.toString());
			return uri;
		}
		else		
			throw new IllegalArgumentException("unsupported operation - unknown scheme");
	}
436764
private boolean checkAndRespond(Request request) {
        if (!URIBean.checkUri(request.getUrl())) {
            ServerResponseBean responseBean = new ServerResponseBean();
            responseBean.setMsgId(request.getMsgId());
            responseBean.setHttpContentType(HttpContentType.APPLICATION_JSON);
            responseBean.setResponseBody(UnitResponse.createError(Group.CODE_BAD_REQUEST, null, String.format("URI %s is illegal.", request.getUrl()))
                    .toVoJSONString());
            IServerResponder.singleton.response(responseBean);
            return false;
        }
        return true;
    }