public class DefaultMongoConnectionFactoryProvider extends Object implements MongoConnectionProviderFactory, ServerInfoAwareProviderFactory
Modifier and Type | Field and Description |
---|---|
protected Config.Scope |
config |
Constructor and Description |
---|
DefaultMongoConnectionFactoryProvider() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkBooleanOption(String optionName,
com.mongodb.MongoClientOptions.Builder builder) |
protected void |
checkIntOption(String optionName,
com.mongodb.MongoClientOptions.Builder builder) |
void |
close()
This is called when the server shuts down.
|
MongoConnectionProvider |
create(KeycloakSession session) |
protected com.mongodb.MongoClient |
createMongoClient()
Override this method if you want more possibility to configure Mongo client.
|
protected com.mongodb.MongoClientOptions |
getClientOptions() |
com.mongodb.DB |
getDBBeforeUpdate() |
String |
getId() |
Map<String,String> |
getOperationalInfo()
Return actual info about the provider.
|
void |
init(Config.Scope config)
Only called once when the factory is first created.
|
void |
postInit(KeycloakSessionFactory factory)
Called after all provider factories have been initialized
|
protected void |
updateOrValidateDB(String databaseSchema,
KeycloakSession session,
MongoUpdaterProvider mongoUpdater) |
protected Config.Scope config
public DefaultMongoConnectionFactoryProvider()
public void init(Config.Scope config)
ProviderFactory
init
in interface ProviderFactory<MongoConnectionProvider>
public void postInit(KeycloakSessionFactory factory)
ProviderFactory
postInit
in interface ProviderFactory<MongoConnectionProvider>
public com.mongodb.DB getDBBeforeUpdate()
getDBBeforeUpdate
in interface MongoConnectionProviderFactory
public MongoConnectionProvider create(KeycloakSession session)
create
in interface ProviderFactory<MongoConnectionProvider>
protected void updateOrValidateDB(String databaseSchema, KeycloakSession session, MongoUpdaterProvider mongoUpdater)
public void close()
ProviderFactory
close
in interface ProviderFactory<MongoConnectionProvider>
public String getId()
getId
in interface ProviderFactory<MongoConnectionProvider>
protected com.mongodb.MongoClient createMongoClient() throws UnknownHostException
UnknownHostException
protected com.mongodb.MongoClientOptions getClientOptions()
protected void checkBooleanOption(String optionName, com.mongodb.MongoClientOptions.Builder builder)
protected void checkIntOption(String optionName, com.mongodb.MongoClientOptions.Builder builder)
public Map<String,String> getOperationalInfo()
ServerInfoAwareProviderFactory
getOperationalInfo
in interface ServerInfoAwareProviderFactory
Copyright © 2016 JBoss by Red Hat. All rights reserved.