Example usage for com.mongodb MongoClientOptions getHeartbeatConnectTimeout

List of usage examples for com.mongodb MongoClientOptions getHeartbeatConnectTimeout

Introduction

In this page you can find the example usage for com.mongodb MongoClientOptions getHeartbeatConnectTimeout.

Prototype

public int getHeartbeatConnectTimeout() 

Source Link

Document

Gets the connect timeout for connections used for the cluster heartbeat.

Default is 20,000 milliseconds.

Usage

From source file:io.dirigible.mongodb.jdbc.MongodbConnection.java

License:Apache License

private Properties mongoClientOptionsAsProperties(MongoClientOptions ops, Properties props) {
    //TODO: write complex object properties too?
    if (ops.getDescription() != null)
        props.setProperty("description", ops.getDescription());
    if (ops.getRequiredReplicaSetName() != null)
        props.setProperty("requiredReplicaSetName", ops.getRequiredReplicaSetName());
    props.setProperty("connectionsPerHost", "" + ops.getConnectionsPerHost());
    props.setProperty("connectTimeout", "" + ops.getConnectTimeout());
    props.setProperty("heartbeatConnectTimeout", "" + ops.getHeartbeatConnectTimeout());
    props.setProperty("heartbeatFrequency", "" + ops.getHeartbeatFrequency());
    props.setProperty("heartbeatSocketTimeout", "" + ops.getHeartbeatSocketTimeout());
    props.setProperty("localThreshold", "" + ops.getLocalThreshold());
    props.setProperty("maxConnectionIdleTime", "" + ops.getMaxConnectionIdleTime());
    props.setProperty("maxConnectionLifeTime", "" + ops.getMaxConnectionLifeTime());
    props.setProperty("maxWaitTime", "" + ops.getMaxWaitTime());
    props.setProperty("minConnectionsPerHost", "" + ops.getMinConnectionsPerHost());
    props.setProperty("minHeartbeatFrequency", "" + ops.getMinHeartbeatFrequency());
    props.setProperty("serverSelectionTimeout", "" + ops.getServerSelectionTimeout());
    props.setProperty("socketTimeout", "" + ops.getSocketTimeout());
    return props;
}