|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openflow.io.OFMessageAsyncStream
public class OFMessageAsyncStream
Asynchronous OpenFlow message marshalling and unmarshalling stream wrapped around an NIO SocketChannel
| Field Summary | |
|---|---|
static int |
defaultBufferSize
|
protected java.nio.ByteBuffer |
inBuf
|
protected OFMessageFactory |
messageFactory
|
protected java.nio.ByteBuffer |
outBuf
|
protected int |
partialReadCount
|
protected java.nio.channels.SocketChannel |
sock
|
| Constructor Summary | |
|---|---|
OFMessageAsyncStream(java.nio.channels.SocketChannel sock,
OFMessageFactory messageFactory)
|
|
| Method Summary | |
|---|---|
protected void |
appendMessageToOutBuf(OFMessage m)
|
void |
flush()
Flush buffered outgoing data. |
OFMessageFactory |
getMessageFactory()
Returns the OFMessageFactory used to create messages on this stream |
boolean |
needsFlush()
Is there outgoing buffered data that needs to be flush()'d? |
java.util.List<OFMessage> |
read()
Read OF messages from the stream |
java.util.List<OFMessage> |
read(int limit)
Read OF messages from the stream |
void |
setMessageFactory(OFMessageFactory messageFactory)
Sets the OFMessageFactory used to create messages on this stream |
void |
write(java.util.List<OFMessage> l)
Buffers a list of OpenFlow messages |
void |
write(OFMessage m)
Buffers a single outgoing openflow message |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static int defaultBufferSize
protected java.nio.ByteBuffer inBuf
protected java.nio.ByteBuffer outBuf
protected OFMessageFactory messageFactory
protected java.nio.channels.SocketChannel sock
protected int partialReadCount
| Constructor Detail |
|---|
public OFMessageAsyncStream(java.nio.channels.SocketChannel sock,
OFMessageFactory messageFactory)
throws java.io.IOException
java.io.IOException| Method Detail |
|---|
public java.util.List<OFMessage> read()
throws java.io.IOException
OFMessageInStream
read in interface OFMessageInStreamjava.io.IOException
public java.util.List<OFMessage> read(int limit)
throws java.io.IOException
OFMessageInStream
read in interface OFMessageInStreamlimit - The maximum number of messages to read: 0 means all that are
buffered
java.io.IOException
protected void appendMessageToOutBuf(OFMessage m)
throws java.io.IOException
java.io.IOException
public void write(OFMessage m)
throws java.io.IOException
write in interface OFMessageOutStreamm - An OF Message
java.io.IOException
public void write(java.util.List<OFMessage> l)
throws java.io.IOException
write in interface OFMessageOutStreaml - A list of OF Messages
java.io.IOException
public void flush()
throws java.io.IOException
flush in interface OFMessageOutStreamjava.io.IOExceptionpublic boolean needsFlush()
needsFlush in interface OFMessageOutStreampublic OFMessageFactory getMessageFactory()
OFMessageInStream
getMessageFactory in interface OFMessageInStreampublic void setMessageFactory(OFMessageFactory messageFactory)
OFMessageInStream
setMessageFactory in interface OFMessageInStreammessageFactory - the messageFactory to set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||