Search in sources :

Example 6 with MessageCodeKey

use of org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey in project openflowplugin by opendaylight.

the class MultipartReplyMessageDeserializer method deserialize.

@Override
public MultipartReply deserialize(ByteBuf message) {
    final long xid = message.readUnsignedInt();
    final int type = message.readUnsignedShort();
    final boolean reqMore = (message.readUnsignedShort() & 0x01) != 0;
    message.skipBytes(PADDING_IN_MULTIPART_REPLY_HEADER);
    final OFDeserializer<MultipartReplyBody> deserializer = Preconditions.checkNotNull(registry).getDeserializer(new MessageCodeKey(EncodeConstants.OF13_VERSION_ID, type, MultipartReplyBody.class));
    return new MultipartReplyBuilder().setVersion((short) EncodeConstants.OF13_VERSION_ID).setXid(xid).setRequestMore(reqMore).setMultipartReplyBody(deserializer.deserialize(message)).build();
}
Also used : MultipartReplyBody(org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.multipart.reply.MultipartReplyBody) MessageCodeKey(org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey) MultipartReplyBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.MultipartReplyBuilder)

Example 7 with MessageCodeKey

use of org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey in project openflowplugin by opendaylight.

the class MultipartReplyMessageFactoryTest method startUp.

/**
 * Initializes deserializer registry and lookups correct deserializer.
 */
@Before
public void startUp() {
    DeserializerRegistry registry = new DeserializerRegistryImpl();
    registry.init();
    multipartFactory = registry.getDeserializer(new MessageCodeKey(EncodeConstants.OF13_VERSION_ID, 19, MultipartReplyMessage.class));
}
Also used : MessageCodeKey(org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey) DeserializerRegistryImpl(org.opendaylight.openflowjava.protocol.impl.deserialization.DeserializerRegistryImpl) DeserializerRegistry(org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistry) Before(org.junit.Before)

Example 8 with MessageCodeKey

use of org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey in project openflowplugin by opendaylight.

the class MultipartRequestQueueInputMessageFactoryTest method startUp.

@Before
public void startUp() {
    DeserializerRegistry desRegistry = new DeserializerRegistryImpl();
    desRegistry.init();
    factory = desRegistry.getDeserializer(new MessageCodeKey(EncodeConstants.OF13_VERSION_ID, 18, MultipartRequestInput.class));
}
Also used : MessageCodeKey(org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey) DeserializerRegistryImpl(org.opendaylight.openflowjava.protocol.impl.deserialization.DeserializerRegistryImpl) DeserializerRegistry(org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistry) Before(org.junit.Before)

Example 9 with MessageCodeKey

use of org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey in project openflowplugin by opendaylight.

the class MultipartRequestTableInputMessageFactoryTest method startUp.

@Before
public void startUp() {
    DeserializerRegistry desRegistry = new DeserializerRegistryImpl();
    desRegistry.init();
    factory = desRegistry.getDeserializer(new MessageCodeKey(EncodeConstants.OF13_VERSION_ID, 18, MultipartRequestInput.class));
}
Also used : MessageCodeKey(org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey) DeserializerRegistryImpl(org.opendaylight.openflowjava.protocol.impl.deserialization.DeserializerRegistryImpl) DeserializerRegistry(org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistry) Before(org.junit.Before)

Example 10 with MessageCodeKey

use of org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey in project openflowplugin by opendaylight.

the class OF10FlowModInputMessageFactoryTest method startUp.

@Before
public void startUp() {
    DeserializerRegistry desRegistry = new DeserializerRegistryImpl();
    desRegistry.init();
    factory = desRegistry.getDeserializer(new MessageCodeKey(EncodeConstants.OF10_VERSION_ID, 14, FlowModInput.class));
}
Also used : MessageCodeKey(org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey) DeserializerRegistryImpl(org.opendaylight.openflowjava.protocol.impl.deserialization.DeserializerRegistryImpl) DeserializerRegistry(org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistry) Before(org.junit.Before)

Aggregations

MessageCodeKey (org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey)85 Before (org.junit.Before)52 DeserializerRegistryImpl (org.opendaylight.openflowjava.protocol.impl.deserialization.DeserializerRegistryImpl)52 DeserializerRegistry (org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistry)51 Test (org.junit.Test)16 ByteBuf (io.netty.buffer.ByteBuf)10 BigInteger (java.math.BigInteger)8 Match (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.Match)7 MatchV10 (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10)7 SuppressFBWarnings (edu.umd.cs.findbugs.annotations.SuppressFBWarnings)4 ArrayList (java.util.ArrayList)4 ActionDeserializerKey (org.opendaylight.openflowjava.protocol.api.keys.ActionDeserializerKey)4 CodeKeyMaker (org.opendaylight.openflowjava.protocol.impl.util.CodeKeyMaker)4 ExperimenterActionDeserializerKey (org.opendaylight.openflowjava.protocol.api.keys.ExperimenterActionDeserializerKey)3 MatchEntryDeserializerKey (org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey)3 ExperimenterIdDeserializerKey (org.opendaylight.openflowjava.protocol.api.keys.ExperimenterIdDeserializerKey)2 InstructionDeserializerKey (org.opendaylight.openflowjava.protocol.api.keys.InstructionDeserializerKey)2 TypeToClassKey (org.opendaylight.openflowjava.protocol.api.keys.TypeToClassKey)2 DefaultDeserializerFactoryTest (org.opendaylight.openflowjava.protocol.impl.util.DefaultDeserializerFactoryTest)2 MessageCodeExperimenterKey (org.opendaylight.openflowplugin.api.openflow.protocol.deserialization.MessageCodeExperimenterKey)2