use of ddf.catalog.event.impl.SubscriptionImpl in project ddf by codice.
the class DummyPreSubscriptionPlugin method process.
public Subscription process(Subscription input) throws PluginExecutionException {
String methodName = "process";
LOGGER.trace(ENTERING, methodName);
Subscription newSubscription = input;
if (input != null) {
FilterDelegate<Filter> delegate = new CopyFilterDelegate(filterBuilder);
try {
// Make a defensive copy of the original filter (just in case anyone else expects
// it to remain unmodified)
Filter copiedFilter = filterAdapter.adapt(input, delegate);
// Define the extra query clause(s) to add to the copied filter
Filter extraFilter = filterBuilder.attribute(Metacard.ANY_TEXT).like().text("CAN");
// AND the extra query clause(s) to the copied filter
Filter modifiedFilter = filterBuilder.allOf(copiedFilter, extraFilter);
// Create a new subscription with the modified filter
newSubscription = new SubscriptionImpl(modifiedFilter, input.getDeliveryMethod(), input.getSourceIds(), input.isEnterprise());
} catch (UnsupportedQueryException e) {
throw new PluginExecutionException(e);
}
}
LOGGER.trace(EXITING, methodName);
return newSubscription;
}
Aggregations