Package org.serviceconnector.net.res
Class ResponseAdapter
java.lang.Object
org.serviceconnector.net.res.ResponseAdapter
- All Implemented Interfaces:
IResponse
- Direct Known Subclasses:
NettyHttpResponse,NettyTcpResponse
The Class ResponseAdapter. Provides basic functionality for responses.
- Author:
- JTraber
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected io.netty.channel.ChannelThe event from Netty framework.protected IEncoderDecoderThe encoder decoder.protected SCMPMessageThe scmp. -
Constructor Summary
ConstructorsConstructorDescriptionResponseAdapter(io.netty.channel.Channel channel) Instantiates a new response adapter. -
Method Summary
Modifier and TypeMethodDescriptionio.netty.buffer.ByteBufGets the buffer.getSCMP()Gets the scmp.booleanisLarge()Checks if is response content is large.voidsetSCMP(SCMPMessage scmp) Sets the scmp.abstract voidwrite()Write the response.
-
Field Details
-
encoderDecoder
The encoder decoder. -
scmp
The scmp. -
channel
protected io.netty.channel.Channel channelThe event from Netty framework.
-
-
Constructor Details
-
ResponseAdapter
public ResponseAdapter(io.netty.channel.Channel channel) Instantiates a new response adapter.- Parameters:
channel- the event
-
-
Method Details
-
write
Write the response. -
getBuffer
Gets the buffer. Encodes the scmp.- Returns:
- the buffer
- Throws:
Exception- the exception
-
setSCMP
Sets the scmp. -
getSCMP
Gets the scmp. -
isLarge
public boolean isLarge()Checks if is response content is large.
-