类 RSocketFrameTypeMessageCondition
- java.lang.Object
- org.springframework.messaging.handler.AbstractMessageCondition<RSocketFrameTypeMessageCondition>
- org.springframework.messaging.rsocket.annotation.support.RSocketFrameTypeMessageCondition
public class RSocketFrameTypeMessageCondition extends AbstractMessageCondition<RSocketFrameTypeMessageCondition>
A condition to assist with mapping onto handler methods based on the RSocket frame type. This helps to separate the handling of connection-level frame types, i.e.SETUP
andMETADATA_PUSH
, from the handling of stream requests.- 从以下版本开始:
- 5.2
- 作者:
- Rossen Stoyanchev
字段概要
字段 修饰符和类型 字段 说明 static RSocketFrameTypeMessageCondition
CONNECT_CONDITION
Match connection-level frames "SETUP" or "METADATA_PUSH".static RSocketFrameTypeMessageCondition
EMPTY_CONDITION
Empty condition that does not match to any RSocket frames (e.g. for type-level mappings)static String
FRAME_TYPE_HEADER
The name of the header that contains the RSocket frame type being processed.static RSocketFrameTypeMessageCondition
REQUEST_CHANNEL_CONDITION
Match RSocket frame "REQUEST_CHANNEL".static RSocketFrameTypeMessageCondition
REQUEST_CONDITION
已过时。as of 5.2.2 because matching to all interaction types is too flexible.static RSocketFrameTypeMessageCondition
REQUEST_FNF_OR_RESPONSE_CONDITION
Match RSocket frames "REQUEST_FNF" or "REQUEST_RESPONSE".static RSocketFrameTypeMessageCondition
REQUEST_RESPONSE_CONDITION
Match RSocket frame "REQUEST_RESPONSE".static RSocketFrameTypeMessageCondition
REQUEST_STREAM_CONDITION
Match RSocket frame "REQUEST_STREAM".
构造器概要
构造器 构造器 说明 RSocketFrameTypeMessageCondition(io.rsocket.frame.FrameType... frameType)
RSocketFrameTypeMessageCondition(Collection<io.rsocket.frame.FrameType> frameTypes)
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 RSocketFrameTypeMessageCondition
combine(RSocketFrameTypeMessageCondition other)
Define the rules for combining this condition with another.int
compareTo(RSocketFrameTypeMessageCondition other, Message<?> message)
Compare this condition to another in the context of a specific message.static RSocketFrameTypeMessageCondition
getCondition(int cardinalityIn, int cardinalityOut)
Return a condition for matching the RSocket request interaction type with that is selected based on the delcared request and response cardinality of some handler method.protected Collection<?>
getContent()
Return the collection of objects the message condition is composed of (e.g. destination patterns), nevernull
.static io.rsocket.frame.FrameType
getFrameType(Message<?> message)
Find the RSocket frame type in the message headers.Set<io.rsocket.frame.FrameType>
getFrameTypes()
RSocketFrameTypeMessageCondition
getMatchingCondition(Message<?> message)
Check if this condition matches the given Message and returns a potentially new condition with content tailored to the current message.protected String
getToStringInfix()
The notation to use when printing discrete items of content.从类继承的方法 org.springframework.messaging.handler.AbstractMessageCondition
equals, hashCode, toString
字段详细资料
FRAME_TYPE_HEADER
public static final String FRAME_TYPE_HEADER
The name of the header that contains the RSocket frame type being processed.- 另请参阅:
- 常量字段值
CONNECT_CONDITION
public static final RSocketFrameTypeMessageCondition CONNECT_CONDITION
Match connection-level frames "SETUP" or "METADATA_PUSH".
REQUEST_FNF_OR_RESPONSE_CONDITION
public static final RSocketFrameTypeMessageCondition REQUEST_FNF_OR_RESPONSE_CONDITION
Match RSocket frames "REQUEST_FNF" or "REQUEST_RESPONSE".
REQUEST_RESPONSE_CONDITION
public static final RSocketFrameTypeMessageCondition REQUEST_RESPONSE_CONDITION
Match RSocket frame "REQUEST_RESPONSE".
REQUEST_STREAM_CONDITION
public static final RSocketFrameTypeMessageCondition REQUEST_STREAM_CONDITION
Match RSocket frame "REQUEST_STREAM".
REQUEST_CHANNEL_CONDITION
public static final RSocketFrameTypeMessageCondition REQUEST_CHANNEL_CONDITION
Match RSocket frame "REQUEST_CHANNEL".
EMPTY_CONDITION
public static final RSocketFrameTypeMessageCondition EMPTY_CONDITION
Empty condition that does not match to any RSocket frames (e.g. for type-level mappings)
REQUEST_CONDITION
@Deprecated public static final RSocketFrameTypeMessageCondition REQUEST_CONDITION
已过时。as of 5.2.2 because matching to all interaction types is too flexible. Please use one of the other constants in this class that match to specific frames.Condition to match "REQUEST_FNF", "REQUEST_RESPONSE", "REQUEST_STREAM", and "REQUEST_CHANNEL".
构造器详细资料
RSocketFrameTypeMessageCondition
public RSocketFrameTypeMessageCondition(io.rsocket.frame.FrameType... frameType)
RSocketFrameTypeMessageCondition
public RSocketFrameTypeMessageCondition(Collection<io.rsocket.frame.FrameType> frameTypes)
方法详细资料
getFrameTypes
public Set<io.rsocket.frame.FrameType> getFrameTypes()
getContent
protected Collection<?> getContent()
从类复制的说明:AbstractMessageCondition
Return the collection of objects the message condition is composed of (e.g. destination patterns), nevernull
.
getToStringInfix
protected String getToStringInfix()
从类复制的说明:AbstractMessageCondition
The notation to use when printing discrete items of content. For example " || " for URL patterns or " && " for param expressions.
getFrameType
@Nullable public static io.rsocket.frame.FrameType getFrameType(Message<?> message)
Find the RSocket frame type in the message headers.- 参数:
message
- the current message- 返回:
- the frame type or
null
if not found
combine
public RSocketFrameTypeMessageCondition combine(RSocketFrameTypeMessageCondition other)
从接口复制的说明:MessageCondition
Define the rules for combining this condition with another. For example combining type- and method-level conditions.- 参数:
other
- the condition to combine with- 返回:
- the resulting message condition
getMatchingCondition
public RSocketFrameTypeMessageCondition getMatchingCondition(Message<?> message)
从接口复制的说明:MessageCondition
Check if this condition matches the given Message and returns a potentially new condition with content tailored to the current message. For example a condition with destination patterns might return a new condition with sorted, matching patterns only.- 返回:
- a condition instance in case of a match; or
null
if there is no match.
compareTo
public int compareTo(RSocketFrameTypeMessageCondition other, Message<?> message)
从接口复制的说明:MessageCondition
Compare this condition to another in the context of a specific message. It is assumed both instances have been obtained viaMessageCondition.getMatchingCondition(Message)
to ensure they have content relevant to current message only.
getCondition
public static RSocketFrameTypeMessageCondition getCondition(int cardinalityIn, int cardinalityOut)
Return a condition for matching the RSocket request interaction type with that is selected based on the delcared request and response cardinality of some handler method.The table below shows the selections made:
Request Cardinality Response Cardinality Interaction Types 0,1 0 Fire-And-Forget, Request-Response 0,1 1 Request-Response 0,1 2 Request-Stream 2 Any Request-Channel - 参数:
cardinalityIn
- -- the request cardinality: 1 for a single payload, 2 for many payloads, and 0 if input is not handled.cardinalityOut
- -- the response cardinality: 0 for no output payloads, 1 for a single payload, and 2 for many payloads.- 返回:
- a condition to use for matching the interaction type
- 从以下版本开始:
- 5.2.2