X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=openflow-protocol-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fopenflowjava%2Fprotocol%2Fimpl%2Fdeserialization%2Faction%2FAbstractActionDeserializer.java;h=10c65f5b6586137621f854075ed90bab6b480341;hb=5f5622e79402f70a944fa93fd7ee2d84d1776b08;hp=4ff7c307c3c0e64c201a569c80adbf5f84b595c9;hpb=e1c384c30000127fd6b266d90471a996ffa5bd83;p=openflowjava.git diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/AbstractActionDeserializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/AbstractActionDeserializer.java index 4ff7c307..10c65f5b 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/AbstractActionDeserializer.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/AbstractActionDeserializer.java @@ -1,38 +1,37 @@ -/* - * 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.action; - -import io.netty.buffer.ByteBuf; - -import org.opendaylight.openflowjava.protocol.api.extensibility.HeaderDeserializer; -import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer; -import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants; -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.action.rev130731.actions.grouping.ActionBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase; - -/** - * @author michal.polkorab - * - */ -public abstract class AbstractActionDeserializer implements OFDeserializer, - HeaderDeserializer { - - @Override - public Action deserializeHeader(ByteBuf input) { - ActionBuilder actionBuilder = new ActionBuilder(); - input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES); - actionBuilder.setType(getType()); - input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES); - return actionBuilder.build(); - } - - protected abstract Class getType(); - -} +/* + * 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.action; + +import io.netty.buffer.ByteBuf; + +import org.opendaylight.openflowjava.protocol.api.extensibility.HeaderDeserializer; +import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer; +import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants; +import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice; +import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action; +import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder; + +/** + * @author michal.polkorab + * + */ +public abstract class AbstractActionDeserializer implements OFDeserializer, + HeaderDeserializer { + + @Override + public Action deserializeHeader(ByteBuf input) { + ActionBuilder actionBuilder = new ActionBuilder(); + input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES); + actionBuilder.setActionChoice(getType()); + return actionBuilder.build(); + } + + protected abstract ActionChoice getType(); + +}