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). AResourceMap
object contains a set of (location, registry key) mappings. Theresolve
method can be used to get retrieve the registry entry registered for a given location as anInputSource
object.
-
-
Constructor Summary
Constructors Constructor Description ResourceMap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addResource(String location, String key)
Add a resource.void
addResource(Value location, Value key)
Add a resource.Map<String,String>
getResources()
Get the (location, registry key) mappings.InputSource
resolve(SynapseConfiguration synCfg, String location)
Resolve a resource for a given location.InputSource
resolve(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
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 documentmessageContext
- current message context of the received request- Returns:
- an
InputSource
object for the referenced resource
-
-