Class GXConnection
java.lang.Object
org.gcube.common.gxhttp.reference.GXConnection
Deprecated, for removal: This API element is subject to removal in a future version.
A remote connection for a
GXHTTPStringRequest. It sends the request through a
GXRequest and presents the GXResponse as an HttpURLConnection.- Author:
- Manuele Simi (ISTI-CNR), Luca Frosini (ISTI-CNR)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDeprecated, for removal: This API element is subject to removal in a future version.The HTTP methods. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final StringDeprecated, for removal: This API element is subject to removal in a future version.The address of the remote service.static final StringDeprecated, for removal: This API element is subject to removal in a future version.The application/json;charset=UTF-8 content type.static final StringDeprecated, for removal: This API element is subject to removal in a future version.System property holding the default connect timeout, in milliseconds (0means infinite).static final intDeprecated, for removal: This API element is subject to removal in a future version.Connect timeout used when "gxhttp.connectTimeout" is not set, in milliseconds.static final intDeprecated, for removal: This API element is subject to removal in a future version.Read timeout used when "gxhttp.readTimeout" is not set, in milliseconds.protected static final org.slf4j.LoggerDeprecated, for removal: This API element is subject to removal in a future version.The logger.static final StringDeprecated, for removal: This API element is subject to removal in a future version.The parameter equals.static final StringDeprecated, for removal: This API element is subject to removal in a future version.The parameter separator.static final StringDeprecated, for removal: This API element is subject to removal in a future version.The parameter starter.static final StringDeprecated, for removal: This API element is subject to removal in a future version.The path separator.static final StringDeprecated, for removal: This API element is subject to removal in a future version.System property holding the default read timeout, in milliseconds (0means infinite).static final StringDeprecated, for removal: This API element is subject to removal in a future version.The UTF-8 charset. -
Constructor Summary
ConstructorsConstructorDescriptionGXConnection(String address) Deprecated, for removal: This API element is subject to removal in a future version.Creates a new connection. -
Method Summary
Modifier and TypeMethodDescriptionvoidDeprecated, for removal: This API element is subject to removal in a future version.The body of the request.voidaddBodyAsStream(InputStream bodyAsStream) Deprecated, for removal: This API element is subject to removal in a future version.protected voidDeprecated, for removal: This API element is subject to removal in a future version.Adds a path part to the connection.static intDeprecated, for removal: This API element is subject to removal in a future version.Gets the default connect timeout: "gxhttp.connectTimeout" when set, otherwise 30000.static intDeprecated, for removal: This API element is subject to removal in a future version.Gets the default read timeout: "gxhttp.readTimeout" when set, otherwise 300000.voidreset()Deprecated, for removal: This API element is subject to removal in a future version.Resets the connection.send(GXConnection.HTTPMETHOD method) Deprecated, for removal: This API element is subject to removal in a future version.Sends the request with the given methodprotected voidDeprecated, for removal: This API element is subject to removal in a future version.Sets the agent for the connection.voidsetConnectTimeout(int connectTimeout) Deprecated, for removal: This API element is subject to removal in a future version.Sets the connect timeout of this connection.voidsetPathParameters(String parameters) Deprecated, for removal: This API element is subject to removal in a future version.Sets the path parameters for the connection.voidsetProperty(String name, String value) Deprecated, for removal: This API element is subject to removal in a future version.Adds a property as header.voidsetQueryParameters(String parameters) Deprecated, for removal: This API element is subject to removal in a future version.Sets the query parameters for the connection.voidsetReadTimeout(int readTimeout) Deprecated, for removal: This API element is subject to removal in a future version.Sets the read timeout of this connection.
-
Field Details
-
APPLICATION_JSON_CHARSET_UTF_8
Deprecated, for removal: This API element is subject to removal in a future version.The application/json;charset=UTF-8 content type.- See Also:
-
PATH_SEPARATOR
Deprecated, for removal: This API element is subject to removal in a future version.The path separator.- See Also:
-
PARAM_STARTER
Deprecated, for removal: This API element is subject to removal in a future version.The parameter starter.- See Also:
-
PARAM_EQUALS
Deprecated, for removal: This API element is subject to removal in a future version.The parameter equals.- See Also:
-
PARAM_SEPARATOR
Deprecated, for removal: This API element is subject to removal in a future version.The parameter separator.- See Also:
-
UTF8
Deprecated, for removal: This API element is subject to removal in a future version.The UTF-8 charset.- See Also:
-
logger
protected static final org.slf4j.Logger loggerDeprecated, for removal: This API element is subject to removal in a future version.The logger. -
CONNECT_TIMEOUT_PROPERTY
Deprecated, for removal: This API element is subject to removal in a future version.System property holding the default connect timeout, in milliseconds (0means infinite).- See Also:
-
READ_TIMEOUT_PROPERTY
Deprecated, for removal: This API element is subject to removal in a future version.System property holding the default read timeout, in milliseconds (0means infinite).- See Also:
-
DEFAULT_CONNECT_TIMEOUT
public static final int DEFAULT_CONNECT_TIMEOUTDeprecated, for removal: This API element is subject to removal in a future version.Connect timeout used when "gxhttp.connectTimeout" is not set, in milliseconds.- See Also:
-
DEFAULT_READ_TIMEOUT
public static final int DEFAULT_READ_TIMEOUTDeprecated, for removal: This API element is subject to removal in a future version.Read timeout used when "gxhttp.readTimeout" is not set, in milliseconds.- See Also:
-
address
Deprecated, for removal: This API element is subject to removal in a future version.The address of the remote service.
-
-
Constructor Details
-
GXConnection
Deprecated, for removal: This API element is subject to removal in a future version.Creates a new connection.- Parameters:
address- the address of the remote service
-
-
Method Details
-
getDefaultConnectTimeout
public static int getDefaultConnectTimeout()Deprecated, for removal: This API element is subject to removal in a future version.Gets the default connect timeout: "gxhttp.connectTimeout" when set, otherwise 30000.- Returns:
- the timeout in milliseconds;
0means infinite
-
getDefaultReadTimeout
public static int getDefaultReadTimeout()Deprecated, for removal: This API element is subject to removal in a future version.Gets the default read timeout: "gxhttp.readTimeout" when set, otherwise 300000.- Returns:
- the timeout in milliseconds;
0means infinite
-
addPath
Deprecated, for removal: This API element is subject to removal in a future version.Adds a path part to the connection.- Parameters:
pathPart- the path part to add- Throws:
UnsupportedEncodingException- never, kept for compatibility
-
send
Deprecated, for removal: This API element is subject to removal in a future version.Sends the request with the given method- Parameters:
method- the HTTP method- Returns:
- the connection
- Throws:
GXResponseException- if the request was sent but no response status was received: the server may have processed itException- if an error occurs before the request reaches the server
-
setAgent
Deprecated, for removal: This API element is subject to removal in a future version.Sets the agent for the connection.- Parameters:
agent- the agent
-
setPathParameters
Deprecated, for removal: This API element is subject to removal in a future version.Sets the path parameters for the connection.- Parameters:
parameters- the parameters
-
setQueryParameters
Deprecated, for removal: This API element is subject to removal in a future version.Sets the query parameters for the connection.- Parameters:
parameters- the parameters
-
reset
public void reset()Deprecated, for removal: This API element is subject to removal in a future version.Resets the connection. -
addBody
Deprecated, for removal: This API element is subject to removal in a future version.The body of the request.- Parameters:
body- the body
-
addBodyAsStream
Deprecated, for removal: This API element is subject to removal in a future version.- Parameters:
bodyAsStream- the stream to set as input
-
setProperty
Deprecated, for removal: This API element is subject to removal in a future version.Adds a property as header.- Parameters:
name- the name of the propertyvalue- the value of the property
-
setConnectTimeout
public void setConnectTimeout(int connectTimeout) Deprecated, for removal: This API element is subject to removal in a future version.Sets the connect timeout of this connection.- Parameters:
connectTimeout- the timeout in milliseconds;0means infinite
-
setReadTimeout
public void setReadTimeout(int readTimeout) Deprecated, for removal: This API element is subject to removal in a future version.Sets the read timeout of this connection.- Parameters:
readTimeout- the timeout in milliseconds;0means infinite
-
GXRequest, which returns aGXResponse