public ExtendedAccessLogParser(ClassLoader classLoader) { this.parser = ExchangeAttributes.parser(classLoader, QuotingExchangeAttribute.WRAPPER); }
public HttpHandler create(HttpHandler next, String expression, boolean redirect) { if(redirect) { return new RedirectHandler(expression); } else { return new SetAttributeHandler(next, ExchangeAttributes.relativePath(), ExchangeAttributes.parser(getClass().getClassLoader()).parse(expression)); } }
/** * Adds a request header to the outgoing request. If the header resolves to null or an empty string * it will not be added, however any existing header with the same name will be removed. * * @param header The header name * @param value The header value attribute. * @return this */ @Deprecated public ProxyHandler addRequestHeader(final HttpString header, final String value) { requestHeaders.put(header, ExchangeAttributes.constant(value)); return this; }
@Override public Predicate build(final Map<String, Object> config) { ExchangeAttribute match = (ExchangeAttribute) config.get("match"); if (match == null) { match = ExchangeAttributes.relativePath(); } String value = (String) config.get("value"); return new PathTemplatePredicate(value, match); } }
.remoteUser() .readAttribute(exchange); ExchangeAttributes.dateTime().readAttribute(exchange))); ExchangeAttributes.localIp().readAttribute(exchange))); ExchangeAttributes.localPort().readAttribute(exchange))); ExchangeAttributes.localServerName().readAttribute(exchange))); ExchangeAttributes.queryString().readAttribute(exchange))); ExchangeAttributes.relativePath().readAttribute(exchange))); ExchangeAttributes.remoteIp().readAttribute(exchange))); ExchangeAttributes.requestMethod().readAttribute(exchange))); ExchangeAttributes.requestProtocol().readAttribute(exchange)));
@Override public Predicate build(final Map<String, Object> config) { ExchangeAttribute value = (ExchangeAttribute) config.get("value"); if(value == null) { value = ExchangeAttributes.relativePath(); } Boolean fullMatch = (Boolean) config.get("full-match"); Boolean caseSensitive = (Boolean) config.get("case-sensitive"); String pattern = (String) config.get("pattern"); return new RegularExpressionPredicate(pattern, value, fullMatch == null ? false : fullMatch, caseSensitive == null ? true : caseSensitive); } }
public RedirectHandler(final String location) { ExchangeAttributeParser parser = ExchangeAttributes.parser(getClass().getClassLoader()); attribute = parser.parse(location); }
public HttpHandler create(HttpHandler next, String expression, boolean redirect) { if(redirect) { return new RedirectHandler(expression); } else { return new SetAttributeHandler(next, ExchangeAttributes.relativePath(), ExchangeAttributes.parser(getClass().getClassLoader()).parse(expression)); } }
@Override public HttpHandler wrap(HttpHandler handler) { return new SetAttributeHandler(handler, ExchangeAttributes.relativePath(), value); } };
public SetHeaderHandler(final String header, final String value) { if(value == null) { throw UndertowMessages.MESSAGES.argumentCannotBeNull("value"); } if(header == null) { throw UndertowMessages.MESSAGES.argumentCannotBeNull("header"); } this.next = ResponseCodeHandler.HANDLE_404; this.value = ExchangeAttributes.constant(value); this.header = new HttpString(header); }
public RedirectHandler(final String location, final ClassLoader classLoader) { ExchangeAttributeParser parser = ExchangeAttributes.parser(classLoader); attribute = parser.parse(location); }
public HttpHandler create(HttpHandler next, String expression, boolean redirect) { if(redirect) { return new RedirectHandler(expression); } else { return new SetAttributeHandler(next, ExchangeAttributes.relativePath(), ExchangeAttributes.parser(getClass().getClassLoader()).parse(expression)); } }
@Override public Predicate build(final Map<String, Object> config) { ExchangeAttribute value = (ExchangeAttribute) config.get("value"); if(value == null) { value = ExchangeAttributes.relativePath(); } Boolean fullMatch = (Boolean) config.get("full-match"); Boolean caseSensitive = (Boolean) config.get("case-sensitive"); String pattern = (String) config.get("pattern"); return new RegularExpressionPredicate(pattern, value, fullMatch == null ? false : fullMatch, caseSensitive == null ? true : caseSensitive); } }
public SetHeaderHandler(final HttpHandler next, final String header, final String value) { if(value == null) { throw UndertowMessages.MESSAGES.argumentCannotBeNull("value"); } if(header == null) { throw UndertowMessages.MESSAGES.argumentCannotBeNull("header"); } if(next == null) { throw UndertowMessages.MESSAGES.argumentCannotBeNull("next"); } this.next = next; this.value = ExchangeAttributes.constant(value); this.header = new HttpString(header); } @Override
/** * Adds a request header to the outgoing request. If the header resolves to null or an empty string * it will not be added, however any existing header with the same name will be removed. * <p> * The attribute value will be parsed, and the resulting exchange attribute will be used to create the actual header * value. * * @param header The header name * @param attribute The header value attribute. * @return this */ @Deprecated public ProxyHandler addRequestHeader(final HttpString header, final String attribute, final ClassLoader classLoader) { requestHeaders.put(header, ExchangeAttributes.parser(classLoader).parse(attribute)); return this; }
@Override public Predicate build(final Map<String, Object> config) { ExchangeAttribute match = (ExchangeAttribute) config.get("match"); if (match == null) { match = ExchangeAttributes.relativePath(); } String value = (String) config.get("value"); return new PathTemplatePredicate(value, match); } }
/** * Adds a request header to the outgoing request. If the header resolves to null or an empty string * it will not be added, however any existing header with the same name will be removed. * * @param header The header name * @param value The header value attribute. * @return this */ public ProxyHandler addRequestHeader(final HttpString header, final String value) { requestHeaders.put(header, ExchangeAttributes.constant(value)); return this; }
public SetAttributeHandler(HttpHandler next, final String attribute, final String value) { this.next = next; ExchangeAttributeParser parser = ExchangeAttributes.parser(getClass().getClassLoader()); this.attribute = parser.parseSingleToken(attribute); this.value = parser.parse(value); this.preCommit = false; }
@Override public HttpHandler wrap(HttpHandler handler) { return new SetAttributeHandler(handler, ExchangeAttributes.relativePath(), value); } };
/** * Adds a request header to the outgoing request. If the header resolves to null or an empty string * it will not be added, however any existing header with the same name will be removed. * * @param header The header name * @param value The header value attribute. * @return this */ @Deprecated public ProxyHandler addRequestHeader(final HttpString header, final String value) { requestHeaders.put(header, ExchangeAttributes.constant(value)); return this; }