Added support for context names included in header among UUIDs
This commit is contained in:
parent
1e7a8d606a
commit
e635e0817e
|
@ -5,7 +5,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
||||||
## [v4.2.0-SNAPSHOT]
|
## [v4.2.0-SNAPSHOT]
|
||||||
|
|
||||||
- Added INCLUDE_RELATION_PARAM param in AccessPath used by query APIs [#20298]
|
- Added INCLUDE_RELATION_PARAM param in AccessPath used by query APIs [#20298]
|
||||||
- Added QueryTempalte support [#22091]
|
- Added support for context names included in header among UUIDs [#22090]
|
||||||
|
- Added support for Json Query [#22047]
|
||||||
|
- Added support for Query Templates [#22091]
|
||||||
|
|
||||||
## [v4.1.0]
|
## [v4.1.0]
|
||||||
|
|
||||||
|
|
|
@ -2,12 +2,15 @@ package org.gcube.informationsystem.resourceregistry.api.contexts;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import org.gcube.com.fasterxml.jackson.core.JsonParseException;
|
||||||
import org.gcube.com.fasterxml.jackson.databind.JavaType;
|
import org.gcube.com.fasterxml.jackson.databind.JavaType;
|
||||||
|
import org.gcube.com.fasterxml.jackson.databind.JsonMappingException;
|
||||||
import org.gcube.com.fasterxml.jackson.databind.ObjectMapper;
|
import org.gcube.com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import org.gcube.informationsystem.utils.ElementMapper;
|
import org.gcube.informationsystem.utils.ElementMapper;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
@ -17,15 +20,21 @@ public class ContextUtility {
|
||||||
|
|
||||||
private static Logger logger = LoggerFactory.getLogger(ContextUtility.class);
|
private static Logger logger = LoggerFactory.getLogger(ContextUtility.class);
|
||||||
|
|
||||||
public static Set<UUID> getContextUUIDSet(String jsonArray) throws IOException {
|
// public static Set<UUID> getContextUUIDSe(String jsonArray) throws IOException {
|
||||||
|
// ObjectMapper mapper = ElementMapper.getObjectMapper();
|
||||||
|
// JavaType type = mapper.getTypeFactory().constructCollectionType(HashSet.class, UUID.class);
|
||||||
|
// return mapper.readValue(jsonArray, type);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public static Set<String> getContextFullNameSet(String jsonArray) throws Exception {
|
||||||
|
// Set<UUID> uuids = getContextUUIDSet(jsonArray);
|
||||||
|
// return getContextFullNameSet(uuids);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
public static Map<UUID, String> getContextMap(String objectnode) throws JsonParseException, JsonMappingException, IOException{
|
||||||
ObjectMapper mapper = ElementMapper.getObjectMapper();
|
ObjectMapper mapper = ElementMapper.getObjectMapper();
|
||||||
JavaType type = mapper.getTypeFactory().constructCollectionType(HashSet.class, UUID.class);
|
JavaType type = mapper.getTypeFactory().constructMapType(HashMap.class, UUID.class, String.class);
|
||||||
return mapper.readValue(jsonArray, type);
|
return mapper.readValue(objectnode, type);
|
||||||
}
|
|
||||||
|
|
||||||
public static Set<String> getContextFullNameSet(String jsonArray) throws Exception {
|
|
||||||
Set<UUID> uuids = getContextUUIDSet(jsonArray);
|
|
||||||
return getContextFullNameSet(uuids);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Set<UUID> getContextUUIDSet(Collection<String> uuidStrings) throws Exception {
|
public static Set<UUID> getContextUUIDSet(Collection<String> uuidStrings) throws Exception {
|
||||||
|
|
Loading…
Reference in New Issue