Class EntityOwnershipUtils


  • public class EntityOwnershipUtils
    extends java.lang.Object
    EntityOwnershipService utilities.
    Author:
    Thomas Pantelis
    • Constructor Summary

      Constructors 
      Constructor Description
      EntityOwnershipUtils​(org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService entityOwnershipService)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService getEntityOwnershipService()  
      boolean isEntityOwner​(java.lang.String entityType, java.lang.String entityName)
      Checks if the local node is the owner of an entity.
      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.
      void runOnlyInOwnerNode​(java.lang.String entityType, java.lang.String entityName, org.opendaylight.infrautils.jobcoordinator.JobCoordinator coordinator, java.lang.String jobDesc, java.lang.Runnable job)
      Runs a job task if the local node is the owner of an entity.
      void runOnlyInOwnerNode​(java.lang.String entityType, java.lang.String entityName, org.opendaylight.infrautils.jobcoordinator.JobCoordinator coordinator, java.lang.String jobKey, java.lang.String jobDesc, java.util.concurrent.Callable<java.util.List<? extends com.google.common.util.concurrent.ListenableFuture<?>>> job)
      Runs a job task if the local node is the owner of an entity.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EntityOwnershipUtils

        @Inject
        public EntityOwnershipUtils​(org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService entityOwnershipService)
    • Method Detail

      • getEntityOwnershipService

        public org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService getEntityOwnershipService()
      • isEntityOwner

        public boolean isEntityOwner​(java.lang.String entityType,
                                     java.lang.String entityName)
        Checks if the local node is the owner of an entity.
        Parameters:
        entityType - the entity type
        entityName - the entity name
        Returns:
        true is the owner, false otherwise
      • isEntityOwner

        public boolean isEntityOwner​(org.opendaylight.mdsal.eos.binding.api.Entity entity)
        Checks if the local node is the owner of an entity.
        Parameters:
        entity - the entity
        Returns:
        true is the owner, false otherwise
      • isEntityOwner

        public 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.
        Parameters:
        entity - the entity
        sleepBetweenRetries - the busy wait interval in millis if the entity is not yet present
        tries - the total number of busy wait tries
        Returns:
        true is the owner, false otherwise
      • runOnlyInOwnerNode

        public void runOnlyInOwnerNode​(java.lang.String entityType,
                                       java.lang.String entityName,
                                       org.opendaylight.infrautils.jobcoordinator.JobCoordinator coordinator,
                                       java.lang.String jobDesc,
                                       java.lang.Runnable job)
        Runs a job task if the local node is the owner of an entity.
        Parameters:
        entityType - the entity type
        entityName - the entity name
        coordinator - the JobCoordinator on which to run the job task
        jobDesc - description of the job for logging
        job - the job task
      • runOnlyInOwnerNode

        public void runOnlyInOwnerNode​(java.lang.String entityType,
                                       java.lang.String entityName,
                                       org.opendaylight.infrautils.jobcoordinator.JobCoordinator coordinator,
                                       java.lang.String jobKey,
                                       java.lang.String jobDesc,
                                       java.util.concurrent.Callable<java.util.List<? extends com.google.common.util.concurrent.ListenableFuture<?>>> job)
        Runs a job task if the local node is the owner of an entity.
        Parameters:
        entityType - the entity type
        entityName - the entity name
        coordinator - the JobCoordinator on which to run the job
        jobKey - the job key
        jobDesc - description of the job for logging
        job - the job task