BUG-2242: LLDP speaker as separate application.
[openflowplugin.git] / openflowplugin / src / main / java / org / opendaylight / openflowplugin / openflow / md / core / session / FeaturesV13Bandwidth.java
1 /**
2  * Copyright (c) 2013 Cisco Systems, Inc. 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 package org.opendaylight.openflowplugin.openflow.md.core.session;
9
10 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortGrouping;
11
12 /**
13  * 
14  * @author jsebin
15  *
16  * Singleton for extracting port features for OF 1.3    
17  */
18 public class FeaturesV13Bandwidth implements IGetBandwith {
19
20     private static FeaturesV13Bandwidth instance = new FeaturesV13Bandwidth();
21     
22     private FeaturesV13Bandwidth() {}
23     
24     /**
25      * 
26      * @return instance of class
27      */
28     public static FeaturesV13Bandwidth getInstance(){
29         return instance;
30     }
31     
32     @Override
33     public boolean getBandwidth(PortGrouping port) {        
34         return (port.getCurrentFeatures().is_100gbFd() | port.getCurrentFeatures().is_100mbFd() | port.getCurrentFeatures().is_100mbHd() | 
35                 port.getCurrentFeatures().is_10gbFd() | port.getCurrentFeatures().is_10mbFd() | port.getCurrentFeatures().is_10mbHd() | 
36                 port.getCurrentFeatures().is_1gbFd() | port.getCurrentFeatures().is_1gbHd() | port.getCurrentFeatures().is_1tbFd() | 
37                 port.getCurrentFeatures().is_40gbFd() | port.getCurrentFeatures().isAutoneg() | port.getCurrentFeatures().isCopper() |
38                 port.getCurrentFeatures().isFiber() | port.getCurrentFeatures().isOther() | port.getCurrentFeatures().isPause() | 
39                 port.getCurrentFeatures().isPauseAsym());
40     }
41
42 }