Package com.google.auth.oauth2
Class MetricsUtils
java.lang.Object
com.google.auth.oauth2.MetricsUtils
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static String
(package private) static String
getGoogleCredentialsMetricsHeader
(MetricsUtils.RequestType requestType, CredentialTypeForMetrics credentialTypeForMetrics) Formulates metrics header string.(package private) static String
Gets the x-goog-api-client header value for the current Java language version and the auth library version.(package private) static void
setMetricsHeader
(com.google.api.client.http.HttpRequest request, String metricsHeader)
-
Field Details
-
API_CLIENT_HEADER
- See Also:
-
CRED_TYPE
- See Also:
-
AUTH_REQUEST_TYPE
- See Also:
-
authLibraryVersion
-
javaLanguageVersion
-
-
Constructor Details
-
MetricsUtils
MetricsUtils()
-
-
Method Details
-
getLanguageAndAuthLibraryVersions
Gets the x-goog-api-client header value for the current Java language version and the auth library version.- Returns:
- the header value.
-
getAuthLibraryVersion
-
getGoogleCredentialsMetricsHeader
static String getGoogleCredentialsMetricsHeader(MetricsUtils.RequestType requestType, CredentialTypeForMetrics credentialTypeForMetrics) Formulates metrics header string. Header string takes format: “gl-java/JAVA_VERSION auth/LIB_VERSION auth-request-type/REQUEST_TYPE cred-type/CREDENTIAL_TYPE”. "auth-request-type" and "cred-type" can be omitted.- Parameters:
requestType
- Auth request type to be specified in metrics, omit whenRequestType.UNTRACKED
credentialTypeForMetrics
- Credential type to be included in metrics string, omit whenCredentialTypeForMetrics.DO_NOT_SEND
- Returns:
- metrics header string to send
-
setMetricsHeader
-