Class IntentSynchronizer

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.onosproject.cluster.ClusterService clusterService  
      protected org.onosproject.core.CoreService coreService  
      protected org.onosproject.net.intent.IntentService intentService  
      protected org.onosproject.cluster.LeadershipService leadershipService  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void activate()  
      protected java.util.concurrent.ExecutorService createExecutor()
      Creates an executor that will be used for synchronization tasks.
      void deactivate()  
      void modifyPrimary​(boolean isPrimary)
      Changes whether this instance is the primary or not based on the boolean parameter.
      void removeIntents()
      Withdraws all intents.
      void removeIntentsByAppId​(org.onosproject.core.ApplicationId appId)
      Withdraws intents by app Id.
      void submit​(org.onosproject.net.intent.Intent intent)
      Submits and intent to the synchronizer.
      void withdraw​(org.onosproject.net.intent.Intent intent)
      Withdraws an intent from the synchronizer.
      • Methods inherited from class java.lang.Object

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

      • coreService

        protected org.onosproject.core.CoreService coreService
      • leadershipService

        protected org.onosproject.cluster.LeadershipService leadershipService
      • clusterService

        protected org.onosproject.cluster.ClusterService clusterService
      • intentService

        protected org.onosproject.net.intent.IntentService intentService
    • Constructor Detail

      • IntentSynchronizer

        public IntentSynchronizer()
    • Method Detail

      • activate

        public void activate()
      • deactivate

        public void deactivate()
      • createExecutor

        protected java.util.concurrent.ExecutorService createExecutor()
        Creates an executor that will be used for synchronization tasks.

        Can be overridden to change the type of executor used.

        Returns:
        executor service
      • submit

        public void submit​(org.onosproject.net.intent.Intent intent)
        Description copied from interface: IntentSynchronizationService
        Submits and intent to the synchronizer.

        The intent will be submitted directly to the IntentService if this node is the leader, otherwise it will be stored in the synchronizer for synchronization if this node becomes the leader.

        Specified by:
        submit in interface IntentSynchronizationService
        Parameters:
        intent - intent to submit
      • withdraw

        public void withdraw​(org.onosproject.net.intent.Intent intent)
        Description copied from interface: IntentSynchronizationService
        Withdraws an intent from the synchronizer.

        The intent will be withdrawn directly from the IntentService if this node is the leader. The intent will be removed from the synchronizer's in-memory storage.

        Specified by:
        withdraw in interface IntentSynchronizationService
        Parameters:
        intent - intent to withdraw