/** * Adds a caching directive to an AMQP 1.0 message. * <p> * The directive is put to the message's <em>application-properties</em> under key * {@link #APP_PROPERTY_CACHE_CONTROL}. * * @param msg The message to add the directive to. * @param cacheDirective The cache directive. * @throws NullPointerException if any of the parameters are {@code null}. */ public static void addCacheDirective(final Message msg, final CacheDirective cacheDirective) { addProperty(msg, APP_PROPERTY_CACHE_CONTROL, cacheDirective.toString()); }
/** * Adds a caching directive to an AMQP 1.0 message. * <p> * The directive is put to the message's <em>application-properties</em> under key * {@link #APP_PROPERTY_CACHE_CONTROL}. * * @param msg The message to add the directive to. * @param cacheDirective The cache directive. * @throws NullPointerException if any of the parameters are {@code null}. */ public static void addCacheDirective(final Message msg, final CacheDirective cacheDirective) { addProperty(msg, APP_PROPERTY_CACHE_CONTROL, cacheDirective.toString()); }
/** * Adds a property for the cache directive. * <p> * The property will only be added if the value is not {@code null}. * * @param directive The cache directive. * @return This message for chaining. */ public EventBusMessage setCacheDirective(final CacheDirective directive) { if (directive != null) { setProperty( MessageHelper.APP_PROPERTY_CACHE_CONTROL, Objects.requireNonNull(directive).toString()); } return this; }
/** * Adds a property for the cache directive. * <p> * The property will only be added if the value is not {@code null}. * * @param directive The cache directive. * @return This message for chaining. */ public EventBusMessage setCacheDirective(final CacheDirective directive) { if (directive != null) { setProperty( MessageHelper.APP_PROPERTY_CACHE_CONTROL, Objects.requireNonNull(directive).toString()); } return this; }