public class RestConnector extends Object implements RestOperations
Modifier and Type | Class and Description |
---|---|
static class |
RestConnector.ProxyHttpURLConnectionFactory |
Modifier and Type | Field and Description |
---|---|
static String |
X_CUMULOCITY_APPLICATION_KEY |
static String |
X_CUMULOCITY_REQUEST_ORIGIN |
Modifier | Constructor and Description |
---|---|
|
RestConnector(PlatformParameters platformParameters,
ResponseParser responseParser) |
protected |
RestConnector(PlatformParameters platformParameters,
ResponseParser responseParser,
com.sun.jersey.api.client.Client client) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
static com.sun.jersey.api.client.Client |
createClient(PlatformParameters platformParameters) |
static com.sun.jersey.api.client.Client |
createURLConnectionClient(PlatformParameters platformParameters) |
void |
delete(String path) |
<T extends ResourceRepresentation> |
get(String path,
CumulocityMediaType mediaType,
Class<T> responseType) |
com.sun.jersey.api.client.ClientResponse |
get(String path,
javax.ws.rs.core.MediaType mediaType) |
<T> T |
get(String path,
javax.ws.rs.core.MediaType mediaType,
Class<T> responseType) |
com.sun.jersey.api.client.Client |
getClient() |
PlatformParameters |
getPlatformParameters() |
ResponseParser |
getResponseParser() |
javax.ws.rs.core.Response.Status |
getStatus(String path,
CumulocityMediaType mediaType) |
<Result extends ResourceRepresentation,Param extends ResourceRepresentation> |
post(String path,
CumulocityMediaType contentType,
CumulocityMediaType accept,
Param representation,
Class<Result> clazz) |
<T extends ResourceRepresentation> |
post(String path,
javax.ws.rs.core.MediaType mediaType,
T representation) |
<T extends ResourceRepresentationWithId> |
post(String path,
javax.ws.rs.core.MediaType mediaType,
T representation) |
<T extends ResourceRepresentation> |
postAsync(String path,
CumulocityMediaType mediaType,
T representation) |
<T extends ResourceRepresentation> |
postFile(String path,
T representation,
byte[] bytes,
Class<T> responseClass) |
<T extends ResourceRepresentation> |
postFileAsStream(String path,
T representation,
InputStream inputStream,
Class<T> responseClass) |
<T extends ResourceRepresentation> |
postStream(String path,
CumulocityMediaType mediaType,
InputStream content,
Class<T> responseClass) |
<T extends ResourceRepresentation> |
postText(String path,
String content,
Class<T> responseClass) |
<T extends ResourceRepresentation> |
postWithoutResponse(String path,
javax.ws.rs.core.MediaType mediaType,
T representation) |
<T extends ResourceRepresentation> |
put(String path,
javax.ws.rs.core.MediaType mediaType,
T representation) |
<T extends ResourceRepresentationWithId> |
put(String path,
javax.ws.rs.core.MediaType mediaType,
T representation) |
<T extends ResourceRepresentation> |
putAsync(String path,
CumulocityMediaType mediaType,
T representation) |
<T extends ResourceRepresentation> |
putStream(String path,
javax.ws.rs.core.MediaType mediaType,
InputStream content,
Class<T> responseClass) |
<T extends ResourceRepresentation> |
putStream(String path,
String contentType,
InputStream content,
Class<T> responseClass) |
<T extends ResourceRepresentation> |
putText(String path,
String content,
Class<T> responseClass) |
public static final String X_CUMULOCITY_APPLICATION_KEY
public static final String X_CUMULOCITY_REQUEST_ORIGIN
public RestConnector(PlatformParameters platformParameters, ResponseParser responseParser)
protected RestConnector(PlatformParameters platformParameters, ResponseParser responseParser, com.sun.jersey.api.client.Client client)
public PlatformParameters getPlatformParameters()
public com.sun.jersey.api.client.Client getClient()
public ResponseParser getResponseParser()
public void close() throws Exception
close
in interface AutoCloseable
Exception
public <T extends ResourceRepresentation> T get(String path, CumulocityMediaType mediaType, Class<T> responseType) throws SDKException
get
in interface RestOperations
SDKException
public <T> T get(String path, javax.ws.rs.core.MediaType mediaType, Class<T> responseType) throws SDKException
get
in interface RestOperations
SDKException
public com.sun.jersey.api.client.ClientResponse get(String path, javax.ws.rs.core.MediaType mediaType)
public javax.ws.rs.core.Response.Status getStatus(String path, CumulocityMediaType mediaType) throws SDKException
getStatus
in interface RestOperations
SDKException
public <T extends ResourceRepresentation> T postStream(String path, CumulocityMediaType mediaType, InputStream content, Class<T> responseClass) throws SDKException
postStream
in interface RestOperations
SDKException
public <T extends ResourceRepresentation> T postText(String path, String content, Class<T> responseClass)
postText
in interface RestOperations
public <T extends ResourceRepresentation> T putText(String path, String content, Class<T> responseClass)
putText
in interface RestOperations
public <T extends ResourceRepresentation> T putStream(String path, String contentType, InputStream content, Class<T> responseClass)
putStream
in interface RestOperations
public <T extends ResourceRepresentation> T putStream(String path, javax.ws.rs.core.MediaType mediaType, InputStream content, Class<T> responseClass)
putStream
in interface RestOperations
public <T extends ResourceRepresentation> T postFile(String path, T representation, byte[] bytes, Class<T> responseClass)
postFile
in interface RestOperations
public <T extends ResourceRepresentation> T postFileAsStream(String path, T representation, InputStream inputStream, Class<T> responseClass)
postFileAsStream
in interface RestOperations
public <T extends ResourceRepresentationWithId> T put(String path, javax.ws.rs.core.MediaType mediaType, T representation) throws SDKException
put
in interface RestOperations
SDKException
public <T extends ResourceRepresentation> Future postAsync(String path, CumulocityMediaType mediaType, T representation) throws SDKException
postAsync
in interface RestOperations
SDKException
public <T extends ResourceRepresentation> Future putAsync(String path, CumulocityMediaType mediaType, T representation) throws SDKException
putAsync
in interface RestOperations
SDKException
public <T extends ResourceRepresentation> T post(String path, javax.ws.rs.core.MediaType mediaType, T representation) throws SDKException
post
in interface RestOperations
SDKException
public <T extends ResourceRepresentationWithId> T post(String path, javax.ws.rs.core.MediaType mediaType, T representation) throws SDKException
post
in interface RestOperations
SDKException
public <T extends ResourceRepresentation> void postWithoutResponse(String path, javax.ws.rs.core.MediaType mediaType, T representation) throws SDKException
postWithoutResponse
in interface RestOperations
SDKException
public <Result extends ResourceRepresentation,Param extends ResourceRepresentation> Result post(String path, CumulocityMediaType contentType, CumulocityMediaType accept, Param representation, Class<Result> clazz)
post
in interface RestOperations
public <T extends ResourceRepresentation> T put(String path, javax.ws.rs.core.MediaType mediaType, T representation) throws SDKException
put
in interface RestOperations
SDKException
public void delete(String path) throws SDKException
delete
in interface RestOperations
SDKException
public static com.sun.jersey.api.client.Client createClient(PlatformParameters platformParameters)
public static com.sun.jersey.api.client.Client createURLConnectionClient(PlatformParameters platformParameters)
Copyright © 2020 (C) Cumulocity GmbH. All rights reserved.