Package com.cumulocity.sdk.client
Class RestConnector
java.lang.Object
com.cumulocity.sdk.client.RestConnector
- All Implemented Interfaces:
RestOperations
,AutoCloseable
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionRestConnector
(PlatformParameters platformParameters, ResponseParser responseParser) protected
RestConnector
(PlatformParameters platformParameters, ResponseParser responseParser, jakarta.ws.rs.client.Client client) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
static jakarta.ws.rs.client.Client
createClient
(PlatformParameters platformParameters) static jakarta.ws.rs.client.Client
createURLConnectionClient
(PlatformParameters platformParameters) void
<T extends ResourceRepresentation>
Tget
(String path, CumulocityMediaType mediaType, Class<T> responseType) jakarta.ws.rs.core.Response
<T> T
jakarta.ws.rs.client.Client
jakarta.ws.rs.core.Response.Status
getStatus
(String path, CumulocityMediaType mediaType) boolean
isClosed()
<Result extends ResourceRepresentation,
Param extends ResourceRepresentation>
Resultpost
(String path, CumulocityMediaType contentType, CumulocityMediaType accept, Param representation, Class<Result> clazz) <T extends ResourceRepresentation>
T<T extends ResourceRepresentation>
FuturepostAsync
(String path, CumulocityMediaType mediaType, T representation) <T extends ResourceRepresentation>
TpostFile
(String path, T representation, byte[] bytes, jakarta.ws.rs.core.MediaType mediaType, Class<T> responseClass) <T extends ResourceRepresentation>
T<T extends ResourceRepresentation>
TpostFileAsStream
(String path, T representation, InputStream inputStream, jakarta.ws.rs.core.MediaType mediaType, Class<T> responseClass) <T extends ResourceRepresentation>
TpostFileAsStream
(String path, T representation, InputStream inputStream, Class<T> responseClass) <T extends ResourceRepresentation>
TpostStream
(String path, CumulocityMediaType mediaType, InputStream content, Class<T> responseClass) void
postStream
(String path, InputStream inputStream, jakarta.ws.rs.core.MediaType inputStreamMediaType) <T extends ResourceRepresentation>
T<T extends ResourceRepresentation>
voidpostWithoutResponse
(String path, jakarta.ws.rs.core.MediaType mediaType, T representation) <T extends ResourceRepresentationWithId>
T<T extends ResourceRepresentation>
FutureputAsync
(String path, CumulocityMediaType mediaType, T representation) <T extends ResourceRepresentation>
TputStream
(String path, jakarta.ws.rs.core.MediaType mediaType, InputStream content, Class<T> responseClass) <T extends ResourceRepresentation>
TputStream
(String path, String contentType, InputStream content, Class<T> responseClass) <T extends ResourceRepresentation>
T
-
Field Details
-
X_CUMULOCITY_APPLICATION_KEY
- See Also:
-
X_CUMULOCITY_REQUEST_ORIGIN
- See Also:
-
MIME_VERSION
- See Also:
-
TFA_TOKEN_HEADER
- See Also:
-
-
Constructor Details
-
RestConnector
-
RestConnector
protected RestConnector(PlatformParameters platformParameters, ResponseParser responseParser, jakarta.ws.rs.client.Client client)
-
-
Method Details
-
getPlatformParameters
-
getClient
public jakarta.ws.rs.client.Client getClient() -
getResponseParser
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
isClosed
public boolean isClosed() -
get
public <T extends ResourceRepresentation> T get(String path, CumulocityMediaType mediaType, Class<T> responseType) throws SDKException - Specified by:
get
in interfaceRestOperations
- Throws:
SDKException
-
get
public <T> T get(String path, jakarta.ws.rs.core.MediaType mediaType, Class<T> responseType) throws SDKException - Specified by:
get
in interfaceRestOperations
- Throws:
SDKException
-
get
-
getStatus
public jakarta.ws.rs.core.Response.Status getStatus(String path, CumulocityMediaType mediaType) throws SDKException - Specified by:
getStatus
in interfaceRestOperations
- Throws:
SDKException
-
postStream
public <T extends ResourceRepresentation> T postStream(String path, CumulocityMediaType mediaType, InputStream content, Class<T> responseClass) throws SDKException - Specified by:
postStream
in interfaceRestOperations
- Throws:
SDKException
-
postText
public <T extends ResourceRepresentation> T postText(String path, String content, Class<T> responseClass) - Specified by:
postText
in interfaceRestOperations
-
putText
public <T extends ResourceRepresentation> T putText(String path, String content, Class<T> responseClass) - Specified by:
putText
in interfaceRestOperations
-
putStream
public <T extends ResourceRepresentation> T putStream(String path, String contentType, InputStream content, Class<T> responseClass) - Specified by:
putStream
in interfaceRestOperations
-
putStream
public <T extends ResourceRepresentation> T putStream(String path, jakarta.ws.rs.core.MediaType mediaType, InputStream content, Class<T> responseClass) - Specified by:
putStream
in interfaceRestOperations
-
postStream
public void postStream(String path, InputStream inputStream, jakarta.ws.rs.core.MediaType inputStreamMediaType) - Specified by:
postStream
in interfaceRestOperations
-
postFile
public <T extends ResourceRepresentation> T postFile(String path, T representation, byte[] bytes, Class<T> responseClass) - Specified by:
postFile
in interfaceRestOperations
-
postFile
public <T extends ResourceRepresentation> T postFile(String path, T representation, byte[] bytes, jakarta.ws.rs.core.MediaType mediaType, Class<T> responseClass) - Specified by:
postFile
in interfaceRestOperations
-
postFileAsStream
public <T extends ResourceRepresentation> T postFileAsStream(String path, T representation, InputStream inputStream, Class<T> responseClass) - Specified by:
postFileAsStream
in interfaceRestOperations
-
postFileAsStream
public <T extends ResourceRepresentation> T postFileAsStream(String path, T representation, InputStream inputStream, jakarta.ws.rs.core.MediaType mediaType, Class<T> responseClass) - Specified by:
postFileAsStream
in interfaceRestOperations
-
put
public <T extends ResourceRepresentationWithId> T put(String path, jakarta.ws.rs.core.MediaType mediaType, T representation) throws SDKException - Specified by:
put
in interfaceRestOperations
- Throws:
SDKException
-
postAsync
public <T extends ResourceRepresentation> Future postAsync(String path, CumulocityMediaType mediaType, T representation) throws SDKException - Specified by:
postAsync
in interfaceRestOperations
- Throws:
SDKException
-
putAsync
public <T extends ResourceRepresentation> Future putAsync(String path, CumulocityMediaType mediaType, T representation) throws SDKException - Specified by:
putAsync
in interfaceRestOperations
- Throws:
SDKException
-
post
public <T extends ResourceRepresentation> T post(String path, jakarta.ws.rs.core.MediaType mediaType, T representation) throws SDKException - Specified by:
post
in interfaceRestOperations
- Throws:
SDKException
-
post
public <T extends ResourceRepresentationWithId> T post(String path, jakarta.ws.rs.core.MediaType mediaType, T representation) throws SDKException - Specified by:
post
in interfaceRestOperations
- Throws:
SDKException
-
postWithoutResponse
public <T extends ResourceRepresentation> void postWithoutResponse(String path, jakarta.ws.rs.core.MediaType mediaType, T representation) throws SDKException - Specified by:
postWithoutResponse
in interfaceRestOperations
- Throws:
SDKException
-
post
public <Result extends ResourceRepresentation,Param extends ResourceRepresentation> Result post(String path, CumulocityMediaType contentType, CumulocityMediaType accept, Param representation, Class<Result> clazz) - Specified by:
post
in interfaceRestOperations
-
put
public <T extends ResourceRepresentation> T put(String path, jakarta.ws.rs.core.MediaType mediaType, T representation) throws SDKException - Specified by:
put
in interfaceRestOperations
- Throws:
SDKException
-
delete
- Specified by:
delete
in interfaceRestOperations
- Throws:
SDKException
-
createClient
-
createURLConnectionClient
public static jakarta.ws.rs.client.Client createURLConnectionClient(PlatformParameters platformParameters)
-