public class MetadataRequestMethodProvider extends java.lang.Object implements RequestMethodProvider
RequestMethodProvider
that can derive the method from AdaptrisMessage
metadata.
If the configured metadata key does not exist, then getDefaultMethod()
is
used to provide the request method.
In the adapter configuration file this class is aliased as http-metadata-request-method which is the preferred alternative to the fully qualified classname when building your configuration.
RequestMethodProvider.RequestMethod
Constructor and Description |
---|
MetadataRequestMethodProvider() |
MetadataRequestMethodProvider(java.lang.String key) |
MetadataRequestMethodProvider(java.lang.String key,
RequestMethodProvider.RequestMethod defMethod) |
Modifier and Type | Method and Description |
---|---|
RequestMethodProvider.RequestMethod |
getDefaultMethod() |
java.lang.String |
getMetadataKey() |
RequestMethodProvider.RequestMethod |
getMethod(AdaptrisMessage msg)
Get the method that should be used with the HTTP request.
|
void |
setDefaultMethod(RequestMethodProvider.RequestMethod m)
Set the default method.
|
void |
setMetadataKey(java.lang.String metadataKey) |
public MetadataRequestMethodProvider()
public MetadataRequestMethodProvider(java.lang.String key)
public MetadataRequestMethodProvider(java.lang.String key, RequestMethodProvider.RequestMethod defMethod)
public RequestMethodProvider.RequestMethod getMethod(AdaptrisMessage msg)
RequestMethodProvider
getMethod
in interface RequestMethodProvider
msg
- the AdaptrisMessage
if required to derive the method.public java.lang.String getMetadataKey()
public void setMetadataKey(java.lang.String metadataKey)
public RequestMethodProvider.RequestMethod getDefaultMethod()
public void setDefaultMethod(RequestMethodProvider.RequestMethod m)
m
- the default method (RequestMethodProvider.RequestMethod.POST
).