X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=openflowplugin%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fopenflowplugin%2Fopenflow%2Fmd%2Fcore%2Fsal%2Fconvertor%2Fcommon%2FConvertor.java;h=91f91d2aac3c19c559aac2a4b6044594cc7c8562;hb=ddf1b1a5e0f3d401f562945ceb473570641fb45e;hp=4583a15587c2ee7d45dcfd5e0a636ea8b7068ef8;hpb=28f7c500a7bbd6f30ce62c43a9eb3fe9d6581edf;p=openflowplugin.git diff --git a/openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/common/Convertor.java b/openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/common/Convertor.java index 4583a15587..91f91d2aac 100644 --- a/openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/common/Convertor.java +++ b/openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/common/Convertor.java @@ -1,5 +1,5 @@ -/** - * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. +/* + * Copyright (c) 2016 Cisco Systems, Inc. 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, @@ -8,20 +8,52 @@ package org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common; -import java.math.BigInteger; - +import java.util.Collection; +import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor; +import org.opendaylight.yangtools.yang.binding.DataContainer; /** - * converting from MD-SAL model into appropriate OF-API model - * @param type of source - * @param type of result + * Converts OpenflowJava to MDSal model and vice versa + * + * @param type of source + * @param type of result + * @param the type parameter */ -public interface Convertor { - +public abstract class Convertor { + private ConvertorExecutor convertorExecutor; + + /** + * Gets convertor manager. + * + * @return the convertor manager + */ + protected ConvertorExecutor getConvertorExecutor() { + return convertorExecutor; + } + + /** + * Sets convertor manager. + * + * @param convertorExecutor the convertor manager + */ + public void setConvertorExecutor(ConvertorExecutor convertorExecutor) { + this.convertorExecutor = convertorExecutor; + } + + /** + * Gets type of convertor, used in + * {@link org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManager}. + * + * @return the type of convertor + */ + public abstract Collection> getTypes(); + /** - * @param source source type - * @param datapathid datapath id - * @return converted match (into OF-API model) + * Converts source to result + * + * @param source source + * @param data convertor data + * @return converted source */ - TO convert(FROM source,BigInteger datapathid); + public abstract TO convert(FROM source, DATA data); }