@MetaInfServices public final class SimpleDOMEntityOwnershipService extends Object implements DOMEntityOwnershipService
DOMEntityOwnershipService
operating as an isolated island. It has no awareness of the world outside
of itself.Constructor and Description |
---|
SimpleDOMEntityOwnershipService() |
Modifier and Type | Method and Description |
---|---|
Optional<EntityOwnershipState> |
getOwnershipState(DOMEntity forEntity)
Gets the current ownership state information for an entity.
|
boolean |
isCandidateRegistered(DOMEntity forEntity)
Checks if a local candidate is registered for the given entity.
|
DOMEntityOwnershipCandidateRegistration |
registerCandidate(DOMEntity entity)
Registers a candidate for ownership of the given entity.
|
DOMEntityOwnershipListenerRegistration |
registerListener(String entityType,
DOMEntityOwnershipListener listener)
Registers a listener that is interested in ownership changes for entities of the given entity type.
|
String |
toString() |
public DOMEntityOwnershipCandidateRegistration registerCandidate(DOMEntity 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 GenericEntityOwnershipService<org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier,DOMEntity,DOMEntityOwnershipListener>
registerCandidate
in interface DOMEntityOwnershipService
entity
- the entity which the Candidate wants to ownCandidateAlreadyRegisteredException
- if the candidate was already registeredpublic DOMEntityOwnershipListenerRegistration registerListener(String entityType, DOMEntityOwnershipListener listener)
GenericEntityOwnershipService
registerListener
in interface GenericEntityOwnershipService<org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier,DOMEntity,DOMEntityOwnershipListener>
registerListener
in interface DOMEntityOwnershipService
entityType
- the type of entities whose ownership status the Listener is interested inlistener
- the listener that is interested in the entitiespublic Optional<EntityOwnershipState> getOwnershipState(DOMEntity forEntity)
GenericEntityOwnershipService
getOwnershipState
in interface GenericEntityOwnershipService<org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier,DOMEntity,DOMEntityOwnershipListener>
getOwnershipState
in interface DOMEntityOwnershipService
forEntity
- the entity to query.public boolean isCandidateRegistered(DOMEntity forEntity)
GenericEntityOwnershipService
isCandidateRegistered
in interface GenericEntityOwnershipService<org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier,DOMEntity,DOMEntityOwnershipListener>
isCandidateRegistered
in interface DOMEntityOwnershipService
forEntity
- the entity to query.Copyright © 2019 OpenDaylight. All rights reserved.