public abstract class ServiceConnector extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static String |
AUTH_ATTR |
protected static String |
CLIENT_ATTR |
protected static String |
ENCODING |
protected static String |
ORIGIN |
protected static String |
ORIGIN_ATTR |
protected ITimeTracker |
tracker |
protected static Charset |
UTF8 |
| Constructor and Description |
|---|
ServiceConnector(String base) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
protected String |
consumeResponse(org.apache.http.HttpResponse response) |
static String |
encodeAttributes(Map<String,String> attributes)
note that it does not add "?" for the first parameter, that is the responsibility of the caller
|
static String |
encodeFullAttributes(Map<String,String> attributes) |
abstract CodotaResponse |
get(GetRequest request) |
String |
getBase() |
String |
getURI(String route,
String query,
Map<String,String> attributes) |
abstract CodotaResponse |
post(Request request) |
abstract CodotaResponse |
post(String route,
Map<String,String> attributes,
String token) |
abstract CodotaResponse |
postJson(String route,
String jsonString,
String token) |
abstract CodotaResponse |
put(PutRequest request) |
protected static final String ENCODING
protected static final String AUTH_ATTR
protected static final String ORIGIN_ATTR
protected static final String ORIGIN
protected static final String CLIENT_ATTR
protected static final Charset UTF8
protected final ITimeTracker tracker
public ServiceConnector(String base)
@NotNull public static String encodeAttributes(@NotNull Map<String,String> attributes) throws UnsupportedEncodingException
UnsupportedEncodingException@NotNull public static String encodeFullAttributes(@NotNull Map<String,String> attributes) throws UnsupportedEncodingException
UnsupportedEncodingException@NotNull public String getURI(String route, @Nullable String query, @Nullable Map<String,String> attributes) throws IOException
IOException@NotNull protected String consumeResponse(@NotNull org.apache.http.HttpResponse response) throws IllegalStateException, IOException
IllegalStateExceptionIOExceptionpublic void clear()
@Nullable public abstract CodotaResponse post(String route, Map<String,String> attributes, String token)
@Nullable public abstract CodotaResponse postJson(String route, String jsonString, String token)
public abstract CodotaResponse post(Request request)
public abstract CodotaResponse get(GetRequest request)
public abstract CodotaResponse put(PutRequest request)
public String getBase()
Copyright © 2018. All rights reserved.