-/**
- * 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,
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 <FROM> type of source
- * @param <TO> type of result
+ * Converts OpenflowJava to MDSal model and vice versa
+ *
+ * @param <FROM> type of source
+ * @param <TO> type of result
+ * @param <DATA> the type parameter
*/
-public interface Convertor<FROM, TO> {
-
+public abstract class Convertor<FROM, TO, DATA extends ConvertorData> {
+ 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<Class<? extends DataContainer>> 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);
}