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 |
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 |
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 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
|
protected org.gcube.common.gxhttp.request.GXHTTPStringRequest |
getGXHTTPStringRequest(String path) |
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 |
getResultAsString(HttpURLConnection httpURLConnection) |
protected StringBuilder |
getStringBuilder(InputStream inputStream) |
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) |
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
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()
protected StringBuilder getStringBuilder(InputStream inputStream) throws IOException
IOExceptionprotected org.gcube.common.gxhttp.request.GXHTTPStringRequest getGXHTTPStringRequest(String path) throws UnsupportedEncodingException
UnsupportedEncodingExceptionprotected String getResultAsString(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 © 2019. All Rights Reserved.