use of org.opennms.protocols.xml.config.Parameter in project opennms by OpenNMS.
the class AbstractXmlCollectionHandler method parseRequest.
/**
* Parses the request.
*
* @param unformattedRequest the unformatted request
* @param agent the agent
* @param collectionStep the collection step
* @param parameters the service parameters
* @return the request
* @throws IllegalArgumentException the illegal argument exception
*/
@Override
public Request parseRequest(final NodeDao nodeDao, final Request unformattedRequest, final CollectionAgent agent, final Integer collectionStep, final Map<String, String> parameters) throws IllegalArgumentException {
if (unformattedRequest == null)
return null;
final OnmsNode node = nodeDao.get(agent.getNodeId());
final Request request = new Request();
request.setMethod(unformattedRequest.getMethod());
for (Header header : unformattedRequest.getHeaders()) {
request.addHeader(header.getName(), parseString(header.getName(), header.getValue(), node, agent.getHostAddress(), collectionStep, parameters));
}
for (Parameter param : unformattedRequest.getParameters()) {
request.addParameter(param.getName(), parseString(param.getName(), param.getValue(), node, agent.getHostAddress(), collectionStep, parameters));
}
final Content cnt = unformattedRequest.getContent();
if (cnt != null)
request.setContent(new Content(cnt.getType(), parseString("Content", cnt.getData(), node, agent.getHostAddress(), collectionStep, parameters)));
return request;
}