public class StandardRequestHandler extends AbstractHttpHandler implements IRequestHandler
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
DEFAULT_CONTENT_TYPE
Default content type for the HTTP request.
|
protected IMethodConfiguration |
m_method
Contains the method configuration to which this handler is attached to.
|
Constructor and Description |
---|
StandardRequestHandler() |
Modifier and Type | Method and Description |
---|---|
protected byte[] |
convertXmlToBytes(int requestNode)
Converts the XML structure into a byte array.
|
protected int |
executeXslt(int requestNode,
IMethodConfiguration method,
boolean mustDelete)
Executes the XSLT transformation configured for this handler.
|
protected java.lang.String |
getContentType()
Returns the content type information as defined on the method
implementation xml.
|
protected byte[] |
getPostData(int requestNode,
IServerConnection connection)
This method returns the data that should be put into the post data.
|
protected java.lang.String |
getRequestUri(int requestNode,
IServerConnection connection,
HttpClient httpClient)
Returns the URI for this request.
|
protected int |
handleRequestXPath(int requestNode,
IMethodConfiguration method,
boolean mustDelete)
Fetches the request element using the configured XPath.
|
void |
initialize(int configXml,
IXSLTStore xslStore,
IMethodConfiguration method,
XPathMetaInfo xmi)
Initializes this handler.
|
protected int |
postProcessXml(int reqNode,
boolean mustDelete)
Method which can do processing of the request XML after the XSLT transform is executed.
|
protected int |
preProcessXml(int reqNode,
boolean mustDelete)
Method which can do processing of the request XML before the XSLT transform is called.
|
HttpMethod |
process(int requestNode,
IServerConnection connection,
HttpClient httpClient)
Converts the request XML in HTTP method which can be sent using the HTTP connection.
|
getPerformanceCounters, setPerformanceCounters
protected static final java.lang.String DEFAULT_CONTENT_TYPE
protected IMethodConfiguration m_method
public void initialize(int configXml, IXSLTStore xslStore, IMethodConfiguration method, XPathMetaInfo xmi) throws HandlerException
IRequestHandler
initialize
in interface IRequestHandler
configXml
- Handler configuration XML from the method configuration.xslStore
- HTTP Connector instance.method
- MethodConfiguration to which this handler belongs to.xmi
- The XPathMetaInfo object containing the prefix ns mapped to the proper namespace.HandlerException
- In case of any exceptions.IRequestHandler.initialize(int, IXSLTStore, IMethodConfiguration, XPathMetaInfo)
public HttpMethod process(int requestNode, IServerConnection connection, HttpClient httpClient) throws HandlerException
IRequestHandler
process
in interface IRequestHandler
requestNode
- Request XML root node.connection
- Current connection.httpClient
- HTTP client instance.HandlerException
- Thrown if the operation failed.IRequestHandler.process(int, IServerConnection, HttpClient)
protected byte[] convertXmlToBytes(int requestNode) throws HandlerException
requestNode
- node XML node to be converted.HandlerException
protected int executeXslt(int requestNode, IMethodConfiguration method, boolean mustDelete) throws HandlerException
requestNode
- Request node to be transformed.method
- Current method configuration.mustDelete
- If true
the parameter node must be deleted, if a new XML node is returned. Otherwise the
node cannot be deleted.HandlerException
protected java.lang.String getContentType()
This method differs from #getContentType(HttpMethod)
in following
manner
#getContentType(HttpMethod)
returns the content type on the HttpMethod
DEFAULT_CONTENT_TYPE
is returnedprotected byte[] getPostData(int requestNode, IServerConnection connection) throws HandlerException
requestNode
- The current request XML.connection
- The current server connection.HandlerException
- In case of any exceptions.protected java.lang.String getRequestUri(int requestNode, IServerConnection connection, HttpClient httpClient) throws HandlerException
requestNode
- Incoming request XML node.connection
- Current connection.httpClient
- HTTP client object.null
.HandlerException
- In case of any exceptions.protected int handleRequestXPath(int requestNode, IMethodConfiguration method, boolean mustDelete)
requestNode
- Request node to be transformed.method
- Current method configuration.mustDelete
- If true
the parameter node must be deleted, if a new XML node is returned. Otherwise the
node cannot be deleted.protected int postProcessXml(int reqNode, boolean mustDelete) throws HandlerException
reqNode
- Request XML node.mustDelete
- If true
the parameter node must be deleted, if a new XML node is returned. Otherwise the
node cannot be deleted.HandlerException
- in case of any errors.protected int preProcessXml(int reqNode, boolean mustDelete) throws HandlerException
reqNode
- Request XML node.mustDelete
- If true
the parameter node must be deleted, if a new XML node is returned. Otherwise the
node cannot be deleted.HandlerException
- In case of any errors.