public abstract class TestEntityOwnershipService extends Object implements EntityOwnershipService
Constructor and Description |
---|
TestEntityOwnershipService() |
Modifier and Type | Method and Description |
---|---|
com.google.common.base.Optional<EntityOwnershipState> |
getOwnershipState(Entity forEntity)
Gets the current ownership state information for an entity.
|
boolean |
isCandidateRegistered(Entity entity)
Check if a local candidate is registered for the given entity
|
static EntityOwnershipService |
newInstance() |
EntityOwnershipCandidateRegistration |
registerCandidate(Entity entity)
Registers a candidate for ownership of the given entity.
|
EntityOwnershipListenerRegistration |
registerListener(String entityType,
EntityOwnershipListener listener)
Registers a listener that is interested in ownership changes for entities of the given entity type.
|
public static EntityOwnershipService newInstance()
public EntityOwnershipCandidateRegistration registerCandidate(Entity entity)
EntityOwnershipService
The registration is performed asynchronously and any registered EntityOwnershipListener
is
notified of ownership status changes for the entity.
registerCandidate
in interface EntityOwnershipService
entity
- the entity which the Candidate wants to ownpublic EntityOwnershipListenerRegistration registerListener(String entityType, EntityOwnershipListener listener)
EntityOwnershipService
registerListener
in interface EntityOwnershipService
entityType
- the type of entities whose ownership status the Listener is interested inlistener
- the listener that is interested in the entitiespublic com.google.common.base.Optional<EntityOwnershipState> getOwnershipState(Entity forEntity)
EntityOwnershipService
getOwnershipState
in interface EntityOwnershipService
forEntity
- the entity to query.public boolean isCandidateRegistered(Entity entity)
EntityOwnershipService
isCandidateRegistered
in interface EntityOwnershipService
Copyright © 2019 OpenDaylight. All rights reserved.