use of org.opendaylight.mdsal.eos.common.api.EntityOwnershipState in project openflowplugin by opendaylight.
the class LLDPDiscoveryUtils method isEntityOwned.
public static boolean isEntityOwned(final EntityOwnershipService eos, final String nodeId) {
Preconditions.checkNotNull(eos, "Entity ownership service must not be null");
EntityOwnershipState state = null;
java.util.Optional<EntityOwnershipState> status = getCurrentOwnershipStatus(eos, nodeId);
if (status.isPresent()) {
state = status.get();
} else {
LOG.error("Fetching ownership status failed for node {}", nodeId);
}
return state != null && state.equals(EntityOwnershipState.IS_OWNER);
}
Aggregations