public SubscriptionMatchingStrategy determineStrategy(String theCriteria) { SubscriptionMatchResult result = myCriteriaResourceMatcher.match(theCriteria, null, null); if (result.supported()) { return SubscriptionMatchingStrategy.IN_MEMORY; } return SubscriptionMatchingStrategy.DATABASE; } }
@Override public SubscriptionMatchResult match(CanonicalSubscription theSubscription, ResourceModifiedMessage theMsg) { SubscriptionMatchResult result; if (myDaoConfig.isEnableInMemorySubscriptionMatching()) { result = myInMemorySubscriptionMatcher.match(theSubscription, theMsg); if (result.supported()) { // TODO KHS test result.setInMemory(true); } else { ourLog.info("Criteria {} for Subscription {} not supported by InMemoryMatcher: {}. Reverting to DatabaseMatcher", theSubscription.getCriteriaString(), theSubscription.getIdElementString(), result.getUnsupportedReason()); result = myDaoSubscriptionMatcher.match(theSubscription, theMsg); } } else { result = myDaoSubscriptionMatcher.match(theSubscription, theMsg); } return result; } }
@Override public SubscriptionMatchResult match(CanonicalSubscription theSubscription, ResourceModifiedMessage theMsg) { SubscriptionMatchResult result; if (myDaoConfig.isEnableInMemorySubscriptionMatching()) { result = myInMemorySubscriptionMatcher.match(theSubscription, theMsg); if (result.supported()) { // TODO KHS test result.setInMemory(true); } else { ourLog.info("Criteria {} for Subscription {} not supported by InMemoryMatcher: {}. Reverting to DatabaseMatcher", theSubscription.getCriteriaString(), theSubscription.getIdElementString(), result.getUnsupportedReason()); result = myDaoSubscriptionMatcher.match(theSubscription, theMsg); } } else { result = myDaoSubscriptionMatcher.match(theSubscription, theMsg); } return result; } }