Interface DomainManager
-
- All Known Implementing Classes:
AbstractDomainManager
,ConnectionBasedDomainManager
,ZookeeperDomainManager
public interface DomainManager
A manager that is responsible for registering and deregistering clients for a given domain.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
deregister(java.lang.String id)
Deregister with the domain being managed.boolean
isAnythingRegistered()
Checks if anything is currently registered with the domain being managed.boolean
isRegistered(java.lang.String id)
Checks if a given Id is registered.void
register(java.lang.String id, RoleChangeHandler roleChangeHandler)
Register with the domain being managed.
-
-
-
Method Detail
-
register
void register(java.lang.String id, RoleChangeHandler roleChangeHandler)
Register with the domain being managed. This is a non-blocking call.Ids must be unique to this manager. Attempting to register the same Id twice will result in an exception.
The methods specified by the
RoleChangeHandler
passed to this method must not block.- Parameters:
id
- the Id to registerroleChangeHandler
- the role change handler to register
-
deregister
void deregister(java.lang.String id)
Deregister with the domain being managed. This is a non-blocking call.- Parameters:
id
- the Id to register
-
isRegistered
boolean isRegistered(java.lang.String id)
Checks if a given Id is registered.- Parameters:
id
- the Id to check- Returns:
- true if registered, false otherwise
-
isAnythingRegistered
boolean isAnythingRegistered()
Checks if anything is currently registered with the domain being managed.- Returns:
- true if one or more registrants are currently registered, false otherwise
-
-