Fix compile and some minor formatting errors

This commit is contained in:
Luck 2018-02-20 20:15:48 +00:00
parent 9c92522564
commit da9977a30f
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
6 changed files with 11 additions and 11 deletions

View File

@ -328,7 +328,7 @@ data:
# The prefix to use for all LuckPerms collections. Change this if you want to use different
# collections for different servers. The default is no prefix.
mongodb_collection_prefix: ''
# MongoDB ClientConnectionURI for use with replicasets and custom connection options
# See https://docs.mongodb.com/manual/reference/connection-string/
mongodb_connection_URI: ''

View File

@ -270,7 +270,7 @@ data:
# The prefix to use for all LuckPerms collections. Change this if you want to use different
# collections for different servers. The default is no prefix.
mongodb_collection_prefix: ''
# MongoDB ClientConnectionURI for use with replicasets and custom connection options
# See https://docs.mongodb.com/manual/reference/connection-string/
mongodb_connection_URI: ''

View File

@ -404,12 +404,12 @@ public class ConfigKeys {
* The prefix for any MongoDB collections
*/
public static final ConfigKey<String> MONGODB_COLLECTION_PREFIX = EnduringKey.wrap(StringKey.of("data.mongodb_collection_prefix", ""));
/**
* MongoDB ClientConnectionURI to override default connection options
*/
public static final ConfigKey<String> MONGODB_CONNECTION_URI = EnduringKey.wrap(StringKey.of("data.mongodb_connection_URI", ""));
/**
* The name of the storage method being used
*/

View File

@ -78,19 +78,19 @@ public class MongoDao extends AbstractDao {
private MongoClient mongoClient;
private MongoDatabase database;
private final String prefix;
private final String connectionURI;
private final String connectionUri;
public MongoDao(LuckPermsPlugin plugin, StorageCredentials configuration, String prefix, String connectionURI) {
public MongoDao(LuckPermsPlugin plugin, StorageCredentials configuration, String prefix, String connectionUri) {
super(plugin, "MongoDB");
this.configuration = configuration;
this.prefix = prefix;
this.connectionURI = connectionURI;
this.connectionUri = connectionUri;
}
@Override
public void init() {
if (!Strings.isNullOrempty(this.connectionURI)) {
this.mongoClient = new MongoClient(new MongoClientURI(this.connectionURI));
if (!Strings.isNullOrEmpty(this.connectionUri)) {
this.mongoClient = new MongoClient(new MongoClientURI(this.connectionUri));
} else {
MongoCredential credential = null;
if (!Strings.isNullOrEmpty(this.configuration.getUsername())) {

View File

@ -328,7 +328,7 @@ data:
# The prefix to use for all LuckPerms collections. Change this if you want to use different
# collections for different servers. The default is no prefix.
mongodb_collection_prefix: ''
# MongoDB ClientConnectionURI for use with replicasets and custom connection options
# See https://docs.mongodb.com/manual/reference/connection-string/
mongodb_connection_URI: ''

View File

@ -277,7 +277,7 @@ data {
# The prefix to use for all LuckPerms collections. Change this if you want to use different
# collections for different servers. The default is no prefix.
mongodb_collection_prefix=""
# MongoDB ClientConnectionURI for use with replicasets and custom connection options
# See https://docs.mongodb.com/manual/reference/connection-string/
mongodb_connection_URI=""