P
- the instance identifier path typeE
- the GenericEntity typepublic interface GenericEntityOwnershipService<P extends org.opendaylight.yangtools.concepts.Path<P>,E extends GenericEntity<P>,L extends GenericEntityOwnershipListener<P,? extends GenericEntityOwnershipChange<P,E>>>
An interface that provides the means for a component/application to request ownership for a given Entity on the current cluster member. Entity ownership is always tied to a process and two components on the same process cannot register a candidate for a given Entity.
A component/application may also register interest in the ownership status of an Entity. The listener would be notified whenever the ownership status changes.
Modifier and Type | Method and Description |
---|---|
Optional<EntityOwnershipState> |
getOwnershipState(E forEntity)
Gets the current ownership state information for an entity.
|
boolean |
isCandidateRegistered(E forEntity)
Checks if a local candidate is registered for the given entity.
|
GenericEntityOwnershipCandidateRegistration<P,E> |
registerCandidate(E entity)
Registers a candidate for ownership of the given entity.
|
GenericEntityOwnershipListenerRegistration<P,L> |
registerListener(@NonNull String entityType,
L listener)
Registers a listener that is interested in ownership changes for entities of the given entity type.
|
GenericEntityOwnershipCandidateRegistration<P,E> registerCandidate(E entity) throws CandidateAlreadyRegisteredException
The registration is performed asynchronously and any registered entity ownership listener is notified of ownership status changes for the entity.
entity
- the entity which the Candidate wants to ownCandidateAlreadyRegisteredException
- if the candidate was already registeredGenericEntityOwnershipListenerRegistration<P,L> registerListener(@NonNull String entityType, L listener)
entityType
- the type of entities whose ownership status the Listener is interested inlistener
- the listener that is interested in the entitiesOptional<EntityOwnershipState> getOwnershipState(E forEntity)
forEntity
- the entity to query.boolean isCandidateRegistered(E forEntity)
forEntity
- the entity to query.Copyright © 2019 OpenDaylight. All rights reserved.