public static boolean serverIsAtLeastVersionFourDotZero(final ConnectionDescription description) { return description.getMaxWireVersion() >= FOUR_DOT_ZERO_WIRE_VERSION; }
public static boolean serverIsLessThanVersionFourDotTwo(final ConnectionDescription description) { return description.getMaxWireVersion() < FOUR_DOT_TWO_WIRE_VERSION; }
public static boolean serverIsLessThanVersionThreeDotTwo(final ConnectionDescription description) { return description.getMaxWireVersion() < THREE_DOT_TWO_WIRE_VERSION; }
public static boolean serverIsAtLeastVersionThreeDotTwo(final ConnectionDescription description) { return description.getMaxWireVersion() >= THREE_DOT_TWO_WIRE_VERSION; }
public static boolean serverIsAtLeastVersionThreeDotSix(final ConnectionDescription description) { return description.getMaxWireVersion() >= THREE_DOT_SIX_WIRE_VERSION; }
public static boolean serverIsLessThanVersionThreeDotFour(final ConnectionDescription description) { return description.getMaxWireVersion() < THREE_DOT_FOUR_WIRE_VERSION; }
public static boolean serverIsAtLeastVersionThreeDotZero(final ConnectionDescription description) { return description.getMaxWireVersion() >= THREE_DOT_ZERO_WIRE_VERSION; }
public static boolean serverIsAtLeastVersionThreeDotFour(final ConnectionDescription description) { return description.getMaxWireVersion() >= THREE_DOT_FOUR_WIRE_VERSION; }
public static boolean serverIsLessThanVersionThreeDotZero(final ConnectionDescription description) { return description.getMaxWireVersion() < THREE_DOT_ZERO_WIRE_VERSION; }
public static boolean serverIsLessThanVersionThreeDotSix(final ConnectionDescription description) { return description.getMaxWireVersion() < THREE_DOT_SIX_WIRE_VERSION; }
public static boolean serverIsLessThanVersionFourDotZero(final ConnectionDescription description) { return description.getMaxWireVersion() < FOUR_DOT_ZERO_WIRE_VERSION; }
private static CommandMessage getCommandMessage(final String database, final BsonDocument command, final InternalConnection internalConnection) { return new CommandMessage(new MongoNamespace(database, COMMAND_COLLECTION_NAME), command, new NoOpFieldNameValidator(), primary(), MessageSettings .builder() // Note: server version will be 0.0 at this point when called from InternalConnectionInitializer, // which means OP_MSG will not be used .maxWireVersion(internalConnection.getDescription().getMaxWireVersion()) .build() ); }
static MessageSettings getMessageSettings(final ConnectionDescription connectionDescription) { return MessageSettings.builder() .maxDocumentSize(connectionDescription.getMaxDocumentSize()) .maxMessageSize(connectionDescription.getMaxMessageSize()) .maxBatchCount(connectionDescription.getMaxBatchCount()) .maxWireVersion(connectionDescription.getMaxWireVersion()) .serverType(connectionDescription.getServerType()) .build(); }
public static boolean serverIsLessThanVersionThreeDotSix(final ConnectionDescription description) { return description.getMaxWireVersion() < THREE_DOT_SIX_WIRE_VERSION; }
public static boolean serverIsLessThanVersionFourDotTwo(final ConnectionDescription description) { return description.getMaxWireVersion() < FOUR_DOT_TWO_WIRE_VERSION; }
public static boolean serverIsAtLeastVersionThreeDotFour(final ConnectionDescription description) { return description.getMaxWireVersion() >= THREE_DOT_FOUR_WIRE_VERSION; }
public static boolean serverIsLessThanVersionThreeDotZero(final ConnectionDescription description) { return description.getMaxWireVersion() < THREE_DOT_ZERO_WIRE_VERSION; }
public static boolean serverIsLessThanVersionThreeDotTwo(final ConnectionDescription description) { return description.getMaxWireVersion() < THREE_DOT_TWO_WIRE_VERSION; }
private static CommandMessage getCommandMessage(final String database, final BsonDocument command, final InternalConnection internalConnection) { return new CommandMessage(new MongoNamespace(database, COMMAND_COLLECTION_NAME), command, new NoOpFieldNameValidator(), primary(), MessageSettings .builder() // Note: server version will be 0.0 at this point when called from InternalConnectionInitializer, // which means OP_MSG will not be used .maxWireVersion(internalConnection.getDescription().getMaxWireVersion()) .build() ); }
static MessageSettings getMessageSettings(final ConnectionDescription connectionDescription) { return MessageSettings.builder() .maxDocumentSize(connectionDescription.getMaxDocumentSize()) .maxMessageSize(connectionDescription.getMaxMessageSize()) .maxBatchCount(connectionDescription.getMaxBatchCount()) .maxWireVersion(connectionDescription.getMaxWireVersion()) .serverType(connectionDescription.getServerType()) .build(); }