@Override public boolean submitValue(Parameter<?> parameter, String value) { ParameterValueStore valueStore = DefaultParameterValueStore.getInstance(context); String existingValue = valueStore.retrieve(parameter); if (existingValue == null) { return valueStore.submit(event, context, parameter, value); } else { return valueStore.isValid(event, context, parameter, value); } }
@Override public boolean submitValue(Parameter<?> parameter, String value) { ParameterValueStore valueStore = DefaultParameterValueStore.getInstance(context); return valueStore.submit(event, context, parameter, value); }
private boolean handleBindings(final Rewrite event, final EvaluationContextImpl context, ParameterValueStore values) { boolean result = true; ParameterStore store = (ParameterStore) context.get(ParameterStore.class); for (Entry<String, Parameter<?>> entry : store) { Parameter<?> parameter = entry.getValue(); String value = values.retrieve(parameter); if (!ParameterUtils.enqueueSubmission(event, context, parameter, value)) { result = false; break; } } return result; }
@Override public boolean isValid(Rewrite event, EvaluationContext context) { if (matches()) { ParameterStore store = DefaultParameterStore.getInstance(context); int index = 1; for (RegexGroup group : groups) { String value = matcher.group(index++); Parameter<?> param = store.get(group.getName()); ParameterValueStore valueStore = DefaultParameterValueStore.getInstance(context); if (!valueStore.isValid(event, context, param, value)) { return false; } } return true; } return false; }
@Override public boolean submitValue(Parameter<?> parameter, String value) { ParameterValueStore valueStore = DefaultParameterValueStore.getInstance(context); return valueStore.submit(event, context, parameter, value); }
private boolean handleBindings(final Rewrite event, final EvaluationContextImpl context, ParameterValueStore values) { boolean result = true; ParameterStore store = (ParameterStore) context.get(ParameterStore.class); for (Entry<String, Parameter<?>> entry : store) { Parameter<?> parameter = entry.getValue(); String value = values.retrieve(parameter); if (!ParameterUtils.enqueueSubmission(event, context, parameter, value)) { result = false; break; } } return result; }
@Override public boolean isValid(Rewrite event, EvaluationContext context) { if (matches()) { ParameterStore store = DefaultParameterStore.getInstance(context); int index = 1; for (RegexGroup group : groups) { String value = matcher.group(index++); Parameter<?> param = store.get(group.getName()); ParameterValueStore valueStore = DefaultParameterValueStore.getInstance(context); if (!valueStore.isValid(event, context, param, value)) { return false; } } return true; } return false; }
@Override public boolean submitValue(Parameter<?> parameter, String value) { ParameterValueStore valueStore = DefaultParameterValueStore.getInstance(context); String existingValue = valueStore.retrieve(parameter); if (existingValue == null) { return valueStore.submit(event, context, parameter, value); } else { return valueStore.isValid(event, context, parameter, value); } }
@Override public boolean evaluate(GraphRewrite event, EvaluationContext context) { ParameterStore store = (ParameterStore) context.get(ParameterStore.class); ParameterValueStore values = (ParameterValueStore) context.get(ParameterValueStore.class); boolean result = values.submit(event, context, store.get(name), value); return result; }
private boolean handleBindings(final Rewrite event, final EvaluationContextImpl context, ParameterValueStore valueStore) { boolean result = true; ParameterStore store = (ParameterStore) context.get(ParameterStore.class); for (Entry<String, Parameter<?>> entry : store) { Parameter<?> parameter = entry.getValue(); String values = valueStore.retrieve(parameter); if (!ParameterUtils.enqueueSubmission(event, context, parameter, values)) { result = false; break; } } return result; }
@Override public boolean evaluate(GraphRewrite event, EvaluationContext context) { ParameterStore store = (ParameterStore) context.get(ParameterStore.class); ParameterValueStore values = (ParameterValueStore) context.get(ParameterValueStore.class); boolean result = values.submit(event, context, store.get(name), value); return result; }
private boolean handleBindings(final Rewrite event, final EvaluationContextImpl context, ParameterValueStore valueStore) { boolean result = true; ParameterStore store = (ParameterStore) context.get(ParameterStore.class); for (Entry<String, Parameter<?>> entry : store) { Parameter<?> parameter = entry.getValue(); String values = valueStore.retrieve(parameter); if (!ParameterUtils.enqueueSubmission(event, context, parameter, values)) { result = false; break; } } return result; }
@Override public boolean evaluate(GraphRewrite event, EvaluationContext context) { ParameterStore store = (ParameterStore) context.get(ParameterStore.class); ParameterValueStore values = (ParameterValueStore) context.get(ParameterValueStore.class); boolean result = values.submit(event, context, store.get(name), value); return result; }
/** * Retrieve a single parameter value from the {@link ParameterValueStore}. */ public static String retrieve(EvaluationContext context, String string) { return ((ParameterValueStore) context.get(ParameterValueStore.class)).retrieve(((ParameterStore) context .get(ParameterStore.class)).get(string)); } }
@Override public boolean submit(Rewrite event, EvaluationContext context) { if (matches()) { ParameterStore store = DefaultParameterStore.getInstance(context); int index = 1; for (RegexGroup group : groups) { String value = matcher.group(index++); Parameter<?> param = store.get(group.getName()); ParameterValueStore valueStore = DefaultParameterValueStore.getInstance(context); if (!valueStore.submit(event, context, param, value)) { return false; } } return true; } return false; }
/** * Retrieve a single parameter value from the {@link ParameterValueStore}. */ public static String retrieve(EvaluationContext context, String string) { return ((ParameterValueStore) context.get(ParameterValueStore.class)).retrieve(((ParameterStore) context .get(ParameterStore.class)).get(string)); } }
@Override public boolean submit(Rewrite event, EvaluationContext context) { if (matches()) { ParameterStore store = DefaultParameterStore.getInstance(context); int index = 1; for (RegexGroup group : groups) { String value = matcher.group(index++); Parameter<?> param = store.get(group.getName()); ParameterValueStore valueStore = DefaultParameterValueStore.getInstance(context); if (!valueStore.submit(event, context, param, value)) { return false; } } return true; } return false; }
@Override public final void perform(GraphRewrite event, EvaluationContext context, T payload) { Map<WindupVertexFrame, ParameterValueStore> stores = ParameterizedGraphCondition .getResultValueStoreMap(context); ParameterValueStore originalValueStore = DefaultParameterValueStore.getInstance(context); ParameterStore parameterStore = DefaultParameterStore.getInstance(context); try { DefaultEvaluationContext tempEvaluationContext = new DefaultEvaluationContext(context); tempEvaluationContext.setState(RewriteState.PERFORMING); ParameterValueStore valueStore = stores.get(originalPayload); for (Entry<String, Parameter<?>> entry : parameterStore) { Parameter<?> parameter = entry.getValue(); String value = valueStore == null ? null : valueStore.retrieve(parameter); ParameterUtils.enqueueSubmission(event, tempEvaluationContext, parameter, value); } context.put(ParameterValueStore.class, valueStore); performParameterized(event, tempEvaluationContext, payload); } finally { context.put(ParameterValueStore.class, originalValueStore); } } }
@Override public boolean evaluateHttp(final HttpServletRewrite event, final EvaluationContext context) { String queryString = null; if (event instanceof InboundRewrite) { queryString = event.getInboundAddress().getQuery(); } else if (event instanceof HttpOutboundServletRewrite) { queryString = ((HttpOutboundServletRewrite) event).getOutboundAddress().getQuery(); } if (pattern.parse(queryString == null ? "" : queryString).submit(event, context)) { ParameterValueStore values = (ParameterValueStore) context.get(ParameterValueStore.class); for (Entry<Parameter<?>, String> entry : pattern.parse(query).getParameters(context).entrySet()) { values.submit(event, context, store.get(entry.getKey().getName()), entry.getValue()); } return true; } return false; }
@Override public final void perform(GraphRewrite event, EvaluationContext context, T payload) { Map<WindupVertexFrame, ParameterValueStore> stores = ParameterizedGraphCondition .getResultValueStoreMap(context); ParameterValueStore originalValueStore = DefaultParameterValueStore.getInstance(context); ParameterStore parameterStore = DefaultParameterStore.getInstance(context); try { DefaultEvaluationContext tempEvaluationContext = new DefaultEvaluationContext(context); tempEvaluationContext.setState(RewriteState.PERFORMING); ParameterValueStore valueStore = stores.get(originalPayload); for (Entry<String, Parameter<?>> entry : parameterStore) { Parameter<?> parameter = entry.getValue(); String value = valueStore == null ? null : valueStore.retrieve(parameter); ParameterUtils.enqueueSubmission(event, tempEvaluationContext, parameter, value); } context.put(ParameterValueStore.class, valueStore); performParameterized(event, tempEvaluationContext, payload); } finally { context.put(ParameterValueStore.class, originalValueStore); } } }