Package de.otto.synapse.endpoint
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.-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionMessageInterceptorRegistration(Pattern channelNamePattern, MessageInterceptor interceptor, Set<EndpointType> enabledEndpointTypes, int order) -
Method Summary
Modifier and TypeMethodDescriptionallChannelsWith(MessageInterceptor interceptor) Creates a MessageInterceptorRegistration that is used to register aMessageInterceptorin all channels, at thesender-sideas well as at thereceiver-side.allChannelsWith(MessageInterceptor interceptor, int order) Creates a MessageInterceptorRegistration that is used to register aMessageInterceptorin all channels, at thesender-sideas well as at thereceiver-side.booleanReturns theMessageInterceptorof the registration.intgetOrder()inthashCode()booleanisEnabledFor(String channelNamePattern, EndpointType endpointType) Returnstrueif the registration is matching the givenchannelNameandEndpointType, false otherwise.matchingChannelsWith(String channelNamePattern, MessageInterceptor interceptor) Creates a MessageInterceptorRegistration that is used to register aMessageInterceptorin all channels with names matching thechannelNamePattern, at thesender-sideas well as at thereceiver-side.matchingChannelsWith(String channelNamePattern, MessageInterceptor interceptor, int order) Creates a MessageInterceptorRegistration that is used to register aMessageInterceptorin all channels with names matching thechannelNamePattern, at thesender-sideas well as at thereceiver-side.matchingReceiverChannelsWith(String channelNamePattern, MessageInterceptor interceptor) Creates a MessageInterceptorRegistration that is used to register aMessageInterceptorat thereceiver-sideof all channels with names matching thechannelNamePattern.matchingReceiverChannelsWith(String channelNamePattern, MessageInterceptor interceptor, int order) Creates a MessageInterceptorRegistration that is used to register aMessageInterceptorat thereceiver-sideof all channels with names matching thechannelNamePattern.matchingSenderChannelsWith(String channelNamePattern, MessageInterceptor interceptor) Creates a MessageInterceptorRegistration that is used to register aMessageInterceptorat thesender-sideof all channels with names matching thechannelNamePattern.matchingSenderChannelsWith(String channelNamePattern, MessageInterceptor interceptor, int order) Creates a MessageInterceptorRegistration that is used to register aMessageInterceptorat thesender-sideof all channels with names matching thechannelNamePattern.receiverChannelsWith(MessageInterceptor interceptor) Creates a MessageInterceptorRegistration that is used to register aMessageInterceptorat thereceiver-sideof all channels.receiverChannelsWith(MessageInterceptor interceptor, int order) Creates a MessageInterceptorRegistration that is used to register aMessageInterceptorat thereceiver-sideof all channels.senderChannelsWith(MessageInterceptor interceptor) Creates a MessageInterceptorRegistration that is used to register aMessageInterceptorat thesender-sideof all channels.senderChannelsWith(MessageInterceptor interceptor, int order) Creates a MessageInterceptorRegistration that is used to register aMessageInterceptorat thesender-sideof all channels.toString()
-
Constructor Details
-
MessageInterceptorRegistration
public MessageInterceptorRegistration(Pattern channelNamePattern, MessageInterceptor interceptor, Set<EndpointType> enabledEndpointTypes, int order)
-
-
Method Details
-
allChannelsWith
public static MessageInterceptorRegistration allChannelsWith(@Nonnull MessageInterceptor interceptor) Creates a MessageInterceptorRegistration that is used to register aMessageInterceptorin all channels, at thesender-sideas well as at thereceiver-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 aMessageInterceptorin all channels, at thesender-sideas well as at thereceiver-side.- Parameters:
interceptor- the MessageInterceptor used to intercept messagesorder- theorderof 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 aMessageInterceptorin all channels with names matching thechannelNamePattern, at thesender-sideas well as at thereceiver-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 aMessageInterceptorin all channels with names matching thechannelNamePattern, at thesender-sideas well as at thereceiver-side.- Parameters:
channelNamePattern- the regexp used to match channel names. Only channels with matching names will be intercepted.interceptor- the MessageInterceptor used to intercept messagesorder- theorderof 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 aMessageInterceptorat thereceiver-sideof 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 aMessageInterceptorat thereceiver-sideof all channels.- Parameters:
interceptor- the MessageInterceptor used to intercept messagesorder- theorderof 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 aMessageInterceptorat thereceiver-sideof all channels with names matching thechannelNamePattern.- 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 aMessageInterceptorat thereceiver-sideof all channels with names matching thechannelNamePattern.- Parameters:
channelNamePattern- the regexp used to match channel names. Only channels with matching names will be intercepted.interceptor- the MessageInterceptor used to intercept messagesorder- theorderof 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 aMessageInterceptorat thesender-sideof 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 aMessageInterceptorat thesender-sideof all channels.- Parameters:
interceptor- the MessageInterceptor used to intercept messagesorder- theorderof 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 aMessageInterceptorat thesender-sideof all channels with names matching thechannelNamePattern.- 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 aMessageInterceptorat thesender-sideof all channels with names matching thechannelNamePattern.- Parameters:
channelNamePattern- the regexp used to match channel names. Only channels with matching names will be intercepted.interceptor- the MessageInterceptor used to intercept messagesorder- theorderof the interceptor. Highest precedence interceptors (lowest order value) will be executed last.- Returns:
- MessageInterceptorRegistration
-
getInterceptor
Returns theMessageInterceptorof the registration.- Returns:
- MessageInterceptor
-
isEnabledFor
Returnstrueif the registration is matching the givenchannelNameandEndpointType, false otherwise.- Parameters:
channelNamePattern- the regexp used to match channel namesendpointType- theEndpointTypeof the channel- Returns:
- boolean
-
getOrder
public int getOrder()- Specified by:
getOrderin interfaceorg.springframework.core.Ordered
-
equals
-
hashCode
public int hashCode() -
toString
-