Bug 2756 - Match model update
[openflowjava.git] / openflow-protocol-impl / src / main / java / org / opendaylight / openflowjava / protocol / impl / deserialization / instruction / AbstractActionInstructionDeserializer.java
index 3f4126ba34773496c2d4c6d23f16d9521f63e03c..24950a0d307f6dc626ee202a90a963b63cc18864 100644 (file)
@@ -1,65 +1,65 @@
-/*\r
- * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-\r
-package org.opendaylight.openflowjava.protocol.impl.deserialization.instruction;\r
-\r
-import io.netty.buffer.ByteBuf;\r
-\r
-import java.util.List;\r
-\r
-import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistry;\r
-import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistryInjector;\r
-import org.opendaylight.openflowjava.protocol.impl.util.CodeKeyMaker;\r
-import org.opendaylight.openflowjava.protocol.impl.util.CodeKeyMakerFactory;\r
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;\r
-import org.opendaylight.openflowjava.protocol.impl.util.InstructionConstants;\r
-import org.opendaylight.openflowjava.protocol.impl.util.ListDeserializer;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ActionsInstruction;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ActionsInstructionBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.InstructionBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.InstructionBase;\r
-\r
-/**\r
- * @author michal.polkorab\r
- *\r
- */\r
-public abstract class AbstractActionInstructionDeserializer extends AbstractInstructionDeserializer\r
-        implements DeserializerRegistryInjector {\r
-\r
-    private DeserializerRegistry registry;\r
-\r
-    @Override\r
-    public Instruction deserialize(ByteBuf input) {\r
-        InstructionBuilder builder = new InstructionBuilder();\r
-        input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);\r
-        builder.setType(getType());\r
-        int instructionLength = input.readUnsignedShort();\r
-        input.skipBytes(InstructionConstants.PADDING_IN_ACTIONS_INSTRUCTION);\r
-        ActionsInstructionBuilder actionsBuilder = new ActionsInstructionBuilder();\r
-        int length = instructionLength - InstructionConstants.STANDARD_INSTRUCTION_LENGTH;\r
-        CodeKeyMaker keyMaker = CodeKeyMakerFactory.createActionsKeyMaker(EncodeConstants.OF13_VERSION_ID);\r
-        List<Action> actions = ListDeserializer.deserializeList(\r
-                EncodeConstants.OF13_VERSION_ID, length, input, keyMaker, getRegistry());\r
-        actionsBuilder.setAction(actions);\r
-        builder.addAugmentation(ActionsInstruction.class, actionsBuilder.build());\r
-        return builder.build();\r
-    }\r
-\r
-    protected abstract Class<? extends InstructionBase> getType();\r
-\r
-    protected DeserializerRegistry getRegistry() {\r
-        return registry;\r
-    }\r
-\r
-    @Override\r
-    public void injectDeserializerRegistry(DeserializerRegistry deserializerRegistry) {\r
-        this.registry = deserializerRegistry;\r
-    }\r
-}\r
+/*
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowjava.protocol.impl.deserialization.instruction;
+
+import io.netty.buffer.ByteBuf;
+
+import java.util.List;
+
+import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistry;
+import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistryInjector;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.impl.util.CodeKeyMaker;
+import org.opendaylight.openflowjava.protocol.impl.util.CodeKeyMakerFactory;
+import org.opendaylight.openflowjava.protocol.impl.util.InstructionConstants;
+import org.opendaylight.openflowjava.protocol.impl.util.ListDeserializer;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ActionsInstruction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ActionsInstructionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.InstructionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.InstructionBase;
+
+/**
+ * @author michal.polkorab
+ *
+ */
+public abstract class AbstractActionInstructionDeserializer extends AbstractInstructionDeserializer
+        implements DeserializerRegistryInjector {
+
+    private DeserializerRegistry registry;
+
+    @Override
+    public Instruction deserialize(ByteBuf input) {
+        InstructionBuilder builder = new InstructionBuilder();
+        input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        builder.setType(getType());
+        int instructionLength = input.readUnsignedShort();
+        input.skipBytes(InstructionConstants.PADDING_IN_ACTIONS_INSTRUCTION);
+        ActionsInstructionBuilder actionsBuilder = new ActionsInstructionBuilder();
+        int length = instructionLength - InstructionConstants.STANDARD_INSTRUCTION_LENGTH;
+        CodeKeyMaker keyMaker = CodeKeyMakerFactory.createActionsKeyMaker(EncodeConstants.OF13_VERSION_ID);
+        List<Action> actions = ListDeserializer.deserializeList(
+                EncodeConstants.OF13_VERSION_ID, length, input, keyMaker, getRegistry());
+        actionsBuilder.setAction(actions);
+        builder.addAugmentation(ActionsInstruction.class, actionsBuilder.build());
+        return builder.build();
+    }
+
+    protected abstract Class<? extends InstructionBase> getType();
+
+    protected DeserializerRegistry getRegistry() {
+        return registry;
+    }
+
+    @Override
+    public void injectDeserializerRegistry(DeserializerRegistry deserializerRegistry) {
+        this.registry = deserializerRegistry;
+    }
+}