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 org.gcube.datacatalogue.ckanutillibrary.server.DataCatalogue |
dataCatalogue |
protected String |
DELETE |
protected static String |
ERROR_KEY |
protected static String |
ERROR_TYPE_KEY |
protected static String |
ID_KEY |
protected String |
LIST |
protected com.fasterxml.jackson.databind.ObjectMapper |
mapper |
protected static String |
MESSAGE_KEY |
protected String |
name |
protected static String |
NAME_KEY |
protected static String |
NOT_FOUND_ERROR |
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 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) |
static org.gcube.datacatalogue.ckanutillibrary.server.DataCatalogue |
getCatalogue()
Retrieve an instance of the library for the current scope
|
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() |
String |
list() |
String |
patch(String json) |
protected void |
purge() |
String |
read() |
String |
sendGetRequest(String path,
Map<String,String> parameters) |
String |
sendPostRequest(String path,
com.fasterxml.jackson.databind.JsonNode jsonNode) |
String |
sendPostRequest(String path,
String body) |
com.fasterxml.jackson.databind.JsonNode |
sendRequest(HTTPCall.HTTPMETHOD httpMethod,
String path,
Map<String,String> parameters,
String body) |
void |
setApiKey(String apiKey) |
void |
setName(String name) |
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
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
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 final org.gcube.datacatalogue.ckanutillibrary.server.DataCatalogue dataCatalogue
protected String name
protected String apiKey
protected com.fasterxml.jackson.databind.JsonNode result
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)
public static org.gcube.datacatalogue.ckanutillibrary.server.DataCatalogue getCatalogue()
throws Exception
Exceptionprotected 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()
public com.fasterxml.jackson.databind.JsonNode sendRequest(HTTPCall.HTTPMETHOD httpMethod, String path, Map<String,String> parameters, String body)
public String sendPostRequest(String path, com.fasterxml.jackson.databind.JsonNode jsonNode)
public String list()
public String read()
protected void delete()
public void delete(boolean purge)
protected void purge()
Copyright © 2019. All Rights Reserved.