1
|
package eu.dnetlib.data.objectstore.filesystem;
|
2
|
|
3
|
import com.mongodb.MongoClientOptions;
|
4
|
import org.springframework.beans.BeansException;
|
5
|
import org.springframework.beans.factory.FactoryBean;
|
6
|
|
7
|
public class MongoFSOptionsFactory implements FactoryBean<MongoClientOptions> {
|
8
|
|
9
|
private int connectionsPerHost;
|
10
|
|
11
|
@Override
|
12
|
public MongoClientOptions getObject() throws BeansException {
|
13
|
return MongoClientOptions.builder().connectionsPerHost(connectionsPerHost).build();
|
14
|
}
|
15
|
|
16
|
@Override
|
17
|
public Class<MongoClientOptions> getObjectType() {
|
18
|
return MongoClientOptions.class;
|
19
|
}
|
20
|
|
21
|
@Override
|
22
|
public boolean isSingleton() {
|
23
|
return false;
|
24
|
}
|
25
|
|
26
|
public int getConnectionsPerHost() {
|
27
|
return connectionsPerHost;
|
28
|
}
|
29
|
|
30
|
public void setConnectionsPerHost(final int connectionsPerHost) {
|
31
|
this.connectionsPerHost = connectionsPerHost;
|
32
|
}
|
33
|
|
34
|
}
|