Class ContextUtility


  • public class ContextUtility
    extends Object
    Client-side helper methods for converting between the wire representations of Context identity (JSON UUID-to-path maps, UUID strings) and their in-memory counterparts, resolving paths via a ContextCache.
    Author:
    Luca Frosini (ISTI - CNR)
    • Constructor Detail

      • ContextUtility

        public ContextUtility()
    • Method Detail

      • getContextMap

        public static Map<UUID,​String> getContextMap​(String objectnode)
                                                    throws org.gcube.com.fasterxml.jackson.core.JsonParseException,
                                                           org.gcube.com.fasterxml.jackson.databind.JsonMappingException,
                                                           IOException
        Gets the context map.
        Parameters:
        objectnode - the objectnode
        Returns:
        the context map
        Throws:
        org.gcube.com.fasterxml.jackson.core.JsonParseException - the json parse exception
        org.gcube.com.fasterxml.jackson.databind.JsonMappingException - the json mapping exception
        IOException - Signals that an I/O exception has occurred.
      • getContextUUIDSet

        public static Set<UUID> getContextUUIDSet​(Collection<String> uuidStrings)
                                           throws Exception
        Gets the context UUID set.
        Parameters:
        uuidStrings - the uuid strings
        Returns:
        the context UUID set
        Throws:
        Exception - the exception
      • getContextPathSet

        public static Set<String> getContextPathSet​(ContextCache contextCache,
                                                    Collection<UUID> uuids)
                                             throws Exception
        Gets the context path set.
        Parameters:
        contextCache - the context cache
        uuids - the uuids
        Returns:
        the context path set
        Throws:
        Exception - the exception