Merge "SONAR TD - StatisticsContextImpl, StatisticsManagerImpl"
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / services / RoleService.java
index 07b5fadcad2b514f16dc89025d166088d1af5827..c2653bf20803c14d2e6f491fd96608019f79a07a 100644 (file)
@@ -47,13 +47,13 @@ public class RoleService extends AbstractSimpleService<RoleRequestInputBuilder,
     }
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final RoleRequestInputBuilder input) {
+    protected OfHeader buildRequest(final Xid xid, final RoleRequestInputBuilder input) throws ServiceException {
         input.setXid(xid.getValue());
         return input.build();
     }
 
     public Future<BigInteger> getGenerationIdFromDevice(final Short version) {
-        LOG.info("getGenerationIdFromDevice called for device:{}", getNodeId().getValue());
+        LOG.info("getGenerationIdFromDevice called for device: {}", getDeviceInfo().getNodeId().getValue());
 
         // send a dummy no-change role request to get the generation-id of the switch
         final RoleRequestInputBuilder roleRequestInputBuilder = new RoleRequestInputBuilder();
@@ -73,7 +73,7 @@ public class RoleService extends AbstractSimpleService<RoleRequestInputBuilder,
                         finalFuture.set(roleRequestOutput.getGenerationId());
                     } else {
                         LOG.info("roleRequestOutput is null in getGenerationIdFromDevice");
-                        finalFuture.setException(new RoleChangeException("Exception in getting generationId for device:" + getNodeId().getValue()));
+                        finalFuture.setException(new RoleChangeException("Exception in getting generationId for device:" + getDeviceInfo().getNodeId().getValue()));
                     }
 
                 } else {
@@ -96,7 +96,7 @@ public class RoleService extends AbstractSimpleService<RoleRequestInputBuilder,
 
     public Future<RpcResult<SetRoleOutput>> submitRoleChange(final OfpRole ofpRole, final Short version, final BigInteger generationId) {
         LOG.info("submitRoleChange called for device:{}, role:{}",
-                getNodeId(), ofpRole);
+                getDeviceInfo().getNodeId(), ofpRole);
         final RoleRequestInputBuilder roleRequestInputBuilder = new RoleRequestInputBuilder();
         roleRequestInputBuilder.setRole(toOFJavaRole(ofpRole));
         roleRequestInputBuilder.setVersion(version);
@@ -109,7 +109,7 @@ public class RoleService extends AbstractSimpleService<RoleRequestInputBuilder,
             @Override
             public void onSuccess(final RpcResult<RoleRequestOutput> roleRequestOutputRpcResult) {
                 LOG.info("submitRoleChange onSuccess for device:{}, role:{}",
-                        getNodeId(), ofpRole);
+                        getDeviceInfo().getNodeId(), ofpRole);
                 final RoleRequestOutput roleRequestOutput = roleRequestOutputRpcResult.getResult();
                 final Collection<RpcError> rpcErrors = roleRequestOutputRpcResult.getErrors();
                 if (roleRequestOutput != null) {
@@ -131,7 +131,7 @@ public class RoleService extends AbstractSimpleService<RoleRequestInputBuilder,
             @Override
             public void onFailure(final Throwable throwable) {
                 LOG.error("submitRoleChange onFailure for device:{}, role:{}",
-                        getNodeId(), ofpRole, throwable);
+                        getDeviceInfo().getNodeId(), ofpRole, throwable);
                 finalFuture.setException(throwable);
             }
         });