public final class EndpointGroupRegistry
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static EndpointGroup |
get(java.lang.String groupName)
Get the
EndpointGroup for the specified case-insensitive groupName . |
static EndpointSelector |
getNodeSelector(java.lang.String groupName)
Returns the
EndpointSelector for the specified case-insensitive groupName . |
static boolean |
register(java.lang.String groupName,
EndpointGroup endpointGroup,
EndpointSelectionStrategy endpointSelectionStrategy)
Registers the specified
EndpointGroup . |
static Endpoint |
selectNode(java.lang.String groupName)
Selects an
Endpoint from the EndpointGroup associated with the specified
case-insensitive groupName . |
static boolean |
unregister(java.lang.String groupName)
Unregisters the
EndpointGroup with the specified case-insensitive groupName . |
public static boolean register(java.lang.String groupName, EndpointGroup endpointGroup, EndpointSelectionStrategy endpointSelectionStrategy)
EndpointGroup
. If there's already an EndpointGroup
with the
specified groupName
, this method will replace it with the new one.groupName
- the case-insensitive name of the EndpointGroup
that matches
the regular expression /^[-_.0-9a-zA-Z]+$/
endpointGroup
- the EndpointGroup
to registerendpointSelectionStrategy
- the EndpointSelectionStrategy
of the registered grouptrue
if there was no EndpointGroup
with the specified groupName
.
false
if there was already an EndpointGroup
with the specified groupName
and it has been replaced with the new one.public static boolean unregister(java.lang.String groupName)
EndpointGroup
with the specified case-insensitive groupName
.
Note that this is potentially a dangerous operation; make sure the groupName
of the unregistered
EndpointGroup
is not in use by any clients.true
if the EndpointGroup
with the specified groupName
has been removed.
false
if there's no such EndpointGroup
in the registry.public static EndpointSelector getNodeSelector(java.lang.String groupName)
EndpointSelector
for the specified case-insensitive groupName
.EndpointSelector
, or null
if groupName
has not been registered yet.public static EndpointGroup get(java.lang.String groupName)
EndpointGroup
for the specified case-insensitive groupName
.EndpointSelector
, or null
if groupName
has not been registered yet.public static Endpoint selectNode(java.lang.String groupName)
Endpoint
from the EndpointGroup
associated with the specified
case-insensitive groupName
.