@Service public class IntentSynchronizer extends Object implements IntentSynchronizationService, IntentSynchronizationAdminService
| Modifier and Type | Field and 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 |
| Constructor and Description |
|---|
IntentSynchronizer() |
| Modifier and Type | Method and Description |
|---|---|
void |
activate() |
protected 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.
|
@Reference(cardinality=MANDATORY_UNARY) protected org.onosproject.core.CoreService coreService
@Reference(cardinality=MANDATORY_UNARY) protected org.onosproject.cluster.LeadershipService leadershipService
@Reference(cardinality=MANDATORY_UNARY) protected org.onosproject.cluster.ClusterService clusterService
@Reference(cardinality=MANDATORY_UNARY) protected org.onosproject.net.intent.IntentService intentService
@Activate public void activate()
@Deactivate public void deactivate()
protected ExecutorService createExecutor()
Can be overridden to change the type of executor used.
public void removeIntents()
IntentSynchronizationAdminServiceremoveIntents in interface IntentSynchronizationAdminServicepublic void removeIntentsByAppId(org.onosproject.core.ApplicationId appId)
IntentSynchronizationServiceremoveIntentsByAppId in interface IntentSynchronizationServiceappId - the Id of the application that created the intents
to be removedpublic void submit(org.onosproject.net.intent.Intent intent)
IntentSynchronizationServiceThe 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.
submit in interface IntentSynchronizationServiceintent - intent to submitpublic void withdraw(org.onosproject.net.intent.Intent intent)
IntentSynchronizationServiceThe 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.
withdraw in interface IntentSynchronizationServiceintent - intent to withdrawpublic void modifyPrimary(boolean isPrimary)
IntentSynchronizationAdminServicemodifyPrimary in interface IntentSynchronizationAdminServiceisPrimary - true if the instance is primary, false if it is not