DeviceState implementation
[openflowplugin.git] / openflowplugin-api / src / main / java / org / opendaylight / openflowplugin / api / openflow / device / DeviceState.java
1 /*
2  * Copyright (c) 2015 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
9 package org.opendaylight.openflowplugin.api.openflow.device;
10
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutput;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortGrouping;
14 import java.util.List;
15 import java.util.Map;
16 import java.util.Set;
17
18 /**
19  * Created by Martin Bobak <mbobak@cisco.com> on 25.2.2015.
20  */
21 public interface DeviceState {
22
23     /**
24      * @return id of encapsulated node
25      */
26     NodeId getNodeId();
27
28     /**
29      * @return the features of corresponding switch
30      */
31     GetFeaturesOutput getFeatures();
32
33     /**
34      * @return true if this session is valid
35      */
36     boolean isValid();
37
38     /**
39      * @param valid the valid to set
40      */
41     void setValid(boolean valid);
42
43     /**
44      * Returns a map containing all OFPhysicalPorts of this switch.
45      *
46      * @return The Map of OFPhysicalPort
47      */
48     Map<Long, PortGrouping> getPhysicalPorts();
49
50     /**
51      * Returns a map containing all bandwidths for all OFPorts of this switch.
52      *
53      * @return The Map of bandwidths for all OFPorts
54      */
55     Map<Long, Long> getPortsBandwidth();
56
57     /**
58      * Returns a Set containing all port IDs of this switch.
59      *
60      * @return The Set of port ID
61      */
62     Set<Long> getPorts();
63
64     /**
65      * Returns OFPhysicalPort of the specified portNumber of this switch.
66      *
67      * @param portNumber The port ID
68      * @return OFPhysicalPort for the specified PortNumber
69      */
70     PortGrouping getPhysicalPort(Long portNumber);
71
72     /**
73      * Returns the bandwidth of the specified portNumber of this switch.
74      *
75      * @param portNumber the port ID
76      * @return bandwidth
77      */
78     Long getPortBandwidth(Long portNumber);
79
80     /**
81      * Returns True if the port is enabled,
82      *
83      * @param portNumber
84      * @return True if the port is enabled
85      */
86     boolean isPortEnabled(long portNumber);
87
88     /**
89      * Returns True if the port is enabled.
90      *
91      * @param port
92      * @return True if the port is enabled
93      */
94     boolean isPortEnabled(PortGrouping port);
95
96     /**
97      * Returns a list containing all enabled ports of this switch.
98      *
99      * @return List containing all enabled ports of this switch
100      */
101     List<PortGrouping> getEnabledPorts();
102
103     /**
104      * @return seed value for random operations
105      */
106     int getSeed();
107
108 }