Package com.cumulocity.sdk.client
Class RestConnector
java.lang.Object
com.cumulocity.sdk.client.RestConnector
- All Implemented Interfaces:
RestOperations,AutoCloseable
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionRestConnector(PlatformParameters platformParameters, ResponseParser responseParser) protectedRestConnector(PlatformParameters platformParameters, ResponseParser responseParser, jakarta.ws.rs.client.Client client) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()static jakarta.ws.rs.client.ClientcreateClient(PlatformParameters platformParameters) static jakarta.ws.rs.client.ClientcreateURLConnectionClient(PlatformParameters platformParameters) void<T extends ResourceRepresentation>
Tget(String path, CumulocityMediaType mediaType, Class<T> responseType) jakarta.ws.rs.core.Response<T> Tjakarta.ws.rs.client.Clientjakarta.ws.rs.core.Response.StatusgetStatus(String path, CumulocityMediaType mediaType) booleanisClosed()<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) void<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>
TpostMultiPart(String path, org.glassfish.jersey.media.multipart.FormDataMultiPart form, Class<T> responseClass) <T extends ResourceRepresentation>
TpostStream(String path, CumulocityMediaType mediaType, InputStream content, Class<T> responseClass) voidpostStream(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) void<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:
closein interfaceAutoCloseable
-
isClosed
public boolean isClosed() -
get
public <T extends ResourceRepresentation> T get(String path, CumulocityMediaType mediaType, Class<T> responseType) throws SDKException - Specified by:
getin interfaceRestOperations- Throws:
SDKException
-
get
public <T> T get(String path, jakarta.ws.rs.core.MediaType mediaType, Class<T> responseType) throws SDKException - Specified by:
getin interfaceRestOperations- Throws:
SDKException
-
get
-
getStatus
public jakarta.ws.rs.core.Response.Status getStatus(String path, CumulocityMediaType mediaType) throws SDKException - Specified by:
getStatusin interfaceRestOperations- Throws:
SDKException
-
postStream
public <T extends ResourceRepresentation> T postStream(String path, CumulocityMediaType mediaType, InputStream content, Class<T> responseClass) throws SDKException - Specified by:
postStreamin interfaceRestOperations- Throws:
SDKException
-
postText
public <T extends ResourceRepresentation> T postText(String path, String content, Class<T> responseClass) - Specified by:
postTextin interfaceRestOperations
-
putText
public <T extends ResourceRepresentation> T putText(String path, String content, Class<T> responseClass) - Specified by:
putTextin interfaceRestOperations
-
putStream
public <T extends ResourceRepresentation> T putStream(String path, String contentType, InputStream content, Class<T> responseClass) - Specified by:
putStreamin interfaceRestOperations
-
putStream
public <T extends ResourceRepresentation> T putStream(String path, jakarta.ws.rs.core.MediaType mediaType, InputStream content, Class<T> responseClass) - Specified by:
putStreamin interfaceRestOperations
-
postStream
public void postStream(String path, InputStream inputStream, jakarta.ws.rs.core.MediaType inputStreamMediaType) - Specified by:
postStreamin interfaceRestOperations
-
postFile
public <T extends ResourceRepresentation> T postFile(String path, T representation, byte[] bytes, Class<T> responseClass) - Specified by:
postFilein 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:
postFilein interfaceRestOperations
-
postFile
- Specified by:
postFilein interfaceRestOperations
-
putFile
- Specified by:
putFilein interfaceRestOperations
-
postFileAsStream
public <T extends ResourceRepresentation> T postFileAsStream(String path, T representation, InputStream inputStream, Class<T> responseClass) - Specified by:
postFileAsStreamin 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:
postFileAsStreamin interfaceRestOperations
-
postMultiPart
public <T extends ResourceRepresentation> T postMultiPart(String path, org.glassfish.jersey.media.multipart.FormDataMultiPart form, Class<T> responseClass) - Specified by:
postMultiPartin interfaceRestOperations
-
put
public <T extends ResourceRepresentationWithId> T put(String path, jakarta.ws.rs.core.MediaType mediaType, T representation) throws SDKException - Specified by:
putin interfaceRestOperations- Throws:
SDKException
-
postAsync
public <T extends ResourceRepresentation> Future postAsync(String path, CumulocityMediaType mediaType, T representation) throws SDKException - Specified by:
postAsyncin interfaceRestOperations- Throws:
SDKException
-
putAsync
public <T extends ResourceRepresentation> Future putAsync(String path, CumulocityMediaType mediaType, T representation) throws SDKException - Specified by:
putAsyncin interfaceRestOperations- Throws:
SDKException
-
post
public <T extends ResourceRepresentation> T post(String path, jakarta.ws.rs.core.MediaType mediaType, T representation) throws SDKException - Specified by:
postin interfaceRestOperations- Throws:
SDKException
-
post
public <T extends ResourceRepresentationWithId> T post(String path, jakarta.ws.rs.core.MediaType mediaType, T representation) throws SDKException - Specified by:
postin interfaceRestOperations- Throws:
SDKException
-
postWithoutResponse
public <T extends ResourceRepresentation> void postWithoutResponse(String path, jakarta.ws.rs.core.MediaType mediaType, T representation) throws SDKException - Specified by:
postWithoutResponsein 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:
postin interfaceRestOperations
-
put
public <T extends ResourceRepresentation> T put(String path, jakarta.ws.rs.core.MediaType mediaType, T representation) throws SDKException - Specified by:
putin interfaceRestOperations- Throws:
SDKException
-
delete
- Specified by:
deletein interfaceRestOperations- Throws:
SDKException
-
createClient
-
createURLConnectionClient
public static jakarta.ws.rs.client.Client createURLConnectionClient(PlatformParameters platformParameters)
-