Package jade.imtp.leap.nio
Class NIOHTTPHelper
- java.lang.Object
-
- jade.imtp.leap.http.HTTPHelper
-
- jade.imtp.leap.nio.NIOHTTPHelper
-
- All Implemented Interfaces:
BufferTransformer
public class NIOHTTPHelper extends HTTPHelper implements BufferTransformer
- Author:
- Eduard Drenth: Logica, 22-sep-2009
-
-
Field Summary
-
Fields inherited from class jade.imtp.leap.http.HTTPHelper
RECIPIENT_ID_FIELD
-
-
Constructor Summary
Constructors Constructor Description NIOHTTPHelper(NIOJICPConnection connection)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanneedSocketData()ByteBufferpostprocessBufferRead(ByteBuffer data)implementers can transform data available read from the socket.ByteBufferpreprocessBufferToWrite(ByteBuffer dataToSend)implementers can transform the bytes before they are sent.static ByteBufferreadByteBufferFromHttp(InputStream is)-
Methods inherited from class jade.imtp.leap.http.HTTPHelper
readPacketFromHttp, readPacketFromHttp, wrapInHttp, wrapInHttp
-
-
-
-
Constructor Detail
-
NIOHTTPHelper
public NIOHTTPHelper(NIOJICPConnection connection)
-
-
Method Detail
-
readByteBufferFromHttp
public static ByteBuffer readByteBufferFromHttp(InputStream is) throws IOException
- Throws:
IOException
-
postprocessBufferRead
public ByteBuffer postprocessBufferRead(ByteBuffer data) throws IOException
Description copied from interface:BufferTransformerimplementers can transform data available read from the socket. Any data left in the socketData argument will be used in subsequentNIOJICPConnection.readPacket()calls.- Specified by:
postprocessBufferReadin interfaceBufferTransformer- Returns:
- a buffer containing the transformed data
- Throws:
IOException- will be handled by theBEManagementServiceand if applicableNIOMediator
-
preprocessBufferToWrite
public ByteBuffer preprocessBufferToWrite(ByteBuffer dataToSend) throws IOException
Description copied from interface:BufferTransformerimplementers can transform the bytes before they are sent. When data in the dataToSend argument are left a IOException will be thrown byNIOJICPConnection.writePacket(jade.imtp.leap.JICP.JICPPacket).- Specified by:
preprocessBufferToWritein interfaceBufferTransformer- Returns:
- the ByteBuffer to send
- Throws:
IOException- will be handled by theBEManagementServiceand if applicableNIOMediator
-
needSocketData
public boolean needSocketData()
-
-