public class BucketFactory extends AbstractFactory
Bucket
instances.Modifier and Type | Method and Description |
---|---|
static MutableBucket |
createMutableBucket(ProtocolVersion pv)
Creates a mutable bucket instance.
|
static void |
encodeBucket(Bucket bucket,
OfPacketWriter pkt)
Encodes a bucket, writing it into the supplied buffer.
|
static void |
encodeBucketList(List<Bucket> buckets,
OfPacketWriter pkt)
Encodes a list of buckets, writing them into the supplied buffer.
|
static int |
getLength(Bucket bkt)
Returns the length for the given bucket, in bytes.
|
static List<Bucket> |
parseBucketList(int targetRi,
OfPacketReader pkt,
ProtocolVersion pv)
Parses a list of bucket structures from the supplied buffer.
|
protected String |
tag()
Returns an identifying tag for the bucket factory.
|
static String |
toDebugString(int indent,
List<Bucket> bkt)
Outputs a list of buckets in debug string format.
|
mpe, mpe, mpe, mpe
protected String tag()
tag
in class AbstractFactory
public static List<Bucket> parseBucketList(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 reader index at targetRi
.
This method delegates to parseBucket(com.hp.of.lib.OfPacketReader, com.hp.of.lib.ProtocolVersion)
for each individual
bucket.
targetRi
- the target reader indexpkt
- the data bufferpv
- the protocol versionMessageParseException
- if unable to parse the structurepublic static MutableBucket createMutableBucket(ProtocolVersion pv)
pv
- the protocol versionVersionNotSupportedException
- if the version is not supportedVersionMismatchException
- if the version is < 1.1public static void encodeBucket(Bucket bucket, OfPacketWriter pkt)
PacketBuffer
to be advanced by the length of the bucket.bucket
- the bucketpkt
- the buffer into which the bucket is to be writtenpublic static void encodeBucketList(List<Bucket> buckets, OfPacketWriter pkt)
PacketBuffer
to be advanced by the length of the written
buckets.buckets
- the list of bucketspkt
- the buffer into which the buckets are to be writtenpublic static int getLength(Bucket bkt)
bkt
- the target bucketNullPointerException
- if the bkt is nullCopyright © 2015. All Rights Reserved.