alshabib

cleaning Device Provider

...@@ -43,7 +43,7 @@ import org.slf4j.Logger; ...@@ -43,7 +43,7 @@ import org.slf4j.Logger;
43 @Component(immediate = true) 43 @Component(immediate = true)
44 public class OpenFlowDeviceProvider extends AbstractProvider implements DeviceProvider { 44 public class OpenFlowDeviceProvider extends AbstractProvider implements DeviceProvider {
45 45
46 - private final Logger log = getLogger(getClass()); 46 + private static final Logger LOG = getLogger(OpenFlowDeviceProvider.class);
47 47
48 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) 48 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
49 protected DeviceProviderRegistry providerRegistry; 49 protected DeviceProviderRegistry providerRegistry;
...@@ -66,7 +66,7 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr ...@@ -66,7 +66,7 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr
66 public void activate() { 66 public void activate() {
67 providerService = providerRegistry.register(this); 67 providerService = providerRegistry.register(this);
68 controller.addListener(listener); 68 controller.addListener(listener);
69 - log.info("Started"); 69 + LOG.info("Started");
70 } 70 }
71 71
72 @Deactivate 72 @Deactivate
...@@ -74,12 +74,12 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr ...@@ -74,12 +74,12 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr
74 providerRegistry.unregister(this); 74 providerRegistry.unregister(this);
75 controller.removeListener(listener); 75 controller.removeListener(listener);
76 providerService = null; 76 providerService = null;
77 - log.info("Stopped"); 77 + LOG.info("Stopped");
78 } 78 }
79 79
80 @Override 80 @Override
81 public void triggerProbe(Device device) { 81 public void triggerProbe(Device device) {
82 - log.info("Triggering probe on device {}", device.id()); 82 + LOG.info("Triggering probe on device {}", device.id());
83 } 83 }
84 84
85 @Override 85 @Override
...@@ -92,15 +92,16 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr ...@@ -92,15 +92,16 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr
92 case STANDBY: 92 case STANDBY:
93 controller.setRole(new Dpid(device.id().uri().getSchemeSpecificPart()), 93 controller.setRole(new Dpid(device.id().uri().getSchemeSpecificPart()),
94 RoleState.EQUAL); 94 RoleState.EQUAL);
95 + break;
95 case NONE: 96 case NONE:
96 controller.setRole(new Dpid(device.id().uri().getSchemeSpecificPart()), 97 controller.setRole(new Dpid(device.id().uri().getSchemeSpecificPart()),
97 RoleState.SLAVE); 98 RoleState.SLAVE);
98 break; 99 break;
99 default: 100 default:
100 - log.error("Unknown Mastership state : {}", newRole); 101 + LOG.error("Unknown Mastership state : {}", newRole);
101 102
102 } 103 }
103 - log.info("Accepting mastership role change for device {}", device.id()); 104 + LOG.info("Accepting mastership role change for device {}", device.id());
104 } 105 }
105 106
106 private class InternalDeviceProvider implements OpenFlowSwitchListener { 107 private class InternalDeviceProvider implements OpenFlowSwitchListener {
...@@ -149,7 +150,7 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr ...@@ -149,7 +150,7 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr
149 try { 150 try {
150 uri = new URI("of", Long.toHexString(dpid.value()), null); 151 uri = new URI("of", Long.toHexString(dpid.value()), null);
151 } catch (URISyntaxException e) { 152 } catch (URISyntaxException e) {
152 - log.warn("URI construction for device {} failed.", dpid); 153 + LOG.warn("URI construction for device {} failed.", dpid);
153 } 154 }
154 return uri; 155 return uri;
155 } 156 }
......