Search in sources :

Example 1 with ClearActionsInstructionDeserializer

use of org.opendaylight.openflowplugin.impl.protocol.deserialization.instruction.ClearActionsInstructionDeserializer in project openflowplugin by opendaylight.

the class InstructionDeserializerInjector method injectDeserializers.

/**
 * Injects instruction deserializers into provided
 * {@link org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerExtensionProvider}.
 *
 * @param provider OpenflowJava deserializer extension provider
 */
static void injectDeserializers(final DeserializerExtensionProvider provider) {
    // Inject new instruction deserializers here using injector created by createInjector method
    final Function<Byte, Function<ActionPath, Consumer<OFDeserializer<Instruction>>>> injector = createInjector(provider, EncodeConstants.OF13_VERSION_ID);
    injector.apply(InstructionConstants.GOTO_TABLE_TYPE).apply(null).accept(new GoToTableInstructionDeserializer());
    injector.apply(InstructionConstants.WRITE_METADATA_TYPE).apply(null).accept(new WriteMetadataInstructionDeserializer());
    injector.apply(InstructionConstants.CLEAR_ACTIONS_TYPE).apply(null).accept(new ClearActionsInstructionDeserializer());
    injector.apply(InstructionConstants.METER_TYPE).apply(null).accept(new MeterInstructionDeserializer());
    for (ActionPath path : ActionPath.values()) {
        injector.apply(InstructionConstants.WRITE_ACTIONS_TYPE).apply(path).accept(new WriteActionsInstructionDeserializer(path));
        injector.apply(InstructionConstants.APPLY_ACTIONS_TYPE).apply(path).accept(new ApplyActionsInstructionDeserializer(path));
    }
}
Also used : OFDeserializer(org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer) WriteMetadataInstructionDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.instruction.WriteMetadataInstructionDeserializer) Function(java.util.function.Function) MeterInstructionDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.instruction.MeterInstructionDeserializer) GoToTableInstructionDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.instruction.GoToTableInstructionDeserializer) ActionPath(org.opendaylight.openflowplugin.extension.api.path.ActionPath) WriteActionsInstructionDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.instruction.WriteActionsInstructionDeserializer) ClearActionsInstructionDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.instruction.ClearActionsInstructionDeserializer) ApplyActionsInstructionDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.instruction.ApplyActionsInstructionDeserializer)

Aggregations

Function (java.util.function.Function)1 OFDeserializer (org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer)1 ActionPath (org.opendaylight.openflowplugin.extension.api.path.ActionPath)1 ApplyActionsInstructionDeserializer (org.opendaylight.openflowplugin.impl.protocol.deserialization.instruction.ApplyActionsInstructionDeserializer)1 ClearActionsInstructionDeserializer (org.opendaylight.openflowplugin.impl.protocol.deserialization.instruction.ClearActionsInstructionDeserializer)1 GoToTableInstructionDeserializer (org.opendaylight.openflowplugin.impl.protocol.deserialization.instruction.GoToTableInstructionDeserializer)1 MeterInstructionDeserializer (org.opendaylight.openflowplugin.impl.protocol.deserialization.instruction.MeterInstructionDeserializer)1 WriteActionsInstructionDeserializer (org.opendaylight.openflowplugin.impl.protocol.deserialization.instruction.WriteActionsInstructionDeserializer)1 WriteMetadataInstructionDeserializer (org.opendaylight.openflowplugin.impl.protocol.deserialization.instruction.WriteMetadataInstructionDeserializer)1