@Immutable public class ConnectionDescription extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private ConnectionId |
connectionId |
private static int |
DEFAULT_MAX_MESSAGE_SIZE |
private static int |
DEFAULT_MAX_WRITE_BATCH_SIZE |
private int |
maxBatchCount |
private int |
maxDocumentSize |
private int |
maxMessageSize |
private ServerType |
serverType |
private ServerVersion |
serverVersion |
Constructor and Description |
---|
ConnectionDescription(ConnectionId connectionId,
ServerVersion serverVersion,
ServerType serverType,
int maxBatchCount,
int maxDocumentSize,
int maxMessageSize)
Construct an instance.
|
ConnectionDescription(ServerId serverId)
Construct a defaulted connection description instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
ConnectionId |
getConnectionId()
Gets the id of the connection.
|
static int |
getDefaultMaxMessageSize()
Get the default maximum message size.
|
static int |
getDefaultMaxWriteBatchSize()
Get the default maximum write batch size.
|
int |
getMaxBatchCount()
Gets the max batch count for bulk write operations.
|
int |
getMaxDocumentSize()
Gets the max document size in bytes for documents to be stored in collections.
|
int |
getMaxMessageSize()
Gets the max message size in bytes for wire protocol messages to be sent to the server.
|
ServerAddress |
getServerAddress()
Gets the server address.
|
ServerType |
getServerType()
Gets the server type.
|
ServerVersion |
getServerVersion()
Gets the version of the server.
|
int |
hashCode() |
(package private) ConnectionDescription |
withConnectionId(ConnectionId connectionId) |
private final ConnectionId connectionId
private final ServerVersion serverVersion
private final ServerType serverType
private final int maxBatchCount
private final int maxDocumentSize
private final int maxMessageSize
private static final int DEFAULT_MAX_MESSAGE_SIZE
private static final int DEFAULT_MAX_WRITE_BATCH_SIZE
public ConnectionDescription(ServerId serverId)
serverId
- the server addresspublic ConnectionDescription(ConnectionId connectionId, ServerVersion serverVersion, ServerType serverType, int maxBatchCount, int maxDocumentSize, int maxMessageSize)
connectionId
- the connection idserverVersion
- the server versionserverType
- the server typemaxBatchCount
- the max batch countmaxDocumentSize
- the max document size in bytesmaxMessageSize
- the max message size in bytesConnectionDescription withConnectionId(ConnectionId connectionId)
public ServerAddress getServerAddress()
public ConnectionId getConnectionId()
public ServerVersion getServerVersion()
public ServerType getServerType()
public int getMaxBatchCount()
public int getMaxDocumentSize()
public int getMaxMessageSize()
public static int getDefaultMaxMessageSize()
public static int getDefaultMaxWriteBatchSize()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object