ShardLocation Class
- java.
lang. Object - Serializable
- com.
microsoft. azure. elasticdb. shard. base. ShardLocation
- com.
public class ShardLocation
Represents the location of a shard in terms of its server name and database name. This is used to manage connections to the shard and to support other operations on shards. As opposed to a Shard, a shard location is not registered with the shard map.
Constructor Summary
Constructor | Description | |
---|---|---|
ShardLocation() | ||
ShardLocation(String server, String database) |
Constructor that allows specification of address and database to identify a shard. |
|
ShardLocation(String server, String database, SqlProtocol protocol) |
Constructor that allows specification of address and database to identify a shard. |
|
ShardLocation(String server, String database, SqlProtocol protocol, int port) |
Constructor that allows specification of protocol, address, port and database to identify a shard. |
Method Summary
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Determines whether the specified object is equal to the current object. |
boolean |
equals(ShardLocation other)
Performs equality comparison with another given ShardLocation. |
String | getDatabase() |
String |
getDataSource()
DataSource name which can be used to construct connection string Data Source property. |
int | getPort() |
Sql |
getProtocol() |
String | getServer() |
int |
hashCode()
Calculates the hash code for this instance. |
String |
toString()
Converts the shard location to its string representation. |
Constructor Details
ShardLocation
public ShardLocation()
ShardLocation
public ShardLocation(String server, String database)
Constructor that allows specification of address and database to identify a shard.
Parameters:
ShardLocation
public ShardLocation(String server, String database, SqlProtocol protocol)
Constructor that allows specification of address and database to identify a shard.
Parameters:
ShardLocation
public ShardLocation(String server, String database, SqlProtocol protocol, int port)
Constructor that allows specification of protocol, address, port and database to identify a shard.
Parameters:
Method Details
equals
public boolean equals(Object obj)
Determines whether the specified object is equal to the current object.
Parameters:
Returns:
equals
public boolean equals(ShardLocation other)
Performs equality comparison with another given ShardLocation.
Parameters:
Returns:
getDatabase
public String getDatabase()
getDataSource
public String getDataSource()
DataSource name which can be used to construct connection string Data Source property.
getPort
public int getPort()
getProtocol
public SqlProtocol getProtocol()
getServer
public String getServer()
hashCode
public int hashCode()
Calculates the hash code for this instance.
Returns:
toString
public String toString()
Converts the shard location to its string representation.
Returns:
Applies to
Azure SDK for Java