public class MongoDBComponent extends DefaultComponent implements MongoDBConnectionService
MongoClient
directly, because it's this
component which is responsible for creating and closing it.Modifier and Type | Field and Description |
---|---|
static String |
COMPONENT_NAME |
lastModified, name
Constructor and Description |
---|
MongoDBComponent() |
Modifier and Type | Method and Description |
---|---|
int |
getApplicationStartedOrder()
The component notification order for
Component.applicationStarted(org.nuxeo.runtime.model.ComponentContext) . |
com.mongodb.client.MongoDatabase |
getDatabase(String id) |
Iterable<com.mongodb.client.MongoDatabase> |
getDatabases() |
void |
start(ComponentContext context)
Start the component.
|
void |
stop(ComponentContext context)
Stop the component.
|
activate, deactivate, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerContribution, registerExtension, setLastModified, setModifiedNow, setName, unregister, unregisterContribution, unregisterExtension
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applicationStarted
public static final String COMPONENT_NAME
public MongoDBComponent()
public void start(ComponentContext context)
Component
start
in interface Component
start
in class DefaultComponent
public void stop(ComponentContext context) throws InterruptedException
Component
stop
in interface Component
stop
in class DefaultComponent
InterruptedException
public int getApplicationStartedOrder()
Component
Component.applicationStarted(org.nuxeo.runtime.model.ComponentContext)
.
Components are notified in increasing order. Order 1000 is the default order for components that don't care. Order 100 is the repository initialization.
getApplicationStartedOrder
in interface Component
public com.mongodb.client.MongoDatabase getDatabase(String id)
getDatabase
in interface MongoDBConnectionService
id
- the connection id to retrieve.MongoDBConnectionConfig
for the input id, or the default one if it
doesn't existpublic Iterable<com.mongodb.client.MongoDatabase> getDatabases()
getDatabases
in interface MongoDBConnectionService
Copyright © 2019 Nuxeo. All rights reserved.