Class MessageInterceptorRegistration

java.lang.Object
de.otto.synapse.endpoint.MessageInterceptorRegistration
All Implemented Interfaces:
org.springframework.core.Ordered

public class MessageInterceptorRegistration extends Object implements org.springframework.core.Ordered
Information about the channels that should be intercepted by a MessageInterceptor.
  • Constructor Details

  • Method Details

    • allChannelsWith

      public static MessageInterceptorRegistration allChannelsWith(@Nonnull MessageInterceptor interceptor)
      Creates a MessageInterceptorRegistration that is used to register a MessageInterceptor in all channels, at the sender-side as well as at the receiver-side.
      Parameters:
      interceptor - the MessageInterceptor used to intercept messages
      Returns:
      MessageInterceptorRegistration
    • allChannelsWith

      public static MessageInterceptorRegistration allChannelsWith(@Nonnull MessageInterceptor interceptor, int order)
      Creates a MessageInterceptorRegistration that is used to register a MessageInterceptor in all channels, at the sender-side as well as at the receiver-side.
      Parameters:
      interceptor - the MessageInterceptor used to intercept messages
      order - the order of the interceptor. Highest precedence interceptors (lowest order value) will be executed last.
      Returns:
      MessageInterceptorRegistration
    • matchingChannelsWith

      public static MessageInterceptorRegistration matchingChannelsWith(@Nonnull String channelNamePattern, @Nonnull MessageInterceptor interceptor)
      Creates a MessageInterceptorRegistration that is used to register a MessageInterceptor in all channels with names matching the channelNamePattern, at the sender-side as well as at the receiver-side.
      Parameters:
      channelNamePattern - the regexp used to match channel names. Only channels with matching names will be intercepted.
      interceptor - the MessageInterceptor used to intercept messages
      Returns:
      MessageInterceptorRegistration
    • matchingChannelsWith

      public static MessageInterceptorRegistration matchingChannelsWith(@Nonnull String channelNamePattern, @Nonnull MessageInterceptor interceptor, int order)
      Creates a MessageInterceptorRegistration that is used to register a MessageInterceptor in all channels with names matching the channelNamePattern, at the sender-side as well as at the receiver-side.
      Parameters:
      channelNamePattern - the regexp used to match channel names. Only channels with matching names will be intercepted.
      interceptor - the MessageInterceptor used to intercept messages
      order - the order of the interceptor. Highest precedence interceptors (lowest order value) will be executed last.
      Returns:
      MessageInterceptorRegistration
    • receiverChannelsWith

      public static MessageInterceptorRegistration receiverChannelsWith(@Nonnull MessageInterceptor interceptor)
      Creates a MessageInterceptorRegistration that is used to register a MessageInterceptor at the receiver-side of all channels.
      Parameters:
      interceptor - the MessageInterceptor used to intercept messages
      Returns:
      MessageInterceptorRegistration
    • receiverChannelsWith

      public static MessageInterceptorRegistration receiverChannelsWith(@Nonnull MessageInterceptor interceptor, int order)
      Creates a MessageInterceptorRegistration that is used to register a MessageInterceptor at the receiver-side of all channels.
      Parameters:
      interceptor - the MessageInterceptor used to intercept messages
      order - the order of the interceptor. Highest precedence interceptors (lowest order value) will be executed last.
      Returns:
      MessageInterceptorRegistration
    • matchingReceiverChannelsWith

      public static MessageInterceptorRegistration matchingReceiverChannelsWith(@Nonnull String channelNamePattern, @Nonnull MessageInterceptor interceptor)
      Creates a MessageInterceptorRegistration that is used to register a MessageInterceptor at the receiver-side of all channels with names matching the channelNamePattern.
      Parameters:
      channelNamePattern - the regexp used to match channel names. Only channels with matching names will be intercepted.
      interceptor - the MessageInterceptor used to intercept messages
      Returns:
      MessageInterceptorRegistration
    • matchingReceiverChannelsWith

      public static MessageInterceptorRegistration matchingReceiverChannelsWith(@Nonnull String channelNamePattern, @Nonnull MessageInterceptor interceptor, int order)
      Creates a MessageInterceptorRegistration that is used to register a MessageInterceptor at the receiver-side of all channels with names matching the channelNamePattern.
      Parameters:
      channelNamePattern - the regexp used to match channel names. Only channels with matching names will be intercepted.
      interceptor - the MessageInterceptor used to intercept messages
      order - the order of the interceptor. Highest precedence interceptors (lowest order value) will be executed last.
      Returns:
      MessageInterceptorRegistration
    • senderChannelsWith

      public static MessageInterceptorRegistration senderChannelsWith(@Nonnull MessageInterceptor interceptor)
      Creates a MessageInterceptorRegistration that is used to register a MessageInterceptor at the sender-side of all channels.
      Parameters:
      interceptor - the MessageInterceptor used to intercept messages
      Returns:
      MessageInterceptorRegistration
    • senderChannelsWith

      public static MessageInterceptorRegistration senderChannelsWith(@Nonnull MessageInterceptor interceptor, int order)
      Creates a MessageInterceptorRegistration that is used to register a MessageInterceptor at the sender-side of all channels.
      Parameters:
      interceptor - the MessageInterceptor used to intercept messages
      order - the order of the interceptor. Highest precedence interceptors (lowest order value) will be executed last.
      Returns:
      MessageInterceptorRegistration
    • matchingSenderChannelsWith

      public static MessageInterceptorRegistration matchingSenderChannelsWith(@Nonnull String channelNamePattern, @Nonnull MessageInterceptor interceptor)
      Creates a MessageInterceptorRegistration that is used to register a MessageInterceptor at the sender-side of all channels with names matching the channelNamePattern.
      Parameters:
      channelNamePattern - the regexp used to match channel names. Only channels with matching names will be intercepted.
      interceptor - the MessageInterceptor used to intercept messages
      Returns:
      MessageInterceptorRegistration
    • matchingSenderChannelsWith

      public static MessageInterceptorRegistration matchingSenderChannelsWith(@Nonnull String channelNamePattern, @Nonnull MessageInterceptor interceptor, int order)
      Creates a MessageInterceptorRegistration that is used to register a MessageInterceptor at the sender-side of all channels with names matching the channelNamePattern.
      Parameters:
      channelNamePattern - the regexp used to match channel names. Only channels with matching names will be intercepted.
      interceptor - the MessageInterceptor used to intercept messages
      order - the order of the interceptor. Highest precedence interceptors (lowest order value) will be executed last.
      Returns:
      MessageInterceptorRegistration
    • getInterceptor

      public MessageInterceptor getInterceptor()
      Returns the MessageInterceptor of the registration.
      Returns:
      MessageInterceptor
    • isEnabledFor

      public boolean isEnabledFor(String channelNamePattern, EndpointType endpointType)
      Returns true if the registration is matching the given channelName and EndpointType, false otherwise.
      Parameters:
      channelNamePattern - the regexp used to match channel names
      endpointType - the EndpointType of the channel
      Returns:
      boolean
    • getOrder

      public int getOrder()
      Specified by:
      getOrder in interface org.springframework.core.Ordered
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object