Class ResourceMap


  • public class ResourceMap
    extends Object
    A resource map. Instances of this class are used to resolve resources using registry entries. This is useful for XML documents that can reference other documents (e.g. WSDL documents importing XSD or other WSDL documents). A ResourceMap object contains a set of (location, registry key) mappings. The resolve method can be used to get retrieve the registry entry registered for a given location as an InputSource object.
    • Constructor Detail

      • ResourceMap

        public ResourceMap()
    • Method Detail

      • addResource

        public void addResource​(Value location,
                                Value key)
        Add a resource.
        Parameters:
        location - the location as it appears in referencing documents
        key - the registry key that points to the referenced document
      • addResource

        public void addResource​(String location,
                                String key)
        Add a resource.
        Parameters:
        location - the location as it appears in referencing documents
        key - the registry key that points to the referenced document
      • getResources

        public Map<String,​String> getResources()
        Get the (location, registry key) mappings.
        Returns:
        a map containing the (location, registry key) pairs
      • resolve

        public InputSource resolve​(SynapseConfiguration synCfg,
                                   String location)
        Resolve a resource for a given location.
        Parameters:
        synCfg - the Synapse configuration (used to access the registry)
        location - the location of of the resource at is appears in the referencing document
        Returns:
        an InputSource object for the referenced resource
      • resolve

        public InputSource resolve​(SynapseConfiguration synCfg,
                                   String location,
                                   MessageContext messageContext)
        Resolve a resource for a given location.
        Parameters:
        synCfg - the Synapse configuration (used to access the registry)
        location - the location of of the resource at is appears in the referencing document
        messageContext - current message context of the received request
        Returns:
        an InputSource object for the referenced resource