use of com.mongodb.SubjectProvider in project mongo-java-driver by mongodb.
the class SaslAuthenticator method getSubjectProvider.
@NonNull
private SubjectProvider getSubjectProvider() {
synchronized (getMongoCredentialWithCache()) {
SubjectProvider subjectProvider = getMongoCredentialWithCache().getFromCache(SUBJECT_PROVIDER_CACHE_KEY, SubjectProvider.class);
if (subjectProvider == null) {
subjectProvider = getMongoCredential().getMechanismProperty(JAVA_SUBJECT_PROVIDER_KEY, null);
if (subjectProvider == null) {
subjectProvider = getDefaultSubjectProvider();
}
getMongoCredentialWithCache().putInCache(SUBJECT_PROVIDER_CACHE_KEY, subjectProvider);
}
return subjectProvider;
}
}
Aggregations