/** * If set to <code>true</code> (default is true) the server will match incoming resources against active subscriptions * and send them to the subscription channel. If set to <code>false</code> no matching or sending occurs. * @since 3.7.0 */ public boolean isSubscriptionMatchingEnabled() { return myModelConfig.isSubscriptionMatchingEnabled(); }
@SuppressWarnings("UnusedReturnValue") private CanonicalSubscription registerSubscription(IIdType theId, IBaseResource theSubscription) { Validate.notNull(theId); String subscriptionId = theId.getIdPart(); Validate.notBlank(subscriptionId); Validate.notNull(theSubscription); CanonicalSubscription canonicalized = mySubscriptionCanonicalizer.canonicalize(theSubscription); SubscribableChannel deliveryChannel; Optional<MessageHandler> deliveryHandler; if (myModelConfig.isSubscriptionMatchingEnabled()) { deliveryChannel = mySubscriptionDeliveryChannelFactory.newDeliveryChannel(subscriptionId, canonicalized.getChannelType().toCode().toLowerCase()); deliveryHandler = mySubscriptionDeliveryHandlerFactory.createDeliveryHandler(canonicalized); } else { deliveryChannel = null; deliveryHandler = Optional.empty(); } ActiveSubscription activeSubscription = new ActiveSubscription(canonicalized, deliveryChannel); deliveryHandler.ifPresent(activeSubscription::register); myActiveSubscriptionCache.put(subscriptionId, activeSubscription); // Interceptor call: SUBSCRIPTION_AFTER_ACTIVE_SUBSCRIPTION_REGISTERED myInterceptorBroadcaster.callHooks(Pointcut.SUBSCRIPTION_AFTER_ACTIVE_SUBSCRIPTION_REGISTERED, canonicalized); return canonicalized; }
/** * If set to <code>true</code> (default is true) the server will match incoming resources against active subscriptions * and send them to the subscription channel. If set to <code>false</code> no matching or sending occurs. * @since 3.7.0 */ public boolean isSubscriptionMatchingEnabled() { return myModelConfig.isSubscriptionMatchingEnabled(); }