-
Notifications
You must be signed in to change notification settings - Fork 11
/
RandomContentPlugin.java
31 lines (27 loc) · 1.21 KB
/
RandomContentPlugin.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package com.lucidworks.connector.plugins.random;
import com.google.inject.AbstractModule;
import com.google.inject.Module;
import com.lucidworks.connector.components.generator.RandomContentGenerator;
import com.lucidworks.connector.components.generator.impl.DefaultRandomContentGenerator;
import com.lucidworks.connector.components.hostname.HostnameProvider;
import com.lucidworks.connector.plugins.random.config.RandomContentConfig;
import com.lucidworks.connector.plugins.random.fetcher.RandomContentFetcher;
import com.lucidworks.fusion.connector.plugin.api.plugin.ConnectorPlugin;
import com.lucidworks.fusion.connector.plugin.api.plugin.ConnectorPluginProvider;
public class RandomContentPlugin implements ConnectorPluginProvider {
@Override
public ConnectorPlugin get() {
Module fetchModule = new AbstractModule() {
@Override
protected void configure() {
bind(HostnameProvider.class).asEagerSingleton();
bind(RandomContentGenerator.class)
.to(DefaultRandomContentGenerator.class)
.asEagerSingleton();
}
};
return ConnectorPlugin.builder(RandomContentConfig.class)
.withFetcher("content", RandomContentFetcher.class, fetchModule)
.build();
}
}