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 java.lang.Object
implements org.springframework.core.Ordered
Information about the channels that should be intercepted by a
MessageInterceptor.-
Field Summary
-
Constructor Summary
Constructors Constructor Description MessageInterceptorRegistration(java.util.regex.Pattern channelNamePattern, MessageInterceptor interceptor, java.util.Set<EndpointType> enabledEndpointTypes, int order) -
Method Summary
Modifier and Type Method Description static MessageInterceptorRegistrationallChannelsWith(MessageInterceptor interceptor)Creates a MessageInterceptorRegistration that is used to register aMessageInterceptorin all channels, at thesender-sideas well as at thereceiver-side.static MessageInterceptorRegistrationallChannelsWith(MessageInterceptor interceptor, int order)Creates a MessageInterceptorRegistration that is used to register aMessageInterceptorin all channels, at thesender-sideas well as at thereceiver-side.booleanequals(java.lang.Object o)MessageInterceptorgetInterceptor()Returns theMessageInterceptorof the registration.intgetOrder()inthashCode()booleanisEnabledFor(java.lang.String channelNamePattern, EndpointType endpointType)Returnstrueif the registration is matching the givenchannelNameandEndpointType, false otherwise.static MessageInterceptorRegistrationmatchingChannelsWith(java.lang.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.static MessageInterceptorRegistrationmatchingChannelsWith(java.lang.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.static MessageInterceptorRegistrationmatchingReceiverChannelsWith(java.lang.String channelNamePattern, MessageInterceptor interceptor)Creates a MessageInterceptorRegistration that is used to register aMessageInterceptorat thereceiver-sideof all channels with names matching thechannelNamePattern.static MessageInterceptorRegistrationmatchingReceiverChannelsWith(java.lang.String channelNamePattern, MessageInterceptor interceptor, int order)Creates a MessageInterceptorRegistration that is used to register aMessageInterceptorat thereceiver-sideof all channels with names matching thechannelNamePattern.static MessageInterceptorRegistrationmatchingSenderChannelsWith(java.lang.String channelNamePattern, MessageInterceptor interceptor)Creates a MessageInterceptorRegistration that is used to register aMessageInterceptorat thesender-sideof all channels with names matching thechannelNamePattern.static MessageInterceptorRegistrationmatchingSenderChannelsWith(java.lang.String channelNamePattern, MessageInterceptor interceptor, int order)Creates a MessageInterceptorRegistration that is used to register aMessageInterceptorat thesender-sideof all channels with names matching thechannelNamePattern.static MessageInterceptorRegistrationreceiverChannelsWith(MessageInterceptor interceptor)Creates a MessageInterceptorRegistration that is used to register aMessageInterceptorat thereceiver-sideof all channels.static MessageInterceptorRegistrationreceiverChannelsWith(MessageInterceptor interceptor, int order)Creates a MessageInterceptorRegistration that is used to register aMessageInterceptorat thereceiver-sideof all channels.static MessageInterceptorRegistrationsenderChannelsWith(MessageInterceptor interceptor)Creates a MessageInterceptorRegistration that is used to register aMessageInterceptorat thesender-sideof all channels.static MessageInterceptorRegistrationsenderChannelsWith(MessageInterceptor interceptor, int order)Creates a MessageInterceptorRegistration that is used to register aMessageInterceptorat thesender-sideof all channels.java.lang.StringtoString()
-
Constructor Details
-
MessageInterceptorRegistration
public MessageInterceptorRegistration(java.util.regex.Pattern channelNamePattern, MessageInterceptor interceptor, java.util.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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
public boolean equals(java.lang.Object o)- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-