alshabib

cleaning Device Provider

......@@ -43,7 +43,7 @@ import org.slf4j.Logger;
@Component(immediate = true)
public class OpenFlowDeviceProvider extends AbstractProvider implements DeviceProvider {
private final Logger log = getLogger(getClass());
private static final Logger LOG = getLogger(OpenFlowDeviceProvider.class);
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected DeviceProviderRegistry providerRegistry;
......@@ -66,7 +66,7 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr
public void activate() {
providerService = providerRegistry.register(this);
controller.addListener(listener);
log.info("Started");
LOG.info("Started");
}
@Deactivate
......@@ -74,12 +74,12 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr
providerRegistry.unregister(this);
controller.removeListener(listener);
providerService = null;
log.info("Stopped");
LOG.info("Stopped");
}
@Override
public void triggerProbe(Device device) {
log.info("Triggering probe on device {}", device.id());
LOG.info("Triggering probe on device {}", device.id());
}
@Override
......@@ -92,15 +92,16 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr
case STANDBY:
controller.setRole(new Dpid(device.id().uri().getSchemeSpecificPart()),
RoleState.EQUAL);
break;
case NONE:
controller.setRole(new Dpid(device.id().uri().getSchemeSpecificPart()),
RoleState.SLAVE);
break;
default:
log.error("Unknown Mastership state : {}", newRole);
LOG.error("Unknown Mastership state : {}", newRole);
}
log.info("Accepting mastership role change for device {}", device.id());
LOG.info("Accepting mastership role change for device {}", device.id());
}
private class InternalDeviceProvider implements OpenFlowSwitchListener {
......@@ -149,7 +150,7 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr
try {
uri = new URI("of", Long.toHexString(dpid.value()), null);
} catch (URISyntaxException e) {
log.warn("URI construction for device {} failed.", dpid);
LOG.warn("URI construction for device {} failed.", dpid);
}
return uri;
}
......