- 1.53.0 (latest)
- 1.52.0
- 1.51.0
- 1.49.0
- 1.48.0
- 1.47.0
- 1.46.0
- 1.45.0
- 1.44.0
- 1.43.0
- 1.42.0
- 1.41.0
- 1.40.0
- 1.39.0
- 1.37.0
- 1.36.0
- 1.35.0
- 1.34.0
- 1.33.0
- 1.32.0
- 1.31.0
- 1.30.0
- 1.29.0
- 1.28.0
- 1.27.0
- 1.24.0
- 1.23.0
- 1.22.0
- 1.21.0
- 1.20.0
- 1.19.0
- 1.18.0
- 1.17.0
- 1.16.0
- 1.15.0
- 1.14.0
- 1.13.0
- 1.12.0
- 1.11.0
- 1.9.0
- 1.8.0
- 1.7.0
- 1.6.0
- 1.5.0
- 1.4.0
- 1.1.10
public class Debugger2Client implements BackgroundResource
Service Description: The Debugger service provides the API that allows users to collect run-time information from a running application, without stopping or slowing it down and without modifying its state. An application may include one or more replicated processes performing the same work.
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().
The surface of this class includes several types of Java methods for each of the API's methods:
- A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
- A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
- A "callable" method. This type of method takes no parameters and returns 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.newBuilder()
.setTransportChannelProvider(
Debugger2Settings.defaultHttpJsonTransportProviderBuilder().build())
.build();
Debugger2Client debugger2Client = Debugger2Client.create(debugger2Settings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Implements
BackgroundResourceStatic Methods
create()
public static final Debugger2Client create()
Constructs an instance of Debugger2Client with default settings.
Type | Description |
Debugger2Client |
Type | Description |
IOException |
create(Debugger2Settings settings)
public static final Debugger2Client create(Debugger2Settings settings)
Constructs an instance of Debugger2Client, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.
Name | Description |
settings | Debugger2Settings |
Type | Description |
Debugger2Client |
Type | Description |
IOException |
create(Debugger2Stub stub)
public static final Debugger2Client create(Debugger2Stub stub)
Constructs an instance of Debugger2Client, using the given stub for making calls. This is for advanced usage - prefer using create(Debugger2Settings).
Name | Description |
stub | Debugger2Stub |
Type | Description |
Debugger2Client |
Constructors
Debugger2Client(Debugger2Settings settings)
protected Debugger2Client(Debugger2Settings settings)
Constructs an instance of Debugger2Client, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.
Name | Description |
settings | Debugger2Settings |
Debugger2Client(Debugger2Stub stub)
protected Debugger2Client(Debugger2Stub stub)
Name | Description |
stub | Debugger2Stub |
Methods
awaitTermination(long duration, TimeUnit unit)
public boolean awaitTermination(long duration, TimeUnit unit)
Name | Description |
duration | long |
unit | TimeUnit |
Type | Description |
boolean |
Type | Description |
InterruptedException |
close()
public final void close()
deleteBreakpoint(DeleteBreakpointRequest request)
public final void deleteBreakpoint(DeleteBreakpointRequest request)
Deletes the breakpoint from the debuggee.
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);
}
Name | Description |
request | DeleteBreakpointRequest The request object containing all of the parameters for the API call. |
deleteBreakpoint(String debuggeeId, String breakpointId, String clientVersion)
public final void deleteBreakpoint(String debuggeeId, String breakpointId, String clientVersion)
Deletes the breakpoint from the debuggee.
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);
}
Name | Description |
debuggeeId | String Required. ID of the debuggee whose breakpoint to delete. |
breakpointId | String Required. ID of the breakpoint to delete. |
clientVersion | String Required. The client version making the call. Schema:
|
deleteBreakpointCallable()
public final UnaryCallable<DeleteBreakpointRequest,Empty> deleteBreakpointCallable()
Deletes the breakpoint from the debuggee.
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();
}
Type | Description |
UnaryCallable<DeleteBreakpointRequest,Empty> |
getBreakpoint(GetBreakpointRequest request)
public final GetBreakpointResponse getBreakpoint(GetBreakpointRequest request)
Gets breakpoint information.
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);
}
Name | Description |
request | GetBreakpointRequest The request object containing all of the parameters for the API call. |
Type | Description |
GetBreakpointResponse |
getBreakpoint(String debuggeeId, String breakpointId, String clientVersion)
public final GetBreakpointResponse getBreakpoint(String debuggeeId, String breakpointId, String clientVersion)
Gets breakpoint information.
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);
}
Name | Description |
debuggeeId | String Required. ID of the debuggee whose breakpoint to get. |
breakpointId | String Required. ID of the breakpoint to get. |
clientVersion | String Required. The client version making the call. Schema:
|
Type | Description |
GetBreakpointResponse |
getBreakpointCallable()
public final UnaryCallable<GetBreakpointRequest,GetBreakpointResponse> getBreakpointCallable()
Gets breakpoint information.
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();
}
Type | Description |
UnaryCallable<GetBreakpointRequest,GetBreakpointResponse> |
getSettings()
public final Debugger2Settings getSettings()
Type | Description |
Debugger2Settings |
getStub()
public Debugger2Stub getStub()
Type | Description |
Debugger2Stub |
isShutdown()
public boolean isShutdown()
Type | Description |
boolean |
isTerminated()
public boolean isTerminated()
Type | Description |
boolean |
listBreakpoints(ListBreakpointsRequest request)
public final ListBreakpointsResponse listBreakpoints(ListBreakpointsRequest request)
Lists all breakpoints for the debuggee.
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);
}
Name | Description |
request | ListBreakpointsRequest The request object containing all of the parameters for the API call. |
Type | Description |
ListBreakpointsResponse |
listBreakpoints(String debuggeeId, String clientVersion)
public final ListBreakpointsResponse listBreakpoints(String debuggeeId, String clientVersion)
Lists all breakpoints for the debuggee.
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);
}
Name | Description |
debuggeeId | String Required. ID of the debuggee whose breakpoints to list. |
clientVersion | String Required. The client version making the call. Schema:
|
Type | Description |
ListBreakpointsResponse |
listBreakpointsCallable()
public final UnaryCallable<ListBreakpointsRequest,ListBreakpointsResponse> listBreakpointsCallable()
Lists all breakpoints for the debuggee.
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();
}
Type | Description |
UnaryCallable<ListBreakpointsRequest,ListBreakpointsResponse> |
listDebuggees(ListDebuggeesRequest request)
public final ListDebuggeesResponse listDebuggees(ListDebuggeesRequest request)
Lists all the debuggees that the user has access to.
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);
}
Name | Description |
request | ListDebuggeesRequest The request object containing all of the parameters for the API call. |
Type | Description |
ListDebuggeesResponse |
listDebuggees(String project, String clientVersion)
public final ListDebuggeesResponse listDebuggees(String project, String clientVersion)
Lists all the debuggees that the user has access to.
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);
}
Name | Description |
project | String Required. Project number of a Google Cloud project whose debuggees to list. |
clientVersion | String Required. The client version making the call. Schema:
|
Type | Description |
ListDebuggeesResponse |
listDebuggeesCallable()
public final UnaryCallable<ListDebuggeesRequest,ListDebuggeesResponse> listDebuggeesCallable()
Lists all the debuggees that the user has access to.
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();
}
Type | Description |
UnaryCallable<ListDebuggeesRequest,ListDebuggeesResponse> |
setBreakpoint(SetBreakpointRequest request)
public final SetBreakpointResponse setBreakpoint(SetBreakpointRequest request)
Sets the breakpoint to the debuggee.
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);
}
Name | Description |
request | SetBreakpointRequest The request object containing all of the parameters for the API call. |
Type | Description |
SetBreakpointResponse |
setBreakpoint(String debuggeeId, Breakpoint breakpoint, String clientVersion)
public final SetBreakpointResponse setBreakpoint(String debuggeeId, Breakpoint breakpoint, String clientVersion)
Sets the breakpoint to the debuggee.
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);
}
Name | Description |
debuggeeId | String Required. ID of the debuggee where the breakpoint is to be set. |
breakpoint | Breakpoint Required. Breakpoint specification to set. The field |
clientVersion | String Required. The client version making the call. Schema:
|
Type | Description |
SetBreakpointResponse |
setBreakpointCallable()
public final UnaryCallable<SetBreakpointRequest,SetBreakpointResponse> setBreakpointCallable()
Sets the breakpoint to the debuggee.
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();
}
Type | Description |
UnaryCallable<SetBreakpointRequest,SetBreakpointResponse> |
shutdown()
public void shutdown()
shutdownNow()
public void shutdownNow()