Class DatastoreInstanceDetection
- java.lang.Object
-
- com.newrelic.agent.bridge.datastore.DatastoreInstanceDetection
-
public final class DatastoreInstanceDetection extends java.lang.ObjectThis class needs to be accessible by instrumentation loaded on the bootstrap loader (jdbc-socket instrumentation), that's why this isn't in agent-bridge-datastore. To support Java 9+, this class has no java.sql dependencies.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDatastoreInstanceDetection.MultiHostConfig
-
Field Summary
Fields Modifier and Type Field Description static DatastoreInstanceDetection.MultiHostConfigmultihostConfig
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidassociateAddress(java.lang.Object connection)Associate last detected address with a connection.static voidassociateAddress(java.lang.Object connection, java.net.InetSocketAddress addressToStore)static voidclearAddress()Clear detected address.static voiddetectConnectionAddress()Detect address of a connection.static java.net.InetSocketAddressgetAddressForConnection(java.lang.Object connection)Get address detected for this connection.static java.net.InetSocketAddressgetCurrentAddress()static voidsaveAddress(java.net.InetSocketAddress addressToStore)static booleanshouldDetectConnectionAddress()static voidstopDetectingConnectionAddress()Stop detecting the address of a connection.
-
-
-
Field Detail
-
multihostConfig
public static DatastoreInstanceDetection.MultiHostConfig multihostConfig
-
-
Method Detail
-
shouldDetectConnectionAddress
public static boolean shouldDetectConnectionAddress()
- Returns:
- true if we should be detecting the address of a connection, false otherwise.
-
stopDetectingConnectionAddress
public static void stopDetectingConnectionAddress()
Stop detecting the address of a connection.
-
detectConnectionAddress
public static void detectConnectionAddress()
Detect address of a connection.
-
associateAddress
public static void associateAddress(java.lang.Object connection)
Associate last detected address with a connection.- Parameters:
connection- Connection to associate with last detected address.
-
associateAddress
public static void associateAddress(java.lang.Object connection, java.net.InetSocketAddress addressToStore)
-
saveAddress
public static void saveAddress(java.net.InetSocketAddress addressToStore)
-
clearAddress
public static void clearAddress()
Clear detected address.
-
getCurrentAddress
public static java.net.InetSocketAddress getCurrentAddress()
- Returns:
- address detected.
-
getAddressForConnection
public static java.net.InetSocketAddress getAddressForConnection(java.lang.Object connection)
Get address detected for this connection.- Parameters:
connection- Connection to lookup- Returns:
- address address detected for the connection, null if no address was not detected for this connection.
-
-