public ExtendedAccessLogParser(ClassLoader classLoader) { this.parser = ExchangeAttributes.parser(classLoader, QuotingExchangeAttribute.WRAPPER); }
public RedirectHandler(final String location, final ClassLoader classLoader) { ExchangeAttributeParser parser = ExchangeAttributes.parser(classLoader); attribute = parser.parse(location); }
public RedirectHandler(final String location) { ExchangeAttributeParser parser = ExchangeAttributes.parser(getClass().getClassLoader()); attribute = parser.parse(location); }
/** * 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; }
public SetAttributeHandler(HttpHandler next, final String attribute, final String value, boolean preCommit) { this.next = next; this.preCommit = preCommit; ExchangeAttributeParser parser = ExchangeAttributes.parser(getClass().getClassLoader()); this.attribute = parser.parseSingleToken(attribute); this.value = parser.parse(value); }
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; }
/** * Creates a predicate that matches the given attribute against a regex. * @param requireFullMatch If a full match is required in order to return true. * @param attribute The attribute to check against. * @param pattern The pattern to look for. */ public static Predicate regex(final String attribute, final String pattern, final ClassLoader classLoader, final boolean requireFullMatch) { return new RegularExpressionPredicate(pattern, ExchangeAttributes.parser(classLoader).parse(attribute), requireFullMatch); }
public SetAttributeHandler(HttpHandler next, final String attribute, final String value, final ClassLoader classLoader) { this.next = next; ExchangeAttributeParser parser = ExchangeAttributes.parser(classLoader); this.attribute = parser.parseSingleToken(attribute); this.value = parser.parse(value); this.preCommit = false; }
public SetAttributeHandler(HttpHandler next, final String attribute, final String value, final ClassLoader classLoader, boolean preCommit) { this.next = next; this.preCommit = preCommit; ExchangeAttributeParser parser = ExchangeAttributes.parser(classLoader); this.attribute = parser.parseSingleToken(attribute); this.value = parser.parse(value); }
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)); } }
public AccessLogHandler(final HttpHandler next, final AccessLogReceiver accessLogReceiver, final String formatString, ClassLoader classLoader, Predicate predicate) { this.next = next; this.accessLogReceiver = accessLogReceiver; this.predicate = predicate; this.formatString = handleCommonNames(formatString); this.tokens = ExchangeAttributes.parser(classLoader, new SubstituteEmptyWrapper("-")).parse(this.formatString); }
public static HandlerWrapper parseHandler(String string, ClassLoader classLoader) { Deque<Token> tokens = tokenize(string); Node node = parse(string, tokens); Map<String, HandlerBuilder> handlerBuilders = loadHandlerBuilders(classLoader); final ExchangeAttributeParser attributeParser = ExchangeAttributes.parser(classLoader); return handleHandlerNode(string, (ExpressionNode)node, handlerBuilders, attributeParser); } private static List<PredicatedHandler> handleNode(String contents, Node node, Map<String, PredicateBuilder> predicateBuilders, Map<String, HandlerBuilder> handlerBuilders, ExchangeAttributeParser attributeParser) {
public static Predicate parsePredicate(String string, ClassLoader classLoader) { Deque<Token> tokens = tokenize(string); Node node = parse(string, tokens); Map<String, PredicateBuilder> predicateBuilders = loadPredicateBuilders(classLoader); final ExchangeAttributeParser attributeParser = ExchangeAttributes.parser(classLoader); return handlePredicateNode(string, node, predicateBuilders, attributeParser); }
public static List<PredicatedHandler> parse(final String contents, final ClassLoader classLoader) { Deque<Token> tokens = tokenize(contents); Node node = parse(contents, tokens); Map<String, PredicateBuilder> predicateBuilders = loadPredicateBuilders(classLoader); Map<String, HandlerBuilder> handlerBuilders = loadHandlerBuilders(classLoader); final ExchangeAttributeParser attributeParser = ExchangeAttributes.parser(classLoader); return handleNode(contents, node, predicateBuilders, handlerBuilders, attributeParser); }
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; }
public SetAttributeHandler(HttpHandler next, final String attribute, final String value, boolean preCommit) { this.next = next; this.preCommit = preCommit; ExchangeAttributeParser parser = ExchangeAttributes.parser(getClass().getClassLoader()); this.attribute = parser.parseSingleToken(attribute); this.value = parser.parse(value); }
public SetAttributeHandler(HttpHandler next, final String attribute, final String value, final ClassLoader classLoader, boolean preCommit) { this.next = next; this.preCommit = preCommit; ExchangeAttributeParser parser = ExchangeAttributes.parser(classLoader); this.attribute = parser.parseSingleToken(attribute); this.value = parser.parse(value); }
/** * Creates a predicate that matches the given attribute against a regex. * @param requireFullMatch If a full match is required in order to return true. * @param attribute The attribute to check against. * @param pattern The pattern to look for. */ public static Predicate regex(final String attribute, final String pattern, final ClassLoader classLoader, final boolean requireFullMatch) { return new RegularExpressionPredicate(pattern, ExchangeAttributes.parser(classLoader).parse(attribute), requireFullMatch); }
public static Predicate parsePredicate(String string, ClassLoader classLoader) { Deque<Token> tokens = tokenize(string); Node node = parse(string, tokens); Map<String, PredicateBuilder> predicateBuilders = loadPredicateBuilders(classLoader); final ExchangeAttributeParser attributeParser = ExchangeAttributes.parser(classLoader); return handlePredicateNode(string, node, predicateBuilders, attributeParser); }
public static HandlerWrapper parseHandler(String string, ClassLoader classLoader) { Deque<Token> tokens = tokenize(string); Node node = parse(string, tokens); Map<String, HandlerBuilder> handlerBuilders = loadHandlerBuilders(classLoader); final ExchangeAttributeParser attributeParser = ExchangeAttributes.parser(classLoader); return handleHandlerNode(string, (ExpressionNode)node, handlerBuilders, attributeParser); } private static List<PredicatedHandler> handleNode(String contents, Node node, Map<String, PredicateBuilder> predicateBuilders, Map<String, HandlerBuilder> handlerBuilders, ExchangeAttributeParser attributeParser) {