Search in sources :

Example 1 with OF13MatchSerializer

use of org.opendaylight.openflowjava.protocol.impl.util.OF13MatchSerializer in project openflowplugin by opendaylight.

the class SerializerRegistryImpl method init.

@Override
public void init() {
    registry = new HashMap<>();
    // Openflow message type serializers
    MessageFactoryInitializer.registerMessageSerializers(this);
    // Register Additional serializers
    AdditionalMessageFactoryInitializer.registerMessageSerializers(this);
    // match structure serializers
    registerSerializer(new MessageTypeKey<>(OF10, MatchV10.class), new OF10MatchSerializer());
    registerSerializer(new MessageTypeKey<>(OF13, Match.class), new OF13MatchSerializer());
    // match entry serializers
    MatchEntriesInitializer.registerMatchEntrySerializers(this);
    // action serializers
    ActionsInitializer.registerActionSerializers(this);
    // instruction serializers
    InstructionsInitializer.registerInstructionSerializers(this);
}
Also used : OF10MatchSerializer(org.opendaylight.openflowjava.protocol.impl.util.OF10MatchSerializer) OF13MatchSerializer(org.opendaylight.openflowjava.protocol.impl.util.OF13MatchSerializer) MatchV10(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10) Match(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.Match)

Example 2 with OF13MatchSerializer

use of org.opendaylight.openflowjava.protocol.impl.util.OF13MatchSerializer in project openflowplugin by opendaylight.

the class SerializerRegistryImplTest method testUnRegisterSerializerNoMessageTypeKey.

/**
 * Test - unregister serializer without MessageTypeKey.
 */
@Test(expected = IllegalArgumentException.class)
public void testUnRegisterSerializerNoMessageTypeKey() {
    SerializerRegistryImpl serReg = new SerializerRegistryImpl();
    serReg.init();
    serReg.registerSerializer(new MessageTypeKey<>(OF13, Match.class), new OF13MatchSerializer());
    serReg.unregisterSerializer(null);
}
Also used : OF13MatchSerializer(org.opendaylight.openflowjava.protocol.impl.util.OF13MatchSerializer) Match(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.Match) Test(org.junit.Test)

Example 3 with OF13MatchSerializer

use of org.opendaylight.openflowjava.protocol.impl.util.OF13MatchSerializer in project openflowplugin by opendaylight.

the class SerializerRegistryImplTest method testUnRegisterSerializer.

/**
 * Test - unregister serializer.
 */
@Test
public void testUnRegisterSerializer() {
    SerializerRegistryImpl serReg = new SerializerRegistryImpl();
    serReg.init();
    serReg.registerSerializer(new MessageTypeKey<>(OF13, Match.class), new OF13MatchSerializer());
    Assert.assertTrue("Wrong - unregister serializer", serReg.unregisterSerializer(new MessageTypeKey<>(OF13, Match.class)));
    serReg.registerSerializer(new MessageTypeKey<>(OF13, Match.class), new OF13MatchSerializer());
    Assert.assertFalse("Wrong - unregister serializer", serReg.unregisterSerializer(new MessageTypeKey<>(OF10, Match.class)));
}
Also used : OF13MatchSerializer(org.opendaylight.openflowjava.protocol.impl.util.OF13MatchSerializer) MessageTypeKey(org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey) Match(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.Match) Test(org.junit.Test)

Aggregations

OF13MatchSerializer (org.opendaylight.openflowjava.protocol.impl.util.OF13MatchSerializer)3 Match (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.Match)3 Test (org.junit.Test)2 MessageTypeKey (org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey)1 OF10MatchSerializer (org.opendaylight.openflowjava.protocol.impl.util.OF10MatchSerializer)1 MatchV10 (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10)1