@Immutable class MongoAuthority extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
MongoAuthority.Type
Enumeration of the connection types.
|
| Modifier and Type | Field and Description |
|---|---|
private MongoCredentialsStore |
credentialsStore |
private java.util.List<ServerAddress> |
serverAddresses |
private MongoAuthority.Type |
type |
| Modifier | Constructor and Description |
|---|---|
private |
MongoAuthority(java.util.List<ServerAddress> serverAddresses,
MongoAuthority.Type type,
MongoCredentialsStore credentialsStore)
Constructs an instance with a list of server addresses, which may either be a list of mongos servers
or a list of members of a replica set, and a store of authentication credentials.
|
private |
MongoAuthority(ServerAddress serverAddress,
MongoCredentialsStore credentialsStore)
Constructs an instance with a single server address and a store of authentication credentials.
|
| Modifier and Type | Method and Description |
|---|---|
static MongoAuthority |
direct(ServerAddress serverAddress) |
static MongoAuthority |
direct(ServerAddress serverAddress,
MongoCredential credentials) |
static MongoAuthority |
direct(ServerAddress serverAddress,
MongoCredentialsStore credentialsStore) |
static MongoAuthority |
dynamicSet(java.util.List<ServerAddress> serverAddresses) |
static MongoAuthority |
dynamicSet(java.util.List<ServerAddress> serverAddresses,
MongoCredential credentials) |
static MongoAuthority |
dynamicSet(java.util.List<ServerAddress> serverAddresses,
MongoCredentialsStore credentialsStore) |
boolean |
equals(java.lang.Object o) |
MongoCredentialsStore |
getCredentialsStore()
Gets the credentials store.
|
java.util.List<ServerAddress> |
getServerAddresses()
Returns the list of server addresses.
|
MongoAuthority.Type |
getType()
Gets the authority type
|
int |
hashCode() |
java.lang.String |
toString() |
private final MongoAuthority.Type type
private final java.util.List<ServerAddress> serverAddresses
private final MongoCredentialsStore credentialsStore
private MongoAuthority(ServerAddress serverAddress, MongoCredentialsStore credentialsStore)
serverAddress - the server address of a mongo serverprivate MongoAuthority(java.util.List<ServerAddress> serverAddresses, MongoAuthority.Type type, MongoCredentialsStore credentialsStore)
serverAddresses - the server addressescredentialsStore - the credentials storepublic static MongoAuthority direct(ServerAddress serverAddress)
serverAddress - public static MongoAuthority direct(ServerAddress serverAddress, MongoCredential credentials)
serverAddress - credentials - public static MongoAuthority direct(ServerAddress serverAddress, MongoCredentialsStore credentialsStore)
serverAddress - credentialsStore - public static MongoAuthority dynamicSet(java.util.List<ServerAddress> serverAddresses)
serverAddresses - public static MongoAuthority dynamicSet(java.util.List<ServerAddress> serverAddresses, MongoCredential credentials)
serverAddresses - credentials - public static MongoAuthority dynamicSet(java.util.List<ServerAddress> serverAddresses, MongoCredentialsStore credentialsStore)
serverAddresses - credentialsStore - public java.util.List<ServerAddress> getServerAddresses()
public MongoCredentialsStore getCredentialsStore()
public MongoAuthority.Type getType()
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object