Abstract service NodeId remove
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / services / AbstractService.java
index f1bdbf116da899234e9f5a02b5c49e90875194a6..73f098da9eb4241931cae4fc64709f503a85e0cc 100644 (file)
@@ -16,14 +16,14 @@ import java.math.BigInteger;
 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.DeviceState;
+import org.opendaylight.openflowplugin.api.openflow.device.DeviceInfo;
+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;
@@ -42,19 +42,16 @@ abstract class AbstractService<I, O> {
     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) {
-        final DeviceState deviceState = deviceContext.getDeviceState();
-        final GetFeaturesOutput features = deviceState.getFeatures();
+    AbstractService(final RequestContextStack requestContextStack, final DeviceContext deviceContext) {
+        final DeviceInfo deviceInfo = deviceContext.getDeviceInfo();
 
         this.requestContextStack = requestContextStack;
         this.deviceContext = deviceContext;
-        this.datapathId = features.getDatapathId();
-        this.version = features.getVersion();
+        this.datapathId = deviceInfo.getDatapathId();
+        this.version = deviceInfo.getVersion();
         this.messageSpy = deviceContext.getMessageSpy();
-        this.nodeId = deviceState.getNodeId();
     }
 
     public EventIdentifier getEventIdentifier() {
@@ -73,18 +70,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;
     }