Example usage for com.mongodb MongoClientOptions getHeartbeatSocketTimeout

List of usage examples for com.mongodb MongoClientOptions getHeartbeatSocketTimeout

Introduction

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

Prototype

public int getHeartbeatSocketTimeout() 

Source Link

Document

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

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;
}