/** * Creates a new {@code MongoOptions} with the given options. This class is deprecated, use {@link com.mongodb.MongoClientOptions}. * * @param options the MongoClientOptions to copy values from into the new MongoOptions. * @deprecated use {@link com.mongodb.MongoClientOptions} */ @SuppressWarnings("deprecation") @Deprecated public MongoOptions(final MongoClientOptions options) { connectionsPerHost = options.getConnectionsPerHost(); threadsAllowedToBlockForConnectionMultiplier = options.getThreadsAllowedToBlockForConnectionMultiplier(); maxWaitTime = options.getMaxWaitTime(); connectTimeout = options.getConnectTimeout(); socketFactory = options.getSocketFactory(); socketTimeout = options.getSocketTimeout(); socketKeepAlive = options.isSocketKeepAlive(); readPreference = options.getReadPreference(); dbDecoderFactory = options.getDbDecoderFactory(); dbEncoderFactory = options.getDbEncoderFactory(); description = options.getDescription(); writeConcern = options.getWriteConcern(); alwaysUseMBeans = options.isAlwaysUseMBeans(); requiredReplicaSetName = options.getRequiredReplicaSetName(); }
private static ClusterSettings getClusterSettings(final List<ServerAddress> seedList, final MongoClientOptions options, final ClusterConnectionMode clusterConnectionMode) { ClusterSettings.Builder builder = ClusterSettings.builder() .hosts(new ArrayList<ServerAddress>(seedList)) .mode(clusterConnectionMode) .requiredReplicaSetName(options.getRequiredReplicaSetName()) .serverSelectionTimeout(options.getServerSelectionTimeout(), MILLISECONDS) .localThreshold(options.getLocalThreshold(), MILLISECONDS) .serverSelector(options.getServerSelector()) .description(options.getDescription()) .maxWaitQueueSize(options.getConnectionPoolSettings().getMaxWaitQueueSize()); for (ClusterListener clusterListener: options.getClusterListeners()) { builder.addClusterListener(clusterListener); } return builder.build(); }
description = options.getDescription(); applicationName = options.getApplicationName(); compressorList = options.getCompressorList();
@Override public Map<String, ?> properties(RequestContext ctx) throws Exception { Map properties = new HashMap<>(); properties.put(DESCRIPTION, mongoClientOptions.getDescription()); properties.put(CONNECTIONS_PER_HOST, mongoClientOptions.getConnectionsPerHost()); properties.put(THREADS_ALLOWED_TO_BLOCK_FOR_CONNECTION_MULTIPLIER, mongoClientOptions.getThreadsAllowedToBlockForConnectionMultiplier()); properties.put(MAX_WAIT_TIME, mongoClientOptions.getMaxWaitTime()); properties.put(CONNECT_TIMEOUT, mongoClientOptions.getConnectTimeout()); properties.put(SOCKET_KEEP_ALIVE, mongoClientOptions.isSocketKeepAlive()); properties.put(AUTOCONNECT_RETRY, mongoClientOptions.isAutoConnectRetry()); properties.put(MAX_AUTOCONNECT_RETRY_TIME, mongoClientOptions.getMaxAutoConnectRetryTime()); properties.put(CURSOR_FINALIZER_ENABLED, mongoClientOptions.isCursorFinalizerEnabled()); properties.put(ALWAYS_USE_MBEANS, mongoClientOptions.isAlwaysUseMBeans()); return properties; } }
/** * Creates a new {@code MongoOptions} with the given options. This class is deprecated, use {@link com.mongodb.MongoClientOptions}. * * @param options the MongoClientOptions to copy values from into the new MongoOptions. * @deprecated use {@link com.mongodb.MongoClientOptions} */ @SuppressWarnings("deprecation") @Deprecated public MongoOptions(final MongoClientOptions options) { connectionsPerHost = options.getConnectionsPerHost(); threadsAllowedToBlockForConnectionMultiplier = options.getThreadsAllowedToBlockForConnectionMultiplier(); maxWaitTime = options.getMaxWaitTime(); connectTimeout = options.getConnectTimeout(); socketFactory = options.getSocketFactory(); socketTimeout = options.getSocketTimeout(); socketKeepAlive = options.isSocketKeepAlive(); readPreference = options.getReadPreference(); dbDecoderFactory = options.getDbDecoderFactory(); dbEncoderFactory = options.getDbEncoderFactory(); description = options.getDescription(); writeConcern = options.getWriteConcern(); alwaysUseMBeans = options.isAlwaysUseMBeans(); requiredReplicaSetName = options.getRequiredReplicaSetName(); }
private static ClusterSettings getClusterSettings(final List<ServerAddress> seedList, final MongoClientOptions options, final ClusterConnectionMode clusterConnectionMode) { ClusterSettings.Builder builder = ClusterSettings.builder() .hosts(new ArrayList<ServerAddress>(seedList)) .mode(clusterConnectionMode) .requiredReplicaSetName(options.getRequiredReplicaSetName()) .serverSelectionTimeout(options.getServerSelectionTimeout(), MILLISECONDS) .localThreshold(options.getLocalThreshold(), MILLISECONDS) .serverSelector(options.getServerSelector()) .description(options.getDescription()) .maxWaitQueueSize(options.getConnectionPoolSettings().getMaxWaitQueueSize()); for (ClusterListener clusterListener: options.getClusterListeners()) { builder.addClusterListener(clusterListener); } return builder.build(); }
description = options.getDescription(); applicationName = options.getApplicationName(); compressorList = options.getCompressorList();