public class BindingDOMEntityOwnershipServiceAdapter extends Object implements EntityOwnershipService, AutoCloseable
Constructor and Description |
---|
BindingDOMEntityOwnershipServiceAdapter(@NonNull DOMEntityOwnershipService domService,
@NonNull BindingNormalizedNodeSerializer conversionCodec) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
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
GenericEntityOwnershipService
The registration is performed asynchronously and any registered entity ownership listener is notified of ownership status changes for the entity.
registerCandidate
in interface EntityOwnershipService
registerCandidate
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)
GenericEntityOwnershipService
registerListener
in interface EntityOwnershipService
registerListener
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 Optional<EntityOwnershipState> getOwnershipState(Entity forEntity)
GenericEntityOwnershipService
getOwnershipState
in interface EntityOwnershipService
getOwnershipState
in interface GenericEntityOwnershipService<InstanceIdentifier<?>,Entity,EntityOwnershipListener>
forEntity
- the entity to query.public boolean isCandidateRegistered(Entity forEntity)
GenericEntityOwnershipService
isCandidateRegistered
in interface EntityOwnershipService
isCandidateRegistered
in interface GenericEntityOwnershipService<InstanceIdentifier<?>,Entity,EntityOwnershipListener>
forEntity
- the entity to query.public void close()
close
in interface AutoCloseable
Copyright © 2019 OpenDaylight. All rights reserved.