Skip to content
This repository was archived by the owner on Jul 13, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 4 additions & 24 deletions src/main/resources/com/google/api/codegen/java/settings.snip
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,6 @@
@end

@private constants(xsettingsClass)
@if xsettingsClass.hasDefaultServiceAddress
/**
* The default address of the service.
*/
private static final String DEFAULT_SERVICE_ADDRESS = "{@xsettingsClass.serviceAddress}";
{@""}
@end

/**
* The default port of the service.
*/
private static final int DEFAULT_SERVICE_PORT = {@xsettingsClass.servicePort};

@if xsettingsClass.hasDefaultServiceScopes
/**
* The default scopes of the service.
Expand Down Expand Up @@ -102,19 +89,13 @@

@if xsettingsClass.hasDefaultServiceAddress
/**
* Returns the default service address.
* Returns the default service endpoint.
*/
public static String getDefaultServiceAddress() {
return DEFAULT_SERVICE_ADDRESS;
public static String getDefaultEndpoint() {
return "{@xsettingsClass.serviceAddress}:{@xsettingsClass.servicePort}";
}

@end
/**
* Returns the default service port.
*/
public static int getDefaultServicePort() {
return DEFAULT_SERVICE_PORT;
}

@if xsettingsClass.hasDefaultServiceScopes
/**
Expand All @@ -141,9 +122,8 @@
public static InstantiatingChannelProvider.Builder defaultChannelProviderBuilder() {
return InstantiatingChannelProvider.newBuilder()
@if xsettingsClass.hasDefaultServiceAddress
.setServiceAddress(DEFAULT_SERVICE_ADDRESS)
.setEndpoint(getDefaultEndpoint())
@end
.setPort(DEFAULT_SERVICE_PORT)
.setGeneratorHeader(DEFAULT_GAPIC_NAME, getGapicVersion())
.setCredentialsProvider(defaultCredentialsProviderBuilder().build());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,16 +136,6 @@ import org.joda.time.Duration;
*/
@Generated("by GAPIC v0.0.5")
public class LibrarySettings extends ClientSettings {
/**
* The default address of the service.
*/
private static final String DEFAULT_SERVICE_ADDRESS = "library-example.googleapis.com";

/**
* The default port of the service.
*/
private static final int DEFAULT_SERVICE_PORT = 443;

/**
* The default scopes of the service.
*/
Expand All @@ -154,7 +144,6 @@ public class LibrarySettings extends ClientSettings {
.add("https://www.googleapis.com/auth/library")
.build();


private static final String DEFAULT_GAPIC_NAME = "gapic";
private static final String DEFAULT_GAPIC_VERSION = "";

Expand Down Expand Up @@ -389,18 +378,12 @@ public class LibrarySettings extends ClientSettings {
}

/**
* Returns the default service address.
* Returns the default service endpoint.
*/
public static String getDefaultServiceAddress() {
return DEFAULT_SERVICE_ADDRESS;
public static String getDefaultEndpoint() {
return "library-example.googleapis.com:443";
}

/**
* Returns the default service port.
*/
public static int getDefaultServicePort() {
return DEFAULT_SERVICE_PORT;
}

/**
* Returns the default service scopes.
Expand All @@ -422,8 +405,7 @@ public class LibrarySettings extends ClientSettings {
/** Returns a builder for the default ChannelProvider for this service. */
public static InstantiatingChannelProvider.Builder defaultChannelProviderBuilder() {
return InstantiatingChannelProvider.newBuilder()
.setServiceAddress(DEFAULT_SERVICE_ADDRESS)
.setPort(DEFAULT_SERVICE_PORT)
.setEndpoint(getDefaultEndpoint())
.setGeneratorHeader(DEFAULT_GAPIC_NAME, getGapicVersion())
.setCredentialsProvider(defaultCredentialsProviderBuilder().build());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ import org.joda.time.Duration;
@ExperimentalApi
public class NoTemplatesApiServiceSettings extends ClientSettings {

/**
* The default port of the service.
*/
private static final int DEFAULT_SERVICE_PORT = 443;


private static final String DEFAULT_GAPIC_NAME = "gapic";
private static final String DEFAULT_GAPIC_VERSION = "";

Expand All @@ -84,12 +78,6 @@ public class NoTemplatesApiServiceSettings extends ClientSettings {
return InstantiatingExecutorProvider.newBuilder();
}

/**
* Returns the default service port.
*/
public static int getDefaultServicePort() {
return DEFAULT_SERVICE_PORT;
}


/**
Expand All @@ -103,7 +91,6 @@ public class NoTemplatesApiServiceSettings extends ClientSettings {
/** Returns a builder for the default ChannelProvider for this service. */
public static InstantiatingChannelProvider.Builder defaultChannelProviderBuilder() {
return InstantiatingChannelProvider.newBuilder()
.setPort(DEFAULT_SERVICE_PORT)
.setGeneratorHeader(DEFAULT_GAPIC_NAME, getGapicVersion())
.setCredentialsProvider(defaultCredentialsProviderBuilder().build());
}
Expand Down