@Generated(value="by gapic-generator-java") public class Debugger2Client extends Object implements com.google.api.gax.core.BackgroundResource
A debugged application is represented using the Debuggee concept. The Debugger service provides a way to query for available debuggees, but does not provide a way to create one. A debuggee is created using the Controller service, usually by running a debugger agent with the application.
The Debugger service enables the client to set one or more Breakpoints on a Debuggee and collect the results of the set Breakpoints.
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (Debugger2Client debugger2Client = Debugger2Client.create()) {
String debuggeeId = "debuggeeId-1833285553";
Breakpoint breakpoint = Breakpoint.newBuilder().build();
String clientVersion = "clientVersion771880589";
SetBreakpointResponse response =
debugger2Client.setBreakpoint(debuggeeId, breakpoint, clientVersion);
}
Note: close() needs to be called on the Debugger2Client object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
| Method | Description | Method Variants |
|---|---|---|
SetBreakpoint |
Sets the breakpoint to the debuggee. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetBreakpoint |
Gets breakpoint information. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteBreakpoint |
Deletes the breakpoint from the debuggee. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListBreakpoints |
Lists all breakpoints for the debuggee. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListDebuggees |
Lists all the debuggees that the user has access to. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of Debugger2Settings to create(). For example:
To customize credentials:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
Debugger2Settings debugger2Settings =
Debugger2Settings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
Debugger2Client debugger2Client = Debugger2Client.create(debugger2Settings);
To customize the endpoint:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
Debugger2Settings debugger2Settings =
Debugger2Settings.newBuilder().setEndpoint(myEndpoint).build();
Debugger2Client debugger2Client = Debugger2Client.create(debugger2Settings);
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
Debugger2Settings debugger2Settings = Debugger2Settings.newHttpJsonBuilder().build();
Debugger2Client debugger2Client = Debugger2Client.create(debugger2Settings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
| Modifier | Constructor and Description |
|---|---|
protected |
Debugger2Client(Debugger2Settings settings)
Constructs an instance of Debugger2Client, using the given settings.
|
protected |
Debugger2Client(Debugger2Stub stub) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static Debugger2Client |
create()
Constructs an instance of Debugger2Client with default settings.
|
static Debugger2Client |
create(Debugger2Settings settings)
Constructs an instance of Debugger2Client, using the given settings.
|
static Debugger2Client |
create(Debugger2Stub stub)
Constructs an instance of Debugger2Client, using the given stub for making calls.
|
void |
deleteBreakpoint(DeleteBreakpointRequest request)
Deletes the breakpoint from the debuggee.
|
void |
deleteBreakpoint(String debuggeeId,
String breakpointId,
String clientVersion)
Deletes the breakpoint from the debuggee.
|
com.google.api.gax.rpc.UnaryCallable<DeleteBreakpointRequest,com.google.protobuf.Empty> |
deleteBreakpointCallable()
Deletes the breakpoint from the debuggee.
|
GetBreakpointResponse |
getBreakpoint(GetBreakpointRequest request)
Gets breakpoint information.
|
GetBreakpointResponse |
getBreakpoint(String debuggeeId,
String breakpointId,
String clientVersion)
Gets breakpoint information.
|
com.google.api.gax.rpc.UnaryCallable<GetBreakpointRequest,GetBreakpointResponse> |
getBreakpointCallable()
Gets breakpoint information.
|
Debugger2Settings |
getSettings() |
Debugger2Stub |
getStub() |
boolean |
isShutdown() |
boolean |
isTerminated() |
ListBreakpointsResponse |
listBreakpoints(ListBreakpointsRequest request)
Lists all breakpoints for the debuggee.
|
ListBreakpointsResponse |
listBreakpoints(String debuggeeId,
String clientVersion)
Lists all breakpoints for the debuggee.
|
com.google.api.gax.rpc.UnaryCallable<ListBreakpointsRequest,ListBreakpointsResponse> |
listBreakpointsCallable()
Lists all breakpoints for the debuggee.
|
ListDebuggeesResponse |
listDebuggees(ListDebuggeesRequest request)
Lists all the debuggees that the user has access to.
|
ListDebuggeesResponse |
listDebuggees(String project,
String clientVersion)
Lists all the debuggees that the user has access to.
|
com.google.api.gax.rpc.UnaryCallable<ListDebuggeesRequest,ListDebuggeesResponse> |
listDebuggeesCallable()
Lists all the debuggees that the user has access to.
|
SetBreakpointResponse |
setBreakpoint(SetBreakpointRequest request)
Sets the breakpoint to the debuggee.
|
SetBreakpointResponse |
setBreakpoint(String debuggeeId,
Breakpoint breakpoint,
String clientVersion)
Sets the breakpoint to the debuggee.
|
com.google.api.gax.rpc.UnaryCallable<SetBreakpointRequest,SetBreakpointResponse> |
setBreakpointCallable()
Sets the breakpoint to the debuggee.
|
void |
shutdown() |
void |
shutdownNow() |
protected Debugger2Client(Debugger2Settings settings) throws IOException
IOExceptionprotected Debugger2Client(Debugger2Stub stub)
public static final Debugger2Client create() throws IOException
IOExceptionpublic static final Debugger2Client create(Debugger2Settings settings) throws IOException
IOExceptionpublic static final Debugger2Client create(Debugger2Stub stub)
public final Debugger2Settings getSettings()
public Debugger2Stub getStub()
public final SetBreakpointResponse setBreakpoint(String debuggeeId, Breakpoint breakpoint, String clientVersion)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (Debugger2Client debugger2Client = Debugger2Client.create()) {
String debuggeeId = "debuggeeId-1833285553";
Breakpoint breakpoint = Breakpoint.newBuilder().build();
String clientVersion = "clientVersion771880589";
SetBreakpointResponse response =
debugger2Client.setBreakpoint(debuggeeId, breakpoint, clientVersion);
}
debuggeeId - Required. ID of the debuggee where the breakpoint is to be set.breakpoint - Required. Breakpoint specification to set. The field `location` of the
breakpoint must be set.clientVersion - Required. The client version making the call. Schema:
`domain/type/version` (e.g., `google.com/intellij/v1`).com.google.api.gax.rpc.ApiException - if the remote call failspublic final SetBreakpointResponse setBreakpoint(SetBreakpointRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (Debugger2Client debugger2Client = Debugger2Client.create()) {
SetBreakpointRequest request =
SetBreakpointRequest.newBuilder()
.setDebuggeeId("debuggeeId-1833285553")
.setBreakpoint(Breakpoint.newBuilder().build())
.setClientVersion("clientVersion771880589")
.build();
SetBreakpointResponse response = debugger2Client.setBreakpoint(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<SetBreakpointRequest,SetBreakpointResponse> setBreakpointCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (Debugger2Client debugger2Client = Debugger2Client.create()) {
SetBreakpointRequest request =
SetBreakpointRequest.newBuilder()
.setDebuggeeId("debuggeeId-1833285553")
.setBreakpoint(Breakpoint.newBuilder().build())
.setClientVersion("clientVersion771880589")
.build();
ApiFuture<SetBreakpointResponse> future =
debugger2Client.setBreakpointCallable().futureCall(request);
// Do something.
SetBreakpointResponse response = future.get();
}
public final GetBreakpointResponse getBreakpoint(String debuggeeId, String breakpointId, String clientVersion)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (Debugger2Client debugger2Client = Debugger2Client.create()) {
String debuggeeId = "debuggeeId-1833285553";
String breakpointId = "breakpointId570266860";
String clientVersion = "clientVersion771880589";
GetBreakpointResponse response =
debugger2Client.getBreakpoint(debuggeeId, breakpointId, clientVersion);
}
debuggeeId - Required. ID of the debuggee whose breakpoint to get.breakpointId - Required. ID of the breakpoint to get.clientVersion - Required. The client version making the call. Schema:
`domain/type/version` (e.g., `google.com/intellij/v1`).com.google.api.gax.rpc.ApiException - if the remote call failspublic final GetBreakpointResponse getBreakpoint(GetBreakpointRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (Debugger2Client debugger2Client = Debugger2Client.create()) {
GetBreakpointRequest request =
GetBreakpointRequest.newBuilder()
.setDebuggeeId("debuggeeId-1833285553")
.setBreakpointId("breakpointId570266860")
.setClientVersion("clientVersion771880589")
.build();
GetBreakpointResponse response = debugger2Client.getBreakpoint(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetBreakpointRequest,GetBreakpointResponse> getBreakpointCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (Debugger2Client debugger2Client = Debugger2Client.create()) {
GetBreakpointRequest request =
GetBreakpointRequest.newBuilder()
.setDebuggeeId("debuggeeId-1833285553")
.setBreakpointId("breakpointId570266860")
.setClientVersion("clientVersion771880589")
.build();
ApiFuture<GetBreakpointResponse> future =
debugger2Client.getBreakpointCallable().futureCall(request);
// Do something.
GetBreakpointResponse response = future.get();
}
public final void deleteBreakpoint(String debuggeeId, String breakpointId, String clientVersion)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (Debugger2Client debugger2Client = Debugger2Client.create()) {
String debuggeeId = "debuggeeId-1833285553";
String breakpointId = "breakpointId570266860";
String clientVersion = "clientVersion771880589";
debugger2Client.deleteBreakpoint(debuggeeId, breakpointId, clientVersion);
}
debuggeeId - Required. ID of the debuggee whose breakpoint to delete.breakpointId - Required. ID of the breakpoint to delete.clientVersion - Required. The client version making the call. Schema:
`domain/type/version` (e.g., `google.com/intellij/v1`).com.google.api.gax.rpc.ApiException - if the remote call failspublic final void deleteBreakpoint(DeleteBreakpointRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (Debugger2Client debugger2Client = Debugger2Client.create()) {
DeleteBreakpointRequest request =
DeleteBreakpointRequest.newBuilder()
.setDebuggeeId("debuggeeId-1833285553")
.setBreakpointId("breakpointId570266860")
.setClientVersion("clientVersion771880589")
.build();
debugger2Client.deleteBreakpoint(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<DeleteBreakpointRequest,com.google.protobuf.Empty> deleteBreakpointCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (Debugger2Client debugger2Client = Debugger2Client.create()) {
DeleteBreakpointRequest request =
DeleteBreakpointRequest.newBuilder()
.setDebuggeeId("debuggeeId-1833285553")
.setBreakpointId("breakpointId570266860")
.setClientVersion("clientVersion771880589")
.build();
ApiFuture<Empty> future = debugger2Client.deleteBreakpointCallable().futureCall(request);
// Do something.
future.get();
}
public final ListBreakpointsResponse listBreakpoints(String debuggeeId, String clientVersion)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (Debugger2Client debugger2Client = Debugger2Client.create()) {
String debuggeeId = "debuggeeId-1833285553";
String clientVersion = "clientVersion771880589";
ListBreakpointsResponse response = debugger2Client.listBreakpoints(debuggeeId, clientVersion);
}
debuggeeId - Required. ID of the debuggee whose breakpoints to list.clientVersion - Required. The client version making the call. Schema:
`domain/type/version` (e.g., `google.com/intellij/v1`).com.google.api.gax.rpc.ApiException - if the remote call failspublic final ListBreakpointsResponse listBreakpoints(ListBreakpointsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (Debugger2Client debugger2Client = Debugger2Client.create()) {
ListBreakpointsRequest request =
ListBreakpointsRequest.newBuilder()
.setDebuggeeId("debuggeeId-1833285553")
.setIncludeAllUsers(true)
.setIncludeInactive(true)
.setAction(ListBreakpointsRequest.BreakpointActionValue.newBuilder().build())
.setStripResults(true)
.setWaitToken("waitToken-984229500")
.setClientVersion("clientVersion771880589")
.build();
ListBreakpointsResponse response = debugger2Client.listBreakpoints(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListBreakpointsRequest,ListBreakpointsResponse> listBreakpointsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (Debugger2Client debugger2Client = Debugger2Client.create()) {
ListBreakpointsRequest request =
ListBreakpointsRequest.newBuilder()
.setDebuggeeId("debuggeeId-1833285553")
.setIncludeAllUsers(true)
.setIncludeInactive(true)
.setAction(ListBreakpointsRequest.BreakpointActionValue.newBuilder().build())
.setStripResults(true)
.setWaitToken("waitToken-984229500")
.setClientVersion("clientVersion771880589")
.build();
ApiFuture<ListBreakpointsResponse> future =
debugger2Client.listBreakpointsCallable().futureCall(request);
// Do something.
ListBreakpointsResponse response = future.get();
}
public final ListDebuggeesResponse listDebuggees(String project, String clientVersion)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (Debugger2Client debugger2Client = Debugger2Client.create()) {
String project = "project-309310695";
String clientVersion = "clientVersion771880589";
ListDebuggeesResponse response = debugger2Client.listDebuggees(project, clientVersion);
}
project - Required. Project number of a Google Cloud project whose debuggees to list.clientVersion - Required. The client version making the call. Schema:
`domain/type/version` (e.g., `google.com/intellij/v1`).com.google.api.gax.rpc.ApiException - if the remote call failspublic final ListDebuggeesResponse listDebuggees(ListDebuggeesRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (Debugger2Client debugger2Client = Debugger2Client.create()) {
ListDebuggeesRequest request =
ListDebuggeesRequest.newBuilder()
.setProject("project-309310695")
.setIncludeInactive(true)
.setClientVersion("clientVersion771880589")
.build();
ListDebuggeesResponse response = debugger2Client.listDebuggees(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListDebuggeesRequest,ListDebuggeesResponse> listDebuggeesCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (Debugger2Client debugger2Client = Debugger2Client.create()) {
ListDebuggeesRequest request =
ListDebuggeesRequest.newBuilder()
.setProject("project-309310695")
.setIncludeInactive(true)
.setClientVersion("clientVersion771880589")
.build();
ApiFuture<ListDebuggeesResponse> future =
debugger2Client.listDebuggeesCallable().futureCall(request);
// Do something.
ListDebuggeesResponse response = future.get();
}
public final void close()
close in interface AutoCloseablepublic void shutdown()
shutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isShutdown()
isShutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isTerminated()
isTerminated in interface com.google.api.gax.core.BackgroundResourcepublic void shutdownNow()
shutdownNow in interface com.google.api.gax.core.BackgroundResourcepublic boolean awaitTermination(long duration,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface com.google.api.gax.core.BackgroundResourceInterruptedExceptionCopyright © 2024 Google LLC. All rights reserved.