Created
January 14, 2012 16:11
-
-
Save efroese/1611905 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@SuppressWarnings("unchecked") | |
public MongoClient(DB mongodb, Map<String,Object> props) { | |
this.mongodb = mongodb; | |
this.props = props; | |
String user = StorageClientUtils.getSetting(props.get(MongoClientPool.PROP_MONGO_USER), null); | |
String password = StorageClientUtils.getSetting(props.get(MongoClientPool.PROP_MONGO_USER), null); | |
if (user != null && password != null && !this.mongodb.isAuthenticated()){ | |
if (!this.mongodb.authenticate(user, password.toCharArray())){ | |
throw new MongoException("Unable to authenticate"); | |
} | |
} | |
this.alternateKeys = (Map<String,String>)props.get(MongoClientPool.PROP_ALT_KEYS); | |
this.streamedContentHelper = new GridFSContentHelper(mongodb, this, props); | |
this.mongodb.requestStart(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment