public class DefaultHaProvider extends Object implements HaProvider
| Constructor and Description |
|---|
DefaultHaProvider(HaDescriptor descriptor) |
| Modifier and Type | Method and Description |
|---|---|
void |
addHaService(String serviceName,
List<String> urls)
Add a service name (role) as a HA service with the URLs that it is configured for
|
String |
getActiveURL(String serviceName)
Returns the current URL that is known to be active for the service
|
HaDescriptor |
getHaDescriptor() |
boolean |
isHaEnabled(String serviceName)
Returns whether the service is enabled for HA
|
void |
markFailedURL(String serviceName,
String url)
Mark the URL for the service as one that has failed.
|
public DefaultHaProvider(HaDescriptor descriptor)
public HaDescriptor getHaDescriptor()
getHaDescriptor in interface HaProviderpublic void addHaService(String serviceName, List<String> urls)
HaProvideraddHaService in interface HaProviderserviceName - the name of the serviceurls - the list of urls that can be used for that servicepublic boolean isHaEnabled(String serviceName)
HaProviderisHaEnabled in interface HaProviderserviceName - the name of the servicepublic String getActiveURL(String serviceName)
HaProvidergetActiveURL in interface HaProviderserviceName - the name of the servicepublic void markFailedURL(String serviceName, String url)
HaProvidermarkFailedURL in interface HaProviderserviceName - the name of the serviceurl - the URL that has failed in some wayCopyright © 2014 Apache Software Foundation. All rights reserved.