Package com.newrelic.api.agent
Class DatastoreParameters.Builder
- java.lang.Object
-
- com.newrelic.api.agent.DatastoreParameters.Builder
-
- All Implemented Interfaces:
DatastoreParameters.Build
,DatastoreParameters.CollectionParameter
,DatastoreParameters.DatabaseParameter
,DatastoreParameters.InstanceParameter
,DatastoreParameters.OperationParameter
,DatastoreParameters.SlowQueryParameter
,DatastoreParameters.SlowQueryWithInputParameter
- Enclosing class:
- DatastoreParameters
protected static class DatastoreParameters.Builder extends java.lang.Object implements DatastoreParameters.CollectionParameter, DatastoreParameters.OperationParameter, DatastoreParameters.InstanceParameter, DatastoreParameters.DatabaseParameter, DatastoreParameters.SlowQueryParameter, DatastoreParameters.SlowQueryWithInputParameter, DatastoreParameters.Build
-
-
Constructor Summary
Constructors Constructor Description Builder(java.lang.String product)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DatastoreParameters
build()
Build the finalDatastoreParameters
for the API call.DatastoreParameters.Build
cloudResourceId(java.lang.String cloudResourceId)
Set the cloud provider's id for the database.DatastoreParameters.OperationParameter
collection(java.lang.String collection)
Set the name of the collection or table.DatastoreParameters.SlowQueryParameter
databaseName(java.lang.String databaseName)
Set the name of the database where the query was executedDatastoreParameters.DatabaseParameter
instance(java.lang.String host, java.lang.Integer port)
Set the host and port of the datastore connection used for this query.DatastoreParameters.DatabaseParameter
instance(java.lang.String host, java.lang.String pathOrId)
Set the host and pathOrId of the datastore connection used for this query.DatastoreParameters.SlowQueryParameter
noDatabaseName()
No database information recorded.DatastoreParameters.DatabaseParameter
noInstance()
No instance information recorded.DatastoreParameters.SlowQueryWithInputParameter
noSlowQuery()
No slow query information recorded.DatastoreParameters.InstanceParameter
operation(java.lang.String operation)
Set the datastore operation.<T> DatastoreParameters.SlowQueryWithInputParameter
slowQuery(T rawQuery, QueryConverter<T> queryConverter)
Set a raw query and queryConverter to be used when reporting this call as a slow query<T> DatastoreParameters.Build
slowQueryWithInput(java.lang.String inputQueryLabel, T rawInputQuery, QueryConverter<T> rawInputQueryConverter)
Set an input query and converter to be used when reporting this call as a slow query.
-
-
-
Method Detail
-
collection
public DatastoreParameters.OperationParameter collection(java.lang.String collection)
Description copied from interface:DatastoreParameters.CollectionParameter
Set the name of the collection or table.- Specified by:
collection
in interfaceDatastoreParameters.CollectionParameter
- Parameters:
collection
- the collection or table- Returns:
- the next builder interface
-
operation
public DatastoreParameters.InstanceParameter operation(java.lang.String operation)
Description copied from interface:DatastoreParameters.OperationParameter
Set the datastore operation. This is the primitive operation type accepted by the datastore itself or the name of the API method in the client library.- Specified by:
operation
in interfaceDatastoreParameters.OperationParameter
- Parameters:
operation
- the datastore operation- Returns:
- the next builder interface
-
instance
public DatastoreParameters.DatabaseParameter instance(java.lang.String host, java.lang.Integer port)
Description copied from interface:DatastoreParameters.InstanceParameter
Set the host and port of the datastore connection used for this query.- Specified by:
instance
in interfaceDatastoreParameters.InstanceParameter
- Parameters:
host
- The host where the datastore is locatedport
- The port for the connection to the datastore- Returns:
- the next builder interface
-
instance
public DatastoreParameters.DatabaseParameter instance(java.lang.String host, java.lang.String pathOrId)
Description copied from interface:DatastoreParameters.InstanceParameter
Set the host and pathOrId of the datastore connection used for this query.- Specified by:
instance
in interfaceDatastoreParameters.InstanceParameter
- Parameters:
host
- The host where the datastore is locatedpathOrId
- The path or identifier of this instance- Returns:
- the next builder interface
-
noInstance
public DatastoreParameters.DatabaseParameter noInstance()
Description copied from interface:DatastoreParameters.InstanceParameter
No instance information recorded.- Specified by:
noInstance
in interfaceDatastoreParameters.InstanceParameter
- Returns:
- the next builder interface
-
databaseName
public DatastoreParameters.SlowQueryParameter databaseName(java.lang.String databaseName)
Description copied from interface:DatastoreParameters.DatabaseParameter
Set the name of the database where the query was executed- Specified by:
databaseName
in interfaceDatastoreParameters.DatabaseParameter
- Parameters:
databaseName
- the name of the database where the query was executed- Returns:
- the next builder interface
-
cloudResourceId
public DatastoreParameters.Build cloudResourceId(java.lang.String cloudResourceId)
Description copied from interface:DatastoreParameters.Build
Set the cloud provider's id for the database. This method is optional and can be bypassed by calling build directly.- Specified by:
cloudResourceId
in interfaceDatastoreParameters.Build
- Returns:
- the build object so it can be built.
-
build
public DatastoreParameters build()
Description copied from interface:DatastoreParameters.Build
Build the finalDatastoreParameters
for the API call.- Specified by:
build
in interfaceDatastoreParameters.Build
- Returns:
- the completed DatastoreParameters object
-
noDatabaseName
public DatastoreParameters.SlowQueryParameter noDatabaseName()
Description copied from interface:DatastoreParameters.DatabaseParameter
No database information recorded.- Specified by:
noDatabaseName
in interfaceDatastoreParameters.DatabaseParameter
- Returns:
- the next builder interface
-
slowQuery
public <T> DatastoreParameters.SlowQueryWithInputParameter slowQuery(T rawQuery, QueryConverter<T> queryConverter)
Description copied from interface:DatastoreParameters.SlowQueryParameter
Set a raw query and queryConverter to be used when reporting this call as a slow query- Specified by:
slowQuery
in interfaceDatastoreParameters.SlowQueryParameter
- Type Parameters:
T
- The type of the query- Parameters:
rawQuery
- The raw query object used for transforming into a raw and obfuscated query stringqueryConverter
- A converter to transform the rawQuery into a raw and obfuscated query string- Returns:
- the next builder interface
-
noSlowQuery
public DatastoreParameters.SlowQueryWithInputParameter noSlowQuery()
Description copied from interface:DatastoreParameters.SlowQueryParameter
No slow query information recorded.- Specified by:
noSlowQuery
in interfaceDatastoreParameters.SlowQueryParameter
- Returns:
- the next builder interface
-
slowQueryWithInput
public <T> DatastoreParameters.Build slowQueryWithInput(java.lang.String inputQueryLabel, T rawInputQuery, QueryConverter<T> rawInputQueryConverter)
Description copied from interface:DatastoreParameters.SlowQueryWithInputParameter
Set an input query and converter to be used when reporting this call as a slow query. The input query could be anything from "Hibernate HQL" to a custom query language that gets converted into SQL.- Specified by:
slowQueryWithInput
in interfaceDatastoreParameters.SlowQueryWithInputParameter
- Type Parameters:
T
- The type of the input query- Parameters:
inputQueryLabel
- The label used to display this input query in the UI.rawInputQuery
- The raw input query object used for transforming into a raw and obfuscated input query stringrawInputQueryConverter
- A converter to transform the rawInputQuery into a raw and obfuscated input query string- Returns:
- the next builder interface
-
-