import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FeaturesReply;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.role.service.rev150727.OfpRole;
import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
/**
* DeviceState is builded from {@link FeaturesReply} and {@link NodeId}. Both values are inside
* {@link org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext}
*
- * @author <a href="mailto:vdemcak@cisco.com">Vaclav Demcak</a>
- * <p/>
- * Created: Mar 29, 2015
*/
class DeviceStateImpl implements DeviceState {
- private final GetFeaturesOutput featuresOutput;
- private final NodeId nodeId;
- private final KeyedInstanceIdentifier<Node, NodeKey> nodeII;
- private final short version;
private boolean valid;
private boolean meterIsAvailable;
private boolean groupIsAvailable;
private boolean flowStatisticsAvailable;
private boolean tableStatisticsAvailable;
private boolean portStatisticsAvailable;
+ private boolean statPollEnabled;
private boolean queueStatisticsAvailable;
- private volatile OfpRole role;
- public DeviceStateImpl(@CheckForNull final FeaturesReply featuresReply, @Nonnull final NodeId nodeId) {
- Preconditions.checkArgument(featuresReply != null);
- featuresOutput = new GetFeaturesOutputBuilder(featuresReply).build();
- this.nodeId = Preconditions.checkNotNull(nodeId);
- nodeII = DeviceStateUtil.createNodeInstanceIdentifier(nodeId);
- version = featuresReply.getVersion();
- }
-
- @Override
- public NodeId getNodeId() {
- return nodeId;
- }
-
- @Override
- public KeyedInstanceIdentifier<Node, NodeKey> getNodeInstanceIdentifier() {
- return nodeII;
- }
-
- @Override
- public GetFeaturesOutput getFeatures() {
- return featuresOutput;
+ DeviceStateImpl() {
+ statPollEnabled = false;
+ deviceSynchronized = false;
}
@Override
this.valid = valid;
}
- @Override
- public short getVersion() {
- return version;
- }
-
@Override
public boolean isMetersAvailable() {
return meterIsAvailable;
}
@Override
- public OfpRole getRole() {
- return role;
+ public boolean isStatisticsPollingEnabled() {
+ return statPollEnabled;
}
@Override
- public void setRole(OfpRole role) {
- this.role = role;
+ public void setStatisticsPollingEnabledProp(final boolean statPollEnabled) {
+ this.statPollEnabled = statPollEnabled;
}
}