/** * parses the predicate string, and returns the result * @param predicate The prediate string * @param classLoader The class loader to load the predicates from * @return The predicate */ public static Predicate parse(final String predicate, ClassLoader classLoader) { return PredicateParser.parse(predicate, classLoader); }
/** * parses the predicate string, and returns the result, using the TCCL to load predicate definitions * @param predicate The prediate string * @return The predicate */ public static Predicate parse(final String predicate) { return PredicateParser.parse(predicate, Thread.currentThread().getContextClassLoader()); }
/** * {@inheritDoc} */ @Override public void validateParameter(String parameterName, ModelNode value) throws OperationFailedException { super.validateParameter(parameterName, value); if (value.isDefined() && value.getType() != ModelType.EXPRESSION) { String val = value.asString(); try { PredicateParser.parse(val, getClass().getClassLoader()); } catch (Exception e) { throw new OperationFailedException(UndertowLogger.ROOT_LOGGER.predicateNotValid(val, e.getMessage()), e); } } } }
/** * Creates the set of handlers that are required to perform a simple rewrite. * @param condition The rewrite condition * @param target The rewrite target if the condition matches * @param next The next handler * @return */ public static HttpHandler rewrite(final String condition, final String target, final ClassLoader classLoader, final HttpHandler next) { return predicateContext(predicate(PredicateParser.parse(condition, classLoader), setAttribute(next, "%R", target, classLoader), next)); }
if (model.hasDefined(PREDICATE.getName())) { String predicateString = model.get(PREDICATE.getName()).asString(); predicate = PredicateParser.parse(predicateString, getClass().getClassLoader());
managementAccessPredicate = PredicateParser.parse(managementAccessPredicateString, ModClusterService.class.getClassLoader());
/** * parses the predicate string, and returns the result * @param predicate The prediate string * @param classLoader The class loader to load the predicates from * @return The predicate */ public static Predicate parse(final String predicate, ClassLoader classLoader) { return PredicateParser.parse(predicate, classLoader); }
/** * parses the predicate string, and returns the result * @param predicate The prediate string * @param classLoader The class loader to load the predicates from * @return The predicate */ public static Predicate parse(final String predicate, ClassLoader classLoader) { return PredicateParser.parse(predicate, classLoader); }
/** * parses the predicate string, and returns the result, using the TCCL to load predicate definitions * @param predicate The prediate string * @return The predicate */ public static Predicate parse(final String predicate) { return PredicateParser.parse(predicate, Thread.currentThread().getContextClassLoader()); }
/** * parses the predicate string, and returns the result, using the TCCL to load predicate definitions * @param predicate The prediate string * @return The predicate */ public static Predicate parse(final String predicate) { return PredicateParser.parse(predicate, Thread.currentThread().getContextClassLoader()); }
@Override Consumer<? super Map<String, Object>> consumeConfiguration() { return u -> { Object _role = u.get("role"); Object _predicate = u.get("predicate"); if (_role == null || !(_role instanceof String)) { throw new IllegalArgumentException("wrong configuration file format. a permission entry is missing the role"); } String role = (String) _role; if (_predicate == null || !(_predicate instanceof String)) { throw new IllegalArgumentException("wrong configuration file format. a permission entry is missing the predicate"); } Predicate predicate = null; try { predicate = PredicateParser.parse((String) _predicate, this.getClass().getClassLoader()); } catch (Throwable t) { throw new IllegalArgumentException("wrong configuration file format. wrong predicate " + _predicate, t); } aclForRole(role).add(predicate); }; }
/** * {@inheritDoc} */ @Override public void validateParameter(String parameterName, ModelNode value) throws OperationFailedException { super.validateParameter(parameterName, value); if (value.isDefined() && value.getType() != ModelType.EXPRESSION) { String val = value.asString(); try { PredicateParser.parse(val, getClass().getClassLoader()); } catch (Exception e) { throw new OperationFailedException(UndertowLogger.ROOT_LOGGER.predicateNotValid(val, e.getMessage()), e); } } } }
/** * Creates the set of handlers that are required to perform a simple rewrite. * @param condition The rewrite condition * @param target The rewrite target if the condition matches * @param next The next handler * @return */ public static HttpHandler rewrite(final String condition, final String target, final ClassLoader classLoader, final HttpHandler next) { return predicateContext(predicate(PredicateParser.parse(condition, classLoader), setAttribute(next, "%R", target, classLoader), next)); }
/** * {@inheritDoc} */ @Override public void validateParameter(String parameterName, ModelNode value) throws OperationFailedException { super.validateParameter(parameterName, value); if (value.isDefined() && value.getType() != ModelType.EXPRESSION) { String val = value.asString(); try { PredicateParser.parse(val, getClass().getClassLoader()); } catch (Exception e) { throw new OperationFailedException(UndertowLogger.ROOT_LOGGER.predicateNotValid(val, e.getMessage()), e); } } } }
/** * Creates the set of handlers that are required to perform a simple rewrite. * @param condition The rewrite condition * @param target The rewrite target if the condition matches * @param next The next handler * @return */ public static HttpHandler rewrite(final String condition, final String target, final ClassLoader classLoader, final HttpHandler next) { return predicateContext(predicate(PredicateParser.parse(condition, classLoader), setAttribute(next, "%R", target, classLoader), next)); }
if (model.hasDefined(PREDICATE.getName())) { String predicateString = model.get(PREDICATE.getName()).asString(); predicate = PredicateParser.parse(predicateString, getClass().getClassLoader());
if (model.hasDefined(PREDICATE.getName())) { String predicateString = model.get(PREDICATE.getName()).asString(); predicate = PredicateParser.parse(predicateString, getClass().getClassLoader());
managementAccessPredicate = PredicateParser.parse(managementAccessPredicateString, ModClusterService.class.getClassLoader());
managementAccessPredicate = PredicateParser.parse(managementAccessPredicateString, ModClusterService.class.getClassLoader());