069f34fec77094143d9417d76c1aefe5dc710bbf
[openflowjava.git] / openflow-protocol-impl / src / main / java / org / opendaylight / openflowjava / protocol / impl / serialization / experimenter / BundleControlFactory.java
1 /*
2  * Copyright (c) 2016 Pantheon Technologies s.r.o. and others. All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.openflowjava.protocol.impl.serialization.experimenter;
10
11 import io.netty.buffer.ByteBuf;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.approved.extensions.rev160802.experimenter.input.experimenter.data.of.choice.BundleControl;
13
14 /**
15  * Translates BundleControl messages (OpenFlow v1.3 extension #230).
16  */
17 public class BundleControlFactory extends AbstractBundleMessageFactory<BundleControl> {
18
19     @Override
20     public void serialize(BundleControl input, ByteBuf outBuffer) {
21         outBuffer.writeInt(input.getBundleId().getValue().intValue());
22         outBuffer.writeShort(input.getType().getIntValue());
23         writeBundleFlags(input.getFlags(), outBuffer);
24         if (input.getBundleProperty() != null) {
25             writeBundleProperties(input.getBundleProperty(), outBuffer);
26         }
27     }
28
29 }