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 DatastoreParametersbuild()Build the finalDatastoreParametersfor the API call.DatastoreParameters.BuildcloudResourceId(java.lang.String cloudResourceId)Set the cloud provider's id for the database.DatastoreParameters.OperationParametercollection(java.lang.String collection)Set the name of the collection or table.DatastoreParameters.SlowQueryParameterdatabaseName(java.lang.String databaseName)Set the name of the database where the query was executedDatastoreParameters.DatabaseParameterinstance(java.lang.String host, java.lang.Integer port)Set the host and port of the datastore connection used for this query.DatastoreParameters.DatabaseParameterinstance(java.lang.String host, java.lang.String pathOrId)Set the host and pathOrId of the datastore connection used for this query.DatastoreParameters.SlowQueryParameternoDatabaseName()No database information recorded.DatastoreParameters.DatabaseParameternoInstance()No instance information recorded.DatastoreParameters.SlowQueryWithInputParameternoSlowQuery()No slow query information recorded.DatastoreParameters.InstanceParameteroperation(java.lang.String operation)Set the datastore operation.<T> DatastoreParameters.SlowQueryWithInputParameterslowQuery(T rawQuery, QueryConverter<T> queryConverter)Set a raw query and queryConverter to be used when reporting this call as a slow query<T> DatastoreParameters.BuildslowQueryWithInput(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.CollectionParameterSet the name of the collection or table.- Specified by:
collectionin 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.OperationParameterSet 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:
operationin 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.InstanceParameterSet the host and port of the datastore connection used for this query.- Specified by:
instancein 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.InstanceParameterSet the host and pathOrId of the datastore connection used for this query.- Specified by:
instancein 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.InstanceParameterNo instance information recorded.- Specified by:
noInstancein interfaceDatastoreParameters.InstanceParameter- Returns:
- the next builder interface
-
databaseName
public DatastoreParameters.SlowQueryParameter databaseName(java.lang.String databaseName)
Description copied from interface:DatastoreParameters.DatabaseParameterSet the name of the database where the query was executed- Specified by:
databaseNamein 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.BuildSet the cloud provider's id for the database. This method is optional and can be bypassed by calling build directly.- Specified by:
cloudResourceIdin interfaceDatastoreParameters.Build- Returns:
- the build object so it can be built.
-
build
public DatastoreParameters build()
Description copied from interface:DatastoreParameters.BuildBuild the finalDatastoreParametersfor the API call.- Specified by:
buildin interfaceDatastoreParameters.Build- Returns:
- the completed DatastoreParameters object
-
noDatabaseName
public DatastoreParameters.SlowQueryParameter noDatabaseName()
Description copied from interface:DatastoreParameters.DatabaseParameterNo database information recorded.- Specified by:
noDatabaseNamein interfaceDatastoreParameters.DatabaseParameter- Returns:
- the next builder interface
-
slowQuery
public <T> DatastoreParameters.SlowQueryWithInputParameter slowQuery(T rawQuery, QueryConverter<T> queryConverter)
Description copied from interface:DatastoreParameters.SlowQueryParameterSet a raw query and queryConverter to be used when reporting this call as a slow query- Specified by:
slowQueryin 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.SlowQueryParameterNo slow query information recorded.- Specified by:
noSlowQueryin 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.SlowQueryWithInputParameterSet 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:
slowQueryWithInputin 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
-
-