public abstract class CKAN extends Object
| Modifier and Type | Field and Description |
|---|---|
protected String |
apiKey |
static String |
AUTH_CKAN_HEADER |
protected static String |
AUTHORIZATION_ERROR |
static String |
CKAN_API_PATH |
protected String |
CREATE |
protected String |
DELETE |
protected static String |
ERROR_KEY |
protected static String |
ERROR_TYPE_KEY |
protected static String |
ID_KEY |
static String |
LIMIT_KEY |
protected String |
LIST |
protected com.fasterxml.jackson.databind.ObjectMapper |
mapper |
protected static String |
MESSAGE_KEY |
protected String |
name |
protected static String |
NAME_KEY |
static String |
NAME_REGEX |
protected String |
nameRegex |
protected static String |
NOT_FOUND_ERROR |
static String |
OFFSET_KEY |
protected static String |
OWNER_ORG_KEY |
protected String |
PATCH |
protected String |
PURGE |
protected String |
READ |
protected com.fasterxml.jackson.databind.JsonNode |
result |
protected static String |
RESULT_KEY |
protected static String |
SUCCESS_KEY |
protected String |
UPDATE |
protected javax.ws.rs.core.UriInfo |
uriInfo |
protected static String |
VALIDATION_ERROR |
| Modifier | Constructor and Description |
|---|---|
protected |
CKAN() |
| Modifier and Type | Method and Description |
|---|---|
protected com.fasterxml.jackson.databind.JsonNode |
checkName(com.fasterxml.jackson.databind.JsonNode jsonNode) |
protected com.fasterxml.jackson.databind.JsonNode |
checkName(String json) |
String |
create(String json) |
protected com.fasterxml.jackson.databind.JsonNode |
createJsonNodeWithID(String id) |
protected com.fasterxml.jackson.databind.JsonNode |
createJsonNodeWithNameAsID() |
protected void |
delete() |
void |
delete(boolean purge) |
String |
getApiKey() |
protected com.fasterxml.jackson.databind.JsonNode |
getAsJsonNode(String json) |
protected String |
getAsString(com.fasterxml.jackson.databind.JsonNode node) |
protected org.gcube.common.gxhttp.request.GXHTTPStringRequest |
getGXHTTPStringRequest(String path,
boolean post) |
com.fasterxml.jackson.databind.JsonNode |
getJsonNodeResult() |
com.fasterxml.jackson.databind.ObjectMapper |
getMapper() |
protected Map<String,String> |
getMapWithID(String id) |
protected Map<String,String> |
getMapWithNameAsID() |
String |
getName() |
protected String |
getResultAndValidate(HttpURLConnection httpURLConnection) |
String |
list(int limit,
int offset) |
String |
patch(String json) |
protected void |
purge() |
String |
read() |
protected String |
sendGetRequest(String path,
Map<String,String> parameters) |
protected String |
sendPostRequest(String path,
com.fasterxml.jackson.databind.JsonNode jsonNode) |
protected String |
sendPostRequest(String path,
String body) |
void |
setApiKey(String apiKey) |
void |
setName(String name) |
void |
setUriInfo(javax.ws.rs.core.UriInfo uriInfo) |
String |
update(String json) |
protected com.fasterxml.jackson.databind.JsonNode |
validateCKANResponse(String json)
Validate the CKAN response and return the
|
protected static final String ID_KEY
protected static final String NAME_KEY
protected static final String ERROR_KEY
protected static final String ERROR_TYPE_KEY
protected static final String MESSAGE_KEY
protected static final String OWNER_ORG_KEY
protected static final String RESULT_KEY
protected static final String SUCCESS_KEY
public static final String LIMIT_KEY
public static final String OFFSET_KEY
protected static final String NOT_FOUND_ERROR
protected static final String AUTHORIZATION_ERROR
protected static final String VALIDATION_ERROR
public static final String CKAN_API_PATH
public static final String AUTH_CKAN_HEADER
public static final String NAME_REGEX
protected String LIST
protected String CREATE
protected String READ
protected String UPDATE
protected String PATCH
protected String DELETE
protected String PURGE
protected final com.fasterxml.jackson.databind.ObjectMapper mapper
protected String name
protected String apiKey
protected com.fasterxml.jackson.databind.JsonNode result
protected String nameRegex
protected javax.ws.rs.core.UriInfo uriInfo
public void setUriInfo(javax.ws.rs.core.UriInfo uriInfo)
public String getApiKey()
public void setApiKey(String apiKey)
public String getName()
public void setName(String name)
public com.fasterxml.jackson.databind.ObjectMapper getMapper()
public com.fasterxml.jackson.databind.JsonNode getJsonNodeResult()
protected com.fasterxml.jackson.databind.JsonNode getAsJsonNode(String json)
protected com.fasterxml.jackson.databind.JsonNode validateCKANResponse(String json)
json - protected String getAsString(com.fasterxml.jackson.databind.JsonNode node)
protected com.fasterxml.jackson.databind.JsonNode checkName(com.fasterxml.jackson.databind.JsonNode jsonNode)
protected com.fasterxml.jackson.databind.JsonNode checkName(String json)
protected com.fasterxml.jackson.databind.JsonNode createJsonNodeWithID(String id)
protected com.fasterxml.jackson.databind.JsonNode createJsonNodeWithNameAsID()
protected org.gcube.common.gxhttp.request.GXHTTPStringRequest getGXHTTPStringRequest(String path, boolean post) throws UnsupportedEncodingException
UnsupportedEncodingExceptionprotected String getResultAndValidate(HttpURLConnection httpURLConnection) throws IOException
IOExceptionprotected String sendPostRequest(String path, com.fasterxml.jackson.databind.JsonNode jsonNode)
public String list(int limit, int offset)
public String read()
protected void delete()
public void delete(boolean purge)
protected void purge()
Copyright © 2020. All Rights Reserved.