public class BindingDOMEntityOwnershipServiceAdapter extends Object implements EntityOwnershipService, AutoCloseable
| Constructor and Description |
|---|
BindingDOMEntityOwnershipServiceAdapter(DOMEntityOwnershipService domService,
BindingNormalizedNodeSerializer conversionCodec) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
com.google.common.base.Optional<EntityOwnershipState> |
getOwnershipState(Entity forEntity)
Gets the current ownership state information for an entity.
|
boolean |
isCandidateRegistered(Entity forEntity)
Checks if a local candidate is registered for the given entity.
|
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 BindingDOMEntityOwnershipServiceAdapter(@Nonnull DOMEntityOwnershipService domService, @Nonnull BindingNormalizedNodeSerializer conversionCodec)
public EntityOwnershipCandidateRegistration registerCandidate(Entity entity) throws CandidateAlreadyRegisteredException
GenericEntityOwnershipServiceThe registration is performed asynchronously and any registered entity ownership listener is notified of ownership status changes for the entity.
registerCandidate in interface EntityOwnershipServiceregisterCandidate in interface GenericEntityOwnershipService<InstanceIdentifier<?>,Entity,EntityOwnershipListener>entity - the entity which the Candidate wants to ownCandidateAlreadyRegisteredException - if the candidate was already registeredpublic EntityOwnershipListenerRegistration registerListener(String entityType, EntityOwnershipListener listener)
GenericEntityOwnershipServiceregisterListener in interface EntityOwnershipServiceregisterListener in interface GenericEntityOwnershipService<InstanceIdentifier<?>,Entity,EntityOwnershipListener>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)
GenericEntityOwnershipServicegetOwnershipState in interface EntityOwnershipServicegetOwnershipState in interface GenericEntityOwnershipService<InstanceIdentifier<?>,Entity,EntityOwnershipListener>forEntity - the entity to query.public boolean isCandidateRegistered(Entity forEntity)
GenericEntityOwnershipServiceisCandidateRegistered in interface EntityOwnershipServiceisCandidateRegistered in interface GenericEntityOwnershipService<InstanceIdentifier<?>,Entity,EntityOwnershipListener>forEntity - the entity to query.public void close()
close in interface AutoCloseableCopyright © 2018 OpenDaylight. All rights reserved.