SONAR TD - StatisticsContextImpl, StatisticsManagerImpl
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / services / AbstractService.java
index 4f686b447121e829b845b8a441e283c626a99525..57e86731f8eb336ae6825fbb7c276a9811fad5ba 100644 (file)
@@ -17,14 +17,13 @@ import javax.annotation.Nonnull;
 import org.opendaylight.openflowjava.protocol.api.connection.OutboundQueue;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceInfo;
-import org.opendaylight.openflowplugin.api.openflow.device.DeviceState;
+import org.opendaylight.openflowplugin.api.openflow.device.DeviceRegistry;
 import org.opendaylight.openflowplugin.api.openflow.device.RequestContext;
 import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
+import org.opendaylight.openflowplugin.api.openflow.device.TxFacade;
 import org.opendaylight.openflowplugin.api.openflow.device.Xid;
 import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.EventIdentifier;
 import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.MessageSpy;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
 import org.opendaylight.yangtools.yang.binding.DataContainer;
 import org.opendaylight.yangtools.yang.common.RpcError;
@@ -35,18 +34,15 @@ import org.slf4j.LoggerFactory;
 
 abstract class AbstractService<I, O> {
     private static final Logger LOG = LoggerFactory.getLogger(AbstractService.class);
-    private static final long WAIT_TIME = 2000;
-    private static final BigInteger PRIMARY_CONNECTION = BigInteger.ZERO;
 
     private final short version;
     private final BigInteger datapathId;
     private final RequestContextStack requestContextStack;
     private final DeviceContext deviceContext;
     private final MessageSpy messageSpy;
-    private final NodeId nodeId;
     private EventIdentifier eventIdentifier;
 
-    public AbstractService(final RequestContextStack requestContextStack, final DeviceContext deviceContext) {
+    AbstractService(final RequestContextStack requestContextStack, final DeviceContext deviceContext) {
         final DeviceInfo deviceInfo = deviceContext.getDeviceInfo();
 
         this.requestContextStack = requestContextStack;
@@ -54,7 +50,6 @@ abstract class AbstractService<I, O> {
         this.datapathId = deviceInfo.getDatapathId();
         this.version = deviceInfo.getVersion();
         this.messageSpy = deviceContext.getMessageSpy();
-        this.nodeId = deviceInfo.getNodeId();
     }
 
     public EventIdentifier getEventIdentifier() {
@@ -73,18 +68,21 @@ abstract class AbstractService<I, O> {
         return datapathId;
     }
 
-    public NodeId getNodeId() {
-        return nodeId;
-    }
-
     public RequestContextStack getRequestContextStack() {
         return requestContextStack;
     }
 
+    @Deprecated
     public DeviceContext getDeviceContext() {
         return deviceContext;
     }
 
+    protected DeviceRegistry getDeviceRegistry() {return deviceContext;}
+
+    public DeviceInfo getDeviceInfo() {return deviceContext.getDeviceInfo();}
+
+    public TxFacade getTxFacade() {return deviceContext;}
+
     public MessageSpy getMessageSpy() {
         return messageSpy;
     }