List of usage examples for com.mongodb MongoClientSettings getClusterSettings
public ClusterSettings getClusterSettings()
From source file:com.navercorp.pinpoint.plugin.mongo.interceptor.MongoDriverConnectInterceptor3_7.java
License:Apache License
private List<String> getHostList(Object arg) { if (!(arg instanceof MongoClientSettings)) { return Collections.emptyList(); }//from w w w .j a va2 s . c om final MongoClientSettings mongoClientSettings = (MongoClientSettings) arg; List<ServerAddress> lists = mongoClientSettings.getClusterSettings().getHosts(); final List<String> hostList = new ArrayList<String>(); for (ServerAddress sa : lists) { final String hostAddress = HostAndPort.toHostAndPortString(sa.getHost(), sa.getPort()); hostList.add(hostAddress); } return hostList; }