checkForActivityExistense(data, dsAdmin, messageDataDO);
// this is for mediation observer event(it publishes
// req+response @ single
// event)
try {
MessageDO inMsg = dsAdmin.getMessage(data.getMessageId(), messageDataDO.getOperationId(),
messageDataDO.getActivityKeyId());
if (inMsg != null) {
messageDataDO.setMessageKeyId(inMsg.getMessageKeyId());
} else {
MessageDO mesg_in = new MessageDO();
mesg_in.setMessageId(data.getMessageId());
mesg_in.setActivityKeyId(messageDataDO.getActivityKeyId());
mesg_in.setOperationId(messageDataDO.getOperationId());
mesg_in.setTimestamp(data.getTimeStamp());
mesg_in.setIPAddress(data.getRemoteIPAddress());
mesg_in.setUserAgent(data.getUserAgent());
//TODO: Data Services supports returning the ID
dsAdmin.addMessage(mesg_in);
messageDataDO.setMessageKeyId(dsAdmin.getMessage(data.getMessageId(),
messageDataDO.getOperationId(),
messageDataDO.getActivityKeyId())
.getMessageKeyId());
}
} catch (BAMException e) {
log.error("Error updating Message statistics data for server " + data.getServerName() + " service "
+ data.getServiceName() + " operation " + data.getOperationName()
+ " from eventing message receiver " + e.getLocalizedMessage());
}
// store to the BAM MessageData table
try {
MessageDataDO msgDat_in = dsAdmin.getMessageDataForActivityKeyIDandMessageKeyID(
messageDataDO.getMessageKeyId(), messageDataDO.getActivityKeyId());
if (msgDat_in != null) {
messageDataDO.setMessageDataKeyId(msgDat_in.getMessageDataKeyId());
dsAdmin.updateMessageStatus(data.getRequestMessageStatus(), msgDat_in.getMessageDataKeyId());
} else {
String direction = "Request";
dsAdmin.addMessageDataDump(messageDataDO, direction);
}
} catch (BAMException e) {
log.error("Could not dump the full message to DB", e);
}
try {
String out_msg_id = data.getOutMessageID();
if (out_msg_id != null && !"".equals(out_msg_id)) {
MessageDO outMsg = dsAdmin.getMessage(data.getOutMessageID(), messageDataDO.getOperationId(),
messageDataDO.getActivityKeyId());
if (outMsg != null) {
messageDataDO.setMessageKeyId(outMsg.getMessageKeyId());
} else {
MessageDO mesg_out = new MessageDO();
mesg_out.setMessageId(data.getOutMessageID());
mesg_out.setActivityKeyId(messageDataDO.getActivityKeyId());
mesg_out.setOperationId(messageDataDO.getOperationId());
mesg_out.setTimestamp(data.getTimeStamp());
mesg_out.setIPAddress(data.getRemoteIPAddress());
mesg_out.setUserAgent(data.getUserAgent());
//TODO: Data Services supports returning the ID
dsAdmin.addMessage(mesg_out);
messageDataDO.setMessageKeyId(dsAdmin.getMessage(data.getOutMessageID(),
messageDataDO.getOperationId(),