X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=third-party%2Fopenflowj_netty%2Fsrc%2Fmain%2Fjava%2Forg%2Fopenflow%2Fprotocol%2Ffactory%2FOFVendorActionFactory.java;fp=third-party%2Fopenflowj_netty%2Fsrc%2Fmain%2Fjava%2Forg%2Fopenflow%2Fprotocol%2Ffactory%2FOFVendorActionFactory.java;h=eb89810b78b9709b89b651731cd20d5615f6b80e;hb=85073423c6069e4b58fffde7cf19c806b2b52dd5;hp=0000000000000000000000000000000000000000;hpb=c5630f2945eb5370f9829514ef72de41d41eb2be;p=controller.git diff --git a/third-party/openflowj_netty/src/main/java/org/openflow/protocol/factory/OFVendorActionFactory.java b/third-party/openflowj_netty/src/main/java/org/openflow/protocol/factory/OFVendorActionFactory.java new file mode 100644 index 0000000000..eb89810b78 --- /dev/null +++ b/third-party/openflowj_netty/src/main/java/org/openflow/protocol/factory/OFVendorActionFactory.java @@ -0,0 +1,43 @@ +/** + * Copyright 2013, Big Switch Networks, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + **/ + +package org.openflow.protocol.factory; + +import org.jboss.netty.buffer.ChannelBuffer; +import org.openflow.protocol.action.OFActionVendor; + +/** Interface contract for an actionfactory that creates vendor-specific actions. + * VendorActionFactories are registered with the BasicFactory for a specific + * vendor id. + *

+ * Note: Implementations are expected to be thread-safe. + * + * @author Andreas Wundsam + */ +public interface OFVendorActionFactory { + + /** parse the data from the wire, create and return a vendor-specific action. + * + * @param data contains a serialized vendor action at the current readerPosition. + * The full message is guaranteed to be available in the buffer. + * + * @return upon success returns a newly allocated vendor-specific + * action instance, and advances the readerPosition in data for the + * entire length. Upon failure, returns null and leaves the readerPosition + * in data unmodified. + */ + OFActionVendor readFrom(ChannelBuffer data); +}