@Override
public void send(SendRequest req) {
System.out.println(req);
// send in s1.onentry
if ("This is some content!".equals(req.getContent())) {
returnEvent(new Event("received1"));
return;
}
// send in s2.onentry
if (req.getParams().containsKey("foo")
&& "bar".equals(req.getParams().get("foo").get(0).getAtom())) {
returnEvent(new Event("received2"));
return;
}
// send in s3
if (req.getXML().length() > 0) {
try {
DocumentBuilderFactory factory = DocumentBuilderFactory
.newInstance();
Document doc = factory.newDocumentBuilder().parse(
new InputSource(new StringReader(req.getXML())));
System.out.println("Root element :"
+ doc.getDocumentElement().getNodeName());
if ("this".equals(doc.getDocumentElement().getNodeName())) {
returnEvent(new Event("received3"));
return;
}
} catch (ParserConfigurationException e) {
e.printStackTrace();
} catch (SAXException e) {