Package com.google.cloud.hadoop.util
Class HttpTransportFactory
- java.lang.Object
-
- com.google.cloud.hadoop.util.HttpTransportFactory
-
public class HttpTransportFactory extends Object
Factory for creating HttpTransport types.
-
-
Constructor Summary
Constructors Constructor Description HttpTransportFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static com.google.api.client.http.HttpTransportcreateHttpTransport()Create anHttpTransportwith socketKeepAlive truestatic com.google.api.client.http.HttpTransportcreateHttpTransport(String proxyAddress, RedactedString proxyUsername, RedactedString proxyPassword)Create anHttpTransportbased on a type class and an optional HTTP proxy.static com.google.api.client.http.HttpTransportcreateHttpTransport(String proxyAddress, RedactedString proxyUsername, RedactedString proxyPassword, Duration readTimeout)Create anHttpTransportbased on a type class, optional HTTP proxy and optional socket read timeout.static com.google.api.client.http.javanet.NetHttpTransportcreateNetHttpTransport(URI proxyUri, PasswordAuthentication proxyAuth, Duration readTimeout)Create anNetHttpTransportfor calling Google APIs with an optional HTTP proxy.
-
-
-
Method Detail
-
createHttpTransport
public static com.google.api.client.http.HttpTransport createHttpTransport() throws IOExceptionCreate anHttpTransportwith socketKeepAlive true- Returns:
- The resulting HttpTransport.
- Throws:
IllegalArgumentException- If the proxy address is invalid.IOException- If there is an issue connecting to Google's Certification server.
-
createHttpTransport
public static com.google.api.client.http.HttpTransport createHttpTransport(@Nullable String proxyAddress, @Nullable RedactedString proxyUsername, @Nullable RedactedString proxyPassword) throws IOExceptionCreate anHttpTransportbased on a type class and an optional HTTP proxy.- Parameters:
proxyAddress- The HTTP proxy to use with the transport. Of the form hostname:port. If empty no proxy will be used.proxyUsername- The HTTP proxy username to use with the transport. If empty no proxy username will be used.proxyPassword- The HTTP proxy password to use with the transport. If empty no proxy password will be used.- Returns:
- The resulting HttpTransport.
- Throws:
IllegalArgumentException- If the proxy address is invalid.IOException- If there is an issue connecting to Google's Certification server.
-
createHttpTransport
public static com.google.api.client.http.HttpTransport createHttpTransport(@Nullable String proxyAddress, @Nullable RedactedString proxyUsername, @Nullable RedactedString proxyPassword, @Nullable Duration readTimeout) throws IOExceptionCreate anHttpTransportbased on a type class, optional HTTP proxy and optional socket read timeout.- Parameters:
proxyAddress- The HTTP proxy to use with the transport. Of the form hostname:port. If empty no proxy will be used.proxyUsername- The HTTP proxy username to use with the transport. If empty no proxy username will be used.proxyPassword- The HTTP proxy password to use with the transport. If empty no proxy password will be used.readTimeout- The socket read timeout to apply immediately on all HTTP requests. If empty, no socket read timeout will be applied.- Returns:
- The resulting HttpTransport.
- Throws:
IllegalArgumentException- If the proxy address is invalid.IOException- If there is an issue connecting to Google's Certification server.
-
createNetHttpTransport
public static com.google.api.client.http.javanet.NetHttpTransport createNetHttpTransport(@Nullable URI proxyUri, @Nullable PasswordAuthentication proxyAuth, @Nullable Duration readTimeout) throws IOException, GeneralSecurityExceptionCreate anNetHttpTransportfor calling Google APIs with an optional HTTP proxy.- Parameters:
proxyUri- Optional HTTP proxy URI to use with the transport.proxyAuth- Optional HTTP proxy credentials to authenticate with the transport proxy.readTimeout- Optional socket read timeout to apply immediately on all HTTP requests.- Returns:
- The resulting HttpTransport.
- Throws:
IOException- If there is an issue connecting to Google's certification server.GeneralSecurityException- If there is a security issue with the keystore.
-
-