Package org.apache.synapse.util.resolver
Class ResourceMap
- java.lang.Object
-
- org.apache.synapse.util.resolver.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). AResourceMapobject contains a set of (location, registry key) mappings. Theresolvemethod can be used to get retrieve the registry entry registered for a given location as anInputSourceobject.
-
-
Constructor Summary
Constructors Constructor Description ResourceMap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddResource(String location, String key)Add a resource.voidaddResource(Value location, Value key)Add a resource.Map<String,String>getResources()Get the (location, registry key) mappings.InputSourceresolve(SynapseConfiguration synCfg, String location)Resolve a resource for a given location.InputSourceresolve(SynapseConfiguration synCfg, String location, MessageContext messageContext)Resolve a resource for a given location.
-
-
-
Method Detail
-
addResource
public void addResource(Value location, Value key)
Add a resource.- Parameters:
location- the location as it appears in referencing documentskey- 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 documentskey- 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
InputSourceobject 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 documentmessageContext- current message context of the received request- Returns:
- an
InputSourceobject for the referenced resource
-
-