- final Entity deviceEntity = new Entity("openflow",nodeId.getValue());
- if(manager.getOwnershipService().isCandidateRegistered(deviceEntity)) {
- Optional<EntityOwnershipState> deviceOwnershipState = manager.getOwnershipService()
- .getOwnershipState(deviceEntity);
-
- if(deviceOwnershipState.isPresent()) {
- return deviceOwnershipState.get().isOwner();
- } else {
- LOG.error("Node {} is connected to the controller but ownership state is missing.");
- }
- } else {
- LOG.warn("Node {} is connected to the controller but it did not" +
- "registered for the device ownership.",nodeId);
- }
- return false;