Package org.springframework.data.mongodb

Examples of org.springframework.data.mongodb.CannotGetMongoDbConnectionException


      mongoOptions = new MongoOptions();
    }

    if (!isNullOrEmpty(replicaPair)) {
      if (replicaPair.size() < 2) {
        throw new CannotGetMongoDbConnectionException("A replica pair must have two server entries");
      }
      mongo = new Mongo(replicaPair.get(0), replicaPair.get(1), mongoOptions);
    } else if (!isNullOrEmpty(replicaSetSeeds)) {
      mongo = new Mongo(replicaSetSeeds, mongoOptions);
    } else {
View Full Code Here


        String username = credentials.getUsername();
        String password = credentials.hasPassword() ? credentials.getPassword() : null;

        if (!authDb.authenticate(username, password == null ? null : password.toCharArray())) {
          throw new CannotGetMongoDbConnectionException("Failed to authenticate to database [" + databaseName + "], "
              + credentials.toString(), databaseName, credentials);
        }
      }
    }
View Full Code Here

TOP

Related Classes of org.springframework.data.mongodb.CannotGetMongoDbConnectionException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.