public class MasterSlaveConfigurationUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
ACTIVE_DATA_CENTER |
static String |
COMPONENT_NAME |
static String |
INSTANCE_ID |
| Constructor and Description |
|---|
MasterSlaveConfigurationUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
enableAuthentication(String user,
String password)
call this method first if you want to enable authenticated mongo db access
|
static String |
getComponentName() |
static String |
getMasterSlaveImpl() |
static int |
getMasterSlaveLeaseTime(String name) |
static MasterSlaveMultiplicity |
getMasterSlaveMultiplicity(String name) |
static String |
getMongodbName() |
static List<org.apache.commons.lang3.tuple.Pair<String,Integer>> |
getMongodbServers()
read pairs of host and port from configuration.
|
static org.apache.commons.lang3.tuple.Pair<String,String> |
getMongoUserCredentials() |
static String |
getUniqueProcessName() |
static boolean |
isMongoAuthenticationEnabled() |
static boolean |
isSingleAcrossMDC(String name) |
static boolean |
isSingleAcrossVersion(String name) |
static void |
setMongodbServerConfigPrefix(String mongodbServerConfigPrefix)
When set to read mongo servers from configuration you can override the configuration prefix using this method.
|
static void |
setMongodbServers(List<org.apache.commons.lang3.tuple.Pair<String,Integer>> mongodbServers)
Use this API if you want to external set the mongo servers list and prevent the lib from fetching the info from configuration
|
public static final String INSTANCE_ID
public static final String COMPONENT_NAME
public static final String ACTIVE_DATA_CENTER
public static void setMongodbServerConfigPrefix(String mongodbServerConfigPrefix)
mongodbServerConfigPrefix - - the new prefix. default is: 'mongodb'.public static void setMongodbServers(List<org.apache.commons.lang3.tuple.Pair<String,Integer>> mongodbServers)
mongodbServers - public static List<org.apache.commons.lang3.tuple.Pair<String,Integer>> getMongodbServers()
public static void enableAuthentication(String user, String password)
user - the db userpassword - teh db paswordpublic static boolean isMongoAuthenticationEnabled()
public static org.apache.commons.lang3.tuple.Pair<String,String> getMongoUserCredentials()
public static String getMasterSlaveImpl()
public static String getMongodbName()
public static int getMasterSlaveLeaseTime(String name)
name - the logical name used in the registry classpublic static MasterSlaveMultiplicity getMasterSlaveMultiplicity(String name)
public static boolean isSingleAcrossMDC(String name)
public static boolean isSingleAcrossVersion(String name)
public static String getUniqueProcessName()
public static String getComponentName()
Copyright © 2016 Cisco. All rights reserved.