public class EntityOwnershipUtils extends Object
| Constructor and Description |
|---|
EntityOwnershipUtils(org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService entityOwnershipService) |
| Modifier and Type | Method and Description |
|---|---|
org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService |
getEntityOwnershipService() |
boolean |
isEntityOwner(org.opendaylight.mdsal.eos.binding.api.Entity entity)
Checks if the local node is the owner of an entity.
|
boolean |
isEntityOwner(org.opendaylight.mdsal.eos.binding.api.Entity entity,
long sleepBetweenRetries,
int tries)
Checks if the local node is the owner of an entity.
|
boolean |
isEntityOwner(String entityType,
String entityName)
Checks if the local node is the owner of an entity.
|
void |
runOnlyInOwnerNode(String entityType,
String entityName,
org.opendaylight.infrautils.jobcoordinator.JobCoordinator coordinator,
String jobDesc,
Runnable job)
Runs a job task if the local node is the owner of an entity.
|
void |
runOnlyInOwnerNode(String entityType,
String entityName,
org.opendaylight.infrautils.jobcoordinator.JobCoordinator coordinator,
String jobKey,
String jobDesc,
Callable<List<com.google.common.util.concurrent.ListenableFuture<Void>>> job)
Runs a job task if the local node is the owner of an entity.
|
@Inject public EntityOwnershipUtils(org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService entityOwnershipService)
public org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService getEntityOwnershipService()
public boolean isEntityOwner(String entityType, String entityName)
entityType - the entity typeentityName - the entity namepublic boolean isEntityOwner(org.opendaylight.mdsal.eos.binding.api.Entity entity)
entity - the entitypublic boolean isEntityOwner(org.opendaylight.mdsal.eos.binding.api.Entity entity,
long sleepBetweenRetries,
int tries)
entity - the entitysleepBetweenRetries - the busy wait interval in millis if the entity is not yet presenttries - the total number of busy wait triespublic void runOnlyInOwnerNode(String entityType, String entityName, org.opendaylight.infrautils.jobcoordinator.JobCoordinator coordinator, String jobDesc, Runnable job)
entityType - the entity typeentityName - the entity namecoordinator - the JobCoordinator on which to run the job taskjobDesc - description of the job for loggingjob - the job taskpublic void runOnlyInOwnerNode(String entityType, String entityName, org.opendaylight.infrautils.jobcoordinator.JobCoordinator coordinator, String jobKey, String jobDesc, Callable<List<com.google.common.util.concurrent.ListenableFuture<Void>>> job)
entityType - the entity typeentityName - the entity namecoordinator - the JobCoordinator on which to run the jobjobKey - the job keyjobDesc - description of the job for loggingjob - the job taskCopyright © 2019 OpenDaylight. All rights reserved.