public class QueueFactory extends AbstractFactory
Queue
instances.Modifier and Type | Method and Description |
---|---|
static QueueProperty |
createProperty(QueuePropType type,
ExperimenterId eid,
byte[] data)
Creates an experimenter property.
|
static QueueProperty |
createProperty(QueuePropType type,
int rate)
Creates a rate property.
|
static QueueProperty |
createProperty(QueuePropType type,
int encId,
byte[] data)
Creates an experimenter property.
|
static MutableQueue |
createQueue(ProtocolVersion pv)
Creates a mutable queue.
|
static void |
encodeQueue(Queue queue,
OfPacketWriter pkt)
Writes the specified queue structure into the specified buffer.
|
static void |
encodeQueueList(List<Queue> queues,
OfPacketWriter pkt)
Encodes a list of queues, writing them into the supplied buffer.
|
static int |
getQueueStatsLength(ProtocolVersion pv)
Returns the length of a queue stats structure in bytes.
|
static List<Queue> |
parseQueueList(int targetRi,
OfPacketReader pkt,
ProtocolVersion pv)
Parses a list of Queue structures from the supplied buffer.
|
protected String |
tag()
Returns an identifying tag for the queue factory.
|
mpe, mpe, mpe, mpe
protected String tag()
tag
in class AbstractFactory
public static List<Queue> parseQueueList(int targetRi, OfPacketReader pkt, ProtocolVersion pv) throws MessageParseException
Note that this method causes the reader index of the underlying
PacketBuffer
to be advanced by the length of the list, which
should leave the read index at targetRi
.
This method delegates to parseQueue(com.hp.of.lib.OfPacketReader, com.hp.of.lib.ProtocolVersion)
for each individual
queue.
targetRi
- the target reader indexpkt
- the data bufferpv
- the protocol versionMessageParseException
- if a problem parsing the bufferpublic static MutableQueue createQueue(ProtocolVersion pv)
pv
- the required protocol versionVersionNotSupportedException
- if the version is not supportedpublic static QueueProperty createProperty(QueuePropType type, int rate)
type
parameter should be either
MIN_RATE
or
MAX_RATE
.
The rate
parameter is the rate expressed in 1/10ths of
a percent. For example:
type
- either MIN_RATE or MAX_RATErate
- the rate in 1/10ths of a percentIllegalArgumentException
- if rate is invalidpublic static QueueProperty createProperty(QueuePropType type, ExperimenterId eid, byte[] data)
type
parameter
must be EXPERIMENTER
.type
- EXPERIMENTEReid
- Experimenter iddata
- experimenter-defined datapublic static QueueProperty createProperty(QueuePropType type, int encId, byte[] data)
type
parameter
must be EXPERIMENTER
.type
- EXPERIMENTERencId
- an encoded experimenter iddata
- experimenter-defined datapublic static void encodeQueueList(List<Queue> queues, OfPacketWriter pkt)
PacketBuffer
to be advanced by the length of the written
queues.queues
- the list of queuespkt
- the buffer into which the queues are to be writtenpublic static void encodeQueue(Queue queue, OfPacketWriter pkt)
queue
- the queue to encodepkt
- the buffer to write intoIllegalArgumentException
- if the queue is mutablepublic static int getQueueStatsLength(ProtocolVersion pv)
pv
- the protocol versionCopyright © 2015. All Rights Reserved.