Class MongoComponent
java.lang.Object
org.ikasan.component.endpoint.mongo.MongoComponent
- All Implemented Interfaces:
org.ikasan.spec.configuration.Configured<MongoClientConfiguration>,org.ikasan.spec.configuration.ConfiguredResource<MongoClientConfiguration>,org.ikasan.spec.management.ManagedResource
public abstract class MongoComponent
extends Object
implements org.ikasan.spec.management.ManagedResource, org.ikasan.spec.configuration.ConfiguredResource<MongoClientConfiguration>
Abstract Mongo component which can be managed and configured.
- Author:
- Ikasan Development Team
-
Field Summary
FieldsModifier and TypeFieldDescriptionbson transformers that will be used when encoding from java types to bsonhandle to all referenced collectionsprotected MongoClientConfigurationconfigurationprotected com.mongodb.MongoClientinstantiated mongoclientprotected MongoClientProxyoptional proxy for sharing a Mongo clientprotected booleanset if the setter on MongoClient is used (so we don't close it)protected com.mongodb.DBhandle to mongoDB instance -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.mongodb.MongoClientbooleanvoidsetBsonEncodingTransformerMap(Map<Class<?>, List<org.bson.Transformer>> bsonEncodingTransformerMap) voidsetCollections(Map<String, com.mongodb.DBCollection> collections) voidsetConfiguration(MongoClientConfiguration configuration) voidsetConfiguredResourceId(String configuredResourceId) voidsetCriticalOnStartup(boolean isCriticalOnStartup) static voidsetLogger(org.slf4j.Logger logger) voidsetManagedResourceRecoveryManager(org.ikasan.spec.management.ManagedResourceRecoveryManager managedResourceRecoveryManager) voidsetMongoClient(com.mongodb.MongoClient mongoClient) voidsetMongoClientProxy(MongoClientProxy mongoClientProxy) voidsetMongoDatabase(com.mongodb.DB mongoDatabase) voidvoid
-
Field Details
-
configuration
configuration -
mongoClient
protected com.mongodb.MongoClient mongoClientinstantiated mongoclient -
mongoClientProxy
optional proxy for sharing a Mongo client -
collections
handle to all referenced collections -
mongoDatabase
protected com.mongodb.DB mongoDatabasehandle to mongoDB instance -
mongoClientSet
protected boolean mongoClientSetset if the setter on MongoClient is used (so we don't close it) -
bsonEncodingTransformerMap
bson transformers that will be used when encoding from java types to bson
-
-
Constructor Details
-
MongoComponent
public MongoComponent()
-
-
Method Details
-
setLogger
public static void setLogger(org.slf4j.Logger logger) -
setCollections
-
setMongoDatabase
public void setMongoDatabase(com.mongodb.DB mongoDatabase) -
setBsonEncodingTransformerMap
-
startManagedResource
public void startManagedResource()- Specified by:
startManagedResourcein interfaceorg.ikasan.spec.management.ManagedResource
-
stopManagedResource
public void stopManagedResource()- Specified by:
stopManagedResourcein interfaceorg.ikasan.spec.management.ManagedResource
-
setManagedResourceRecoveryManager
public void setManagedResourceRecoveryManager(org.ikasan.spec.management.ManagedResourceRecoveryManager managedResourceRecoveryManager) - Specified by:
setManagedResourceRecoveryManagerin interfaceorg.ikasan.spec.management.ManagedResource
-
isCriticalOnStartup
public boolean isCriticalOnStartup()- Specified by:
isCriticalOnStartupin interfaceorg.ikasan.spec.management.ManagedResource
-
setCriticalOnStartup
public void setCriticalOnStartup(boolean isCriticalOnStartup) - Specified by:
setCriticalOnStartupin interfaceorg.ikasan.spec.management.ManagedResource
-
getConfiguredResourceId
- Specified by:
getConfiguredResourceIdin interfaceorg.ikasan.spec.configuration.ConfiguredResource<MongoClientConfiguration>
-
setConfiguredResourceId
- Specified by:
setConfiguredResourceIdin interfaceorg.ikasan.spec.configuration.ConfiguredResource<MongoClientConfiguration>
-
getConfiguration
- Specified by:
getConfigurationin interfaceorg.ikasan.spec.configuration.Configured<MongoClientConfiguration>
-
setConfiguration
- Specified by:
setConfigurationin interfaceorg.ikasan.spec.configuration.Configured<MongoClientConfiguration>
-
getMongoClientProxy
-
setMongoClientProxy
-
getMongoClient
public com.mongodb.MongoClient getMongoClient() -
setMongoClient
public void setMongoClient(com.mongodb.MongoClient mongoClient)
-