org.springframework.integration.x.ip.serializer
Class AbstractHttpSwitchingDeserializer
java.lang.Object
org.springframework.integration.x.ip.serializer.AbstractHttpSwitchingDeserializer
- All Implemented Interfaces:
- org.springframework.core.serializer.Deserializer<DataFrame>, StatefulDeserializer<DataFrame>
- Direct Known Subclasses:
- WebSocketSerializer
public abstract class AbstractHttpSwitchingDeserializer
- extends java.lang.Object
- implements StatefulDeserializer<DataFrame>
Base class for (de)Serializers that start with an HTTP-like protocol then
switch to some other protocol.
- Since:
- 3.0
- Author:
- Gary Russell
|
Field Summary |
protected org.springframework.integration.ip.tcp.serializer.ByteArrayCrLfSerializer |
crlfDeserializer
|
protected org.apache.commons.logging.Log |
logger
|
protected int |
maxMessageSize
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
protected final org.apache.commons.logging.Log logger
maxMessageSize
protected volatile int maxMessageSize
crlfDeserializer
protected final org.springframework.integration.ip.tcp.serializer.ByteArrayCrLfSerializer crlfDeserializer
AbstractHttpSwitchingDeserializer
public AbstractHttpSwitchingDeserializer()
setMaxMessageSize
public void setMaxMessageSize(int maxMessageSize)
getCrlfDeserializer
protected org.springframework.integration.ip.tcp.serializer.ByteArrayCrLfSerializer getCrlfDeserializer()
deserialize
public abstract DataFrame deserialize(java.io.InputStream inputStream)
throws java.io.IOException
- Specified by:
deserialize in interface org.springframework.core.serializer.Deserializer<DataFrame>
- Throws:
java.io.IOException
getStreamState
protected AbstractHttpSwitchingDeserializer.BasicState getStreamState(java.io.InputStream inputStream)
checkStreaming
protected java.util.List<DataFrame> checkStreaming(java.io.InputStream inputStream)
throws java.io.IOException
- Returns null if we've switched from HTTP-like protocol; headers otherwise.
- Parameters:
inputStream -
- Returns:
- null or list of DataFrame, where the first frame contains the headers.
Implementations may add additional frames.
- Throws:
java.io.IOException
createState
protected AbstractHttpSwitchingDeserializer.BasicState createState()
checkClosure
protected void checkClosure(int bite)
throws java.io.IOException
- Throws:
java.io.IOException
decodeHeaders
protected java.util.List<DataFrame> decodeHeaders(java.lang.String frameData,
AbstractHttpSwitchingDeserializer.BasicState state,
java.util.List<DataFrame> dataList)
createDataFrame
protected DataFrame createDataFrame(int type,
java.lang.String frameData)
removeState
public void removeState(java.lang.Object key)
- Specified by:
removeState in interface StatefulDeserializer<DataFrame>
getState
public AbstractHttpSwitchingDeserializer.BasicState getState(java.lang.Object key)