Bug 1588 - Move API classes from openflowplugin module to openflowplugin-api module
[openflowplugin.git] / openflowplugin / src / main / java / org / opendaylight / openflowplugin / openflow / md / core / translator / ExperimenterTranslator.java
1 /**
2  * Copyright (c) 2014 Ericsson India Global Services Pvt Ltd. 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  * Contributor: prasanna.huddar@ericsson.com
9  */
10 package org.opendaylight.openflowplugin.openflow.md.core.translator;
11
12 import java.util.Collections;
13 import java.util.List;
14
15 import org.opendaylight.openflowplugin.openflow.md.core.IMDMessageTranslator;
16 import org.opendaylight.openflowplugin.api.openflow.md.core.SwitchConnectionDistinguisher;
17 import org.opendaylight.openflowplugin.openflow.md.core.session.SessionContext;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterMessage;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
20 import org.opendaylight.yangtools.yang.binding.DataObject;
21 import org.slf4j.Logger;
22 import org.slf4j.LoggerFactory;
23
24 public class ExperimenterTranslator implements IMDMessageTranslator<OfHeader, List<DataObject>> {
25
26         protected static final Logger LOG = LoggerFactory.getLogger(ExperimenterTranslator.class);
27
28         @Override
29         public List<DataObject> translate(SwitchConnectionDistinguisher cookie,
30                         SessionContext sc, OfHeader msg) {
31                 if( msg instanceof ExperimenterMessage) {
32                     // TODO - implement functionality to fully support Experimenter framework
33                     return null;
34                 }else {
35                         LOG.error( "Message is not of Experimenter Error Message " ) ;
36                         return Collections.emptyList();
37                 }
38         }
39
40
41 }