@Generated(value="by gapic-generator") @BetaApi public class SslCertificateClient extends Object implements com.google.api.gax.core.BackgroundResource
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:
try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
ProjectGlobalSslCertificateName sslCertificate = ProjectGlobalSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
Operation response = sslCertificateClient.deleteSslCertificate(sslCertificate);
}
Note: close() needs to be called on the sslCertificateClient 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:
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 SslCertificateSettings to create(). For example:
To customize credentials:
SslCertificateSettings sslCertificateSettings =
SslCertificateSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
SslCertificateClient sslCertificateClient =
SslCertificateClient.create(sslCertificateSettings);
To customize the endpoint:
SslCertificateSettings sslCertificateSettings =
SslCertificateSettings.newBuilder().setEndpoint(myEndpoint).build();
SslCertificateClient sslCertificateClient =
SslCertificateClient.create(sslCertificateSettings);
Modifier and Type | Class and Description |
---|---|
static class |
SslCertificateClient.AggregatedListSslCertificatesFixedSizeCollection |
static class |
SslCertificateClient.AggregatedListSslCertificatesPage |
static class |
SslCertificateClient.AggregatedListSslCertificatesPagedResponse |
static class |
SslCertificateClient.ListSslCertificatesFixedSizeCollection |
static class |
SslCertificateClient.ListSslCertificatesPage |
static class |
SslCertificateClient.ListSslCertificatesPagedResponse |
Modifier | Constructor and Description |
---|---|
protected |
SslCertificateClient(SslCertificateSettings settings)
Constructs an instance of SslCertificateClient, using the given settings.
|
protected |
SslCertificateClient(SslCertificateStub stub) |
Modifier and Type | Method and Description |
---|---|
SslCertificateClient.AggregatedListSslCertificatesPagedResponse |
aggregatedListSslCertificates(AggregatedListSslCertificatesHttpRequest request)
Retrieves the list of all SslCertificate resources, regional and global, available to the
specified project.
|
SslCertificateClient.AggregatedListSslCertificatesPagedResponse |
aggregatedListSslCertificates(ProjectName project)
Retrieves the list of all SslCertificate resources, regional and global, available to the
specified project.
|
SslCertificateClient.AggregatedListSslCertificatesPagedResponse |
aggregatedListSslCertificates(String project)
Retrieves the list of all SslCertificate resources, regional and global, available to the
specified project.
|
com.google.api.gax.rpc.UnaryCallable<AggregatedListSslCertificatesHttpRequest,SslCertificateAggregatedList> |
aggregatedListSslCertificatesCallable()
Retrieves the list of all SslCertificate resources, regional and global, available to the
specified project.
|
com.google.api.gax.rpc.UnaryCallable<AggregatedListSslCertificatesHttpRequest,SslCertificateClient.AggregatedListSslCertificatesPagedResponse> |
aggregatedListSslCertificatesPagedCallable()
Retrieves the list of all SslCertificate resources, regional and global, available to the
specified project.
|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static SslCertificateClient |
create()
Constructs an instance of SslCertificateClient with default settings.
|
static SslCertificateClient |
create(SslCertificateSettings settings)
Constructs an instance of SslCertificateClient, using the given settings.
|
static SslCertificateClient |
create(SslCertificateStub stub)
Constructs an instance of SslCertificateClient, using the given stub for making calls.
|
Operation |
deleteSslCertificate(DeleteSslCertificateHttpRequest request)
Deletes the specified SslCertificate resource.
|
Operation |
deleteSslCertificate(ProjectGlobalSslCertificateName sslCertificate)
Deletes the specified SslCertificate resource.
|
Operation |
deleteSslCertificate(String sslCertificate)
Deletes the specified SslCertificate resource.
|
com.google.api.gax.rpc.UnaryCallable<DeleteSslCertificateHttpRequest,Operation> |
deleteSslCertificateCallable()
Deletes the specified SslCertificate resource.
|
SslCertificateSettings |
getSettings() |
SslCertificate |
getSslCertificate(GetSslCertificateHttpRequest request)
Returns the specified SslCertificate resource.
|
SslCertificate |
getSslCertificate(ProjectGlobalSslCertificateName sslCertificate)
Returns the specified SslCertificate resource.
|
SslCertificate |
getSslCertificate(String sslCertificate)
Returns the specified SslCertificate resource.
|
com.google.api.gax.rpc.UnaryCallable<GetSslCertificateHttpRequest,SslCertificate> |
getSslCertificateCallable()
Returns the specified SslCertificate resource.
|
SslCertificateStub |
getStub() |
Operation |
insertSslCertificate(InsertSslCertificateHttpRequest request)
Creates a SslCertificate resource in the specified project using the data included in the
request.
|
Operation |
insertSslCertificate(ProjectName project,
SslCertificate sslCertificateResource)
Creates a SslCertificate resource in the specified project using the data included in the
request.
|
Operation |
insertSslCertificate(String project,
SslCertificate sslCertificateResource)
Creates a SslCertificate resource in the specified project using the data included in the
request.
|
com.google.api.gax.rpc.UnaryCallable<InsertSslCertificateHttpRequest,Operation> |
insertSslCertificateCallable()
Creates a SslCertificate resource in the specified project using the data included in the
request.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
SslCertificateClient.ListSslCertificatesPagedResponse |
listSslCertificates(ListSslCertificatesHttpRequest request)
Retrieves the list of SslCertificate resources available to the specified project.
|
SslCertificateClient.ListSslCertificatesPagedResponse |
listSslCertificates(ProjectName project)
Retrieves the list of SslCertificate resources available to the specified project.
|
SslCertificateClient.ListSslCertificatesPagedResponse |
listSslCertificates(String project)
Retrieves the list of SslCertificate resources available to the specified project.
|
com.google.api.gax.rpc.UnaryCallable<ListSslCertificatesHttpRequest,SslCertificateList> |
listSslCertificatesCallable()
Retrieves the list of SslCertificate resources available to the specified project.
|
com.google.api.gax.rpc.UnaryCallable<ListSslCertificatesHttpRequest,SslCertificateClient.ListSslCertificatesPagedResponse> |
listSslCertificatesPagedCallable()
Retrieves the list of SslCertificate resources available to the specified project.
|
void |
shutdown() |
void |
shutdownNow() |
protected SslCertificateClient(SslCertificateSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") protected SslCertificateClient(SslCertificateStub stub)
public static final SslCertificateClient create() throws IOException
IOException
public static final SslCertificateClient create(SslCertificateSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public static final SslCertificateClient create(SslCertificateStub stub)
public final SslCertificateSettings getSettings()
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public SslCertificateStub getStub()
@BetaApi public final SslCertificateClient.AggregatedListSslCertificatesPagedResponse aggregatedListSslCertificates(ProjectName project)
Sample code:
try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
ProjectName project = ProjectName.of("[PROJECT]");
for (SslCertificatesScopedList element : sslCertificateClient.aggregatedListSslCertificates(project).iterateAll()) {
// doThingsWith(element);
}
}
project
- Name of the project scoping this request.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final SslCertificateClient.AggregatedListSslCertificatesPagedResponse aggregatedListSslCertificates(String project)
Sample code:
try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
ProjectName project = ProjectName.of("[PROJECT]");
for (SslCertificatesScopedList element : sslCertificateClient.aggregatedListSslCertificates(project.toString()).iterateAll()) {
// doThingsWith(element);
}
}
project
- Name of the project scoping this request.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final SslCertificateClient.AggregatedListSslCertificatesPagedResponse aggregatedListSslCertificates(AggregatedListSslCertificatesHttpRequest request)
Sample code:
try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
String formattedProject = ProjectName.format("[PROJECT]");
AggregatedListSslCertificatesHttpRequest request = AggregatedListSslCertificatesHttpRequest.newBuilder()
.setProject(formattedProject)
.build();
for (SslCertificatesScopedList element : sslCertificateClient.aggregatedListSslCertificates(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final com.google.api.gax.rpc.UnaryCallable<AggregatedListSslCertificatesHttpRequest,SslCertificateClient.AggregatedListSslCertificatesPagedResponse> aggregatedListSslCertificatesPagedCallable()
Sample code:
try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
String formattedProject = ProjectName.format("[PROJECT]");
AggregatedListSslCertificatesHttpRequest request = AggregatedListSslCertificatesHttpRequest.newBuilder()
.setProject(formattedProject)
.build();
ApiFuture<AggregatedListSslCertificatesPagedResponse> future = sslCertificateClient.aggregatedListSslCertificatesPagedCallable().futureCall(request);
// Do something
for (SslCertificatesScopedList element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
@BetaApi public final com.google.api.gax.rpc.UnaryCallable<AggregatedListSslCertificatesHttpRequest,SslCertificateAggregatedList> aggregatedListSslCertificatesCallable()
Sample code:
try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
String formattedProject = ProjectName.format("[PROJECT]");
AggregatedListSslCertificatesHttpRequest request = AggregatedListSslCertificatesHttpRequest.newBuilder()
.setProject(formattedProject)
.build();
while (true) {
SslCertificateAggregatedList response = sslCertificateClient.aggregatedListSslCertificatesCallable().call(request);
for (SslCertificatesScopedList element : response.getItemsMap()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
@BetaApi public final Operation deleteSslCertificate(ProjectGlobalSslCertificateName sslCertificate)
Sample code:
try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
ProjectGlobalSslCertificateName sslCertificate = ProjectGlobalSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
Operation response = sslCertificateClient.deleteSslCertificate(sslCertificate);
}
sslCertificate
- Name of the SslCertificate resource to delete.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation deleteSslCertificate(String sslCertificate)
Sample code:
try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
ProjectGlobalSslCertificateName sslCertificate = ProjectGlobalSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
Operation response = sslCertificateClient.deleteSslCertificate(sslCertificate.toString());
}
sslCertificate
- Name of the SslCertificate resource to delete.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation deleteSslCertificate(DeleteSslCertificateHttpRequest request)
Sample code:
try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
String formattedSslCertificate = ProjectGlobalSslCertificateName.format("[PROJECT]", "[SSL_CERTIFICATE]");
DeleteSslCertificateHttpRequest request = DeleteSslCertificateHttpRequest.newBuilder()
.setSslCertificate(formattedSslCertificate)
.build();
Operation response = sslCertificateClient.deleteSslCertificate(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final com.google.api.gax.rpc.UnaryCallable<DeleteSslCertificateHttpRequest,Operation> deleteSslCertificateCallable()
Sample code:
try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
String formattedSslCertificate = ProjectGlobalSslCertificateName.format("[PROJECT]", "[SSL_CERTIFICATE]");
DeleteSslCertificateHttpRequest request = DeleteSslCertificateHttpRequest.newBuilder()
.setSslCertificate(formattedSslCertificate)
.build();
ApiFuture<Operation> future = sslCertificateClient.deleteSslCertificateCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi public final SslCertificate getSslCertificate(ProjectGlobalSslCertificateName sslCertificate)
Sample code:
try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
ProjectGlobalSslCertificateName sslCertificate = ProjectGlobalSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
SslCertificate response = sslCertificateClient.getSslCertificate(sslCertificate);
}
sslCertificate
- Name of the SslCertificate resource to return.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final SslCertificate getSslCertificate(String sslCertificate)
Sample code:
try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
ProjectGlobalSslCertificateName sslCertificate = ProjectGlobalSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
SslCertificate response = sslCertificateClient.getSslCertificate(sslCertificate.toString());
}
sslCertificate
- Name of the SslCertificate resource to return.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final SslCertificate getSslCertificate(GetSslCertificateHttpRequest request)
Sample code:
try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
String formattedSslCertificate = ProjectGlobalSslCertificateName.format("[PROJECT]", "[SSL_CERTIFICATE]");
GetSslCertificateHttpRequest request = GetSslCertificateHttpRequest.newBuilder()
.setSslCertificate(formattedSslCertificate)
.build();
SslCertificate response = sslCertificateClient.getSslCertificate(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final com.google.api.gax.rpc.UnaryCallable<GetSslCertificateHttpRequest,SslCertificate> getSslCertificateCallable()
Sample code:
try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
String formattedSslCertificate = ProjectGlobalSslCertificateName.format("[PROJECT]", "[SSL_CERTIFICATE]");
GetSslCertificateHttpRequest request = GetSslCertificateHttpRequest.newBuilder()
.setSslCertificate(formattedSslCertificate)
.build();
ApiFuture<SslCertificate> future = sslCertificateClient.getSslCertificateCallable().futureCall(request);
// Do something
SslCertificate response = future.get();
}
@BetaApi public final Operation insertSslCertificate(ProjectName project, SslCertificate sslCertificateResource)
Sample code:
try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
ProjectName project = ProjectName.of("[PROJECT]");
SslCertificate sslCertificateResource = SslCertificate.newBuilder().build();
Operation response = sslCertificateClient.insertSslCertificate(project, sslCertificateResource);
}
project
- Project ID for this request.sslCertificateResource
- Represents an SSL Certificate resource.
This SSL certificate resource also contains a private key. You can use SSL keys and certificates to secure connections to a load balancer. For more information, read Creating and Using SSL Certificates. (== resource_for beta.sslCertificates ==) (== resource_for v1.sslCertificates ==)
com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation insertSslCertificate(String project, SslCertificate sslCertificateResource)
Sample code:
try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
ProjectName project = ProjectName.of("[PROJECT]");
SslCertificate sslCertificateResource = SslCertificate.newBuilder().build();
Operation response = sslCertificateClient.insertSslCertificate(project.toString(), sslCertificateResource);
}
project
- Project ID for this request.sslCertificateResource
- Represents an SSL Certificate resource.
This SSL certificate resource also contains a private key. You can use SSL keys and certificates to secure connections to a load balancer. For more information, read Creating and Using SSL Certificates. (== resource_for beta.sslCertificates ==) (== resource_for v1.sslCertificates ==)
com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation insertSslCertificate(InsertSslCertificateHttpRequest request)
Sample code:
try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
String formattedProject = ProjectName.format("[PROJECT]");
SslCertificate sslCertificateResource = SslCertificate.newBuilder().build();
InsertSslCertificateHttpRequest request = InsertSslCertificateHttpRequest.newBuilder()
.setProject(formattedProject)
.setSslCertificateResource(sslCertificateResource)
.build();
Operation response = sslCertificateClient.insertSslCertificate(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final com.google.api.gax.rpc.UnaryCallable<InsertSslCertificateHttpRequest,Operation> insertSslCertificateCallable()
Sample code:
try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
String formattedProject = ProjectName.format("[PROJECT]");
SslCertificate sslCertificateResource = SslCertificate.newBuilder().build();
InsertSslCertificateHttpRequest request = InsertSslCertificateHttpRequest.newBuilder()
.setProject(formattedProject)
.setSslCertificateResource(sslCertificateResource)
.build();
ApiFuture<Operation> future = sslCertificateClient.insertSslCertificateCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi public final SslCertificateClient.ListSslCertificatesPagedResponse listSslCertificates(ProjectName project)
Sample code:
try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
ProjectName project = ProjectName.of("[PROJECT]");
for (SslCertificate element : sslCertificateClient.listSslCertificates(project).iterateAll()) {
// doThingsWith(element);
}
}
project
- Project ID for this request.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final SslCertificateClient.ListSslCertificatesPagedResponse listSslCertificates(String project)
Sample code:
try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
ProjectName project = ProjectName.of("[PROJECT]");
for (SslCertificate element : sslCertificateClient.listSslCertificates(project.toString()).iterateAll()) {
// doThingsWith(element);
}
}
project
- Project ID for this request.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final SslCertificateClient.ListSslCertificatesPagedResponse listSslCertificates(ListSslCertificatesHttpRequest request)
Sample code:
try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
String formattedProject = ProjectName.format("[PROJECT]");
ListSslCertificatesHttpRequest request = ListSslCertificatesHttpRequest.newBuilder()
.setProject(formattedProject)
.build();
for (SslCertificate element : sslCertificateClient.listSslCertificates(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final com.google.api.gax.rpc.UnaryCallable<ListSslCertificatesHttpRequest,SslCertificateClient.ListSslCertificatesPagedResponse> listSslCertificatesPagedCallable()
Sample code:
try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
String formattedProject = ProjectName.format("[PROJECT]");
ListSslCertificatesHttpRequest request = ListSslCertificatesHttpRequest.newBuilder()
.setProject(formattedProject)
.build();
ApiFuture<ListSslCertificatesPagedResponse> future = sslCertificateClient.listSslCertificatesPagedCallable().futureCall(request);
// Do something
for (SslCertificate element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
@BetaApi public final com.google.api.gax.rpc.UnaryCallable<ListSslCertificatesHttpRequest,SslCertificateList> listSslCertificatesCallable()
Sample code:
try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
String formattedProject = ProjectName.format("[PROJECT]");
ListSslCertificatesHttpRequest request = ListSslCertificatesHttpRequest.newBuilder()
.setProject(formattedProject)
.build();
while (true) {
SslCertificateList response = sslCertificateClient.listSslCertificatesCallable().call(request);
for (SslCertificate element : response.getItemsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final void close()
close
in interface AutoCloseable
public void shutdown()
shutdown
in interface com.google.api.gax.core.BackgroundResource
public boolean isShutdown()
isShutdown
in interface com.google.api.gax.core.BackgroundResource
public boolean isTerminated()
isTerminated
in interface com.google.api.gax.core.BackgroundResource
public void shutdownNow()
shutdownNow
in interface com.google.api.gax.core.BackgroundResource
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
awaitTermination
in interface com.google.api.gax.core.BackgroundResource
InterruptedException
Copyright © 2019 Google LLC. All rights reserved.