title: mongo java driver 2.14.0. Change Deprecated code
body: <p>I am upgrading mongo java driver jar to 2.14.0. my old code working fine but following code showing deprecated classes and constructor so I need compatible code without deprecated classes and constructor for mongo-java-driver.jar 2.14.0.</p>
  
  <pre><code>public MongoTemplate getMongoTemplate() {
  
      SimpleMongoDbFactory simpleMongoDbFactory = null;
  
      try {
  
          MongoOptions opts = new MongoOptions();//depricate
  
          opts.threadsAllowedToBlockForConnectionMultiplier = getThreadsAllowedToBlockForConnectionMultiplier();//depricate
  
          opts.connectionsPerHost = getConnectionsPerHost();//depricate
  
          ServerAddress addr = new ServerAddress(getHost(), getPort());
  
          Mongo mongo = new Mongo(addr, opts);//depricate
  
          simpleMongoDbFactory = new SimpleMongoDbFactory(mongo,
                  getDatabaseName());//depricate
  
          if (mongoTemplate == null) {
  
              mongoTemplate = new MongoTemplate(simpleMongoDbFactory);
  
          }
  
      } catch (UnknownHostException e) {
  
          LOGGER.error(e.getMessage());
  
      } catch (MongoException e) {
  
          LOGGER.error(e.getMessage());
  
      }
  
      return mongoTemplate;
  }
  </code></pre>