2 * Copyright 2013, Big Switch Networks, Inc.
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may
5 * not use this file except in compliance with the License. You may obtain
6 * a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 * License for the specific language governing permissions and limitations
17 package org.openflow.protocol.factory;
19 import org.jboss.netty.buffer.ChannelBuffer;
20 import org.openflow.protocol.action.OFActionVendor;
22 /** Interface contract for an actionfactory that creates vendor-specific actions.
23 * VendorActionFactories are registered with the BasicFactory for a specific
26 * <b>Note:</b> Implementations are expected to be thread-safe.
28 * @author Andreas Wundsam <andreas.wundsam@bigswitch.com>
30 public interface OFVendorActionFactory {
32 /** parse the data from the wire, create and return a vendor-specific action.
34 * @param data contains a serialized vendor action at the current readerPosition.
35 * The full message is guaranteed to be available in the buffer.
37 * @return upon success returns a newly allocated vendor-specific
38 * action instance, and advances the readerPosition in data for the
39 * entire length. Upon failure, returns null and leaves the readerPosition
42 OFActionVendor readFrom(ChannelBuffer data);