Merge "DevManager functionality add"
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / device / DeviceStateImpl.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.impl.device;
10
11 import com.google.common.base.Preconditions;
12 import javax.annotation.CheckForNull;
13 import javax.annotation.Nonnull;
14 import org.opendaylight.openflowplugin.api.openflow.device.DeviceState;
15 import org.opendaylight.openflowplugin.impl.util.DeviceStateUtil;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FeaturesReply;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutput;
21 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutputBuilder;
22 import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
23
24 /**
25  * openflowplugin-impl
26  * org.opendaylight.openflowplugin.impl.device
27  * <p/>
28  * DeviceState is builded from {@link FeaturesReply} and {@link NodeId}. Both values are inside
29  * {@link org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext}
30  *
31  */
32 class DeviceStateImpl implements DeviceState {
33
34     private boolean valid;
35     private boolean meterIsAvailable;
36     private boolean groupIsAvailable;
37     private boolean deviceSynchronized;
38     private boolean flowStatisticsAvailable;
39     private boolean tableStatisticsAvailable;
40     private boolean portStatisticsAvailable;
41     private boolean statPollEnabled;
42     private boolean queueStatisticsAvailable;
43
44     DeviceStateImpl() {
45         statPollEnabled = false;
46         deviceSynchronized = false;
47     }
48
49     @Override
50     public boolean isValid() {
51         return valid;
52     }
53
54     @Override
55     public void setValid(final boolean valid) {
56         this.valid = valid;
57     }
58
59     @Override
60     public boolean isMetersAvailable() {
61         return meterIsAvailable;
62     }
63
64     @Override
65     public void setMeterAvailable(final boolean available) {
66         meterIsAvailable = available;
67     }
68
69     @Override
70     public boolean isGroupAvailable() {
71         return groupIsAvailable;
72     }
73
74     @Override
75     public void setGroupAvailable(final boolean available) {
76         groupIsAvailable = available;
77     }
78
79     @Override
80     public boolean deviceSynchronized() {
81         return deviceSynchronized;
82     }
83
84     @Override
85     public boolean isFlowStatisticsAvailable() {
86         return flowStatisticsAvailable;
87     }
88
89     @Override
90     public void setFlowStatisticsAvailable(final boolean available) {
91         flowStatisticsAvailable = available;
92     }
93
94     @Override
95     public boolean isTableStatisticsAvailable() {
96         return tableStatisticsAvailable;
97     }
98
99     @Override
100     public void setTableStatisticsAvailable(final boolean available) {
101         tableStatisticsAvailable = available;
102     }
103
104     @Override
105     public boolean isPortStatisticsAvailable() {
106         return portStatisticsAvailable;
107     }
108
109     @Override
110     public void setPortStatisticsAvailable(final boolean available) {
111         portStatisticsAvailable = available;
112     }
113
114     @Override
115     public boolean isQueueStatisticsAvailable() {
116         return queueStatisticsAvailable;
117     }
118
119     @Override
120     public void setQueueStatisticsAvailable(final boolean available) {
121         queueStatisticsAvailable = available;
122
123     }
124
125     @Override
126     public void setDeviceSynchronized(final boolean _deviceSynchronized) {
127         deviceSynchronized = _deviceSynchronized;
128     }
129
130     @Override
131     public boolean isStatisticsPollingEnabled() {
132         return statPollEnabled;
133     }
134
135     @Override
136     public void setStatisticsPollingEnabledProp(final boolean statPollEnabled) {
137         this.statPollEnabled = statPollEnabled;
138     }
139 }