publishKey.setClientTags("<org.xmlBlaster><event/></org.xmlBlaster>");
return publishKey.getData();
}
MsgQosData getPublishQos(String summary, String description,
String eventType, String errorCode, SessionName sessionName) throws XmlBlasterException {
MsgQosData msgQosData = null;
if (this.qos != null) {
msgQosData = engineGlob.getMsgQosFactory().readObject(this.qos);
}
else {
PublishQos publishQos = new PublishQos(engineGlob);
publishQos.setLifeTime(-1L);
publishQos.setForceUpdate(true);
// TODO: Configure history depth to 0 only on first publish
TopicProperty topicProperty = new TopicProperty(engineGlob);
HistoryQueueProperty historyQueueProperty = new HistoryQueueProperty(engineGlob, engineGlob.getId());
historyQueueProperty.setMaxEntriesCache(2);
historyQueueProperty.setMaxEntries(2);
topicProperty.setHistoryQueueProperty(historyQueueProperty);
publishQos.setTopicProperty(topicProperty);
msgQosData = publishQos.getData();
}
if (summary != null && summary.length() > 0)
msgQosData.addClientProperty(Constants.EVENTPLUGIN_PROP_SUMMARY, summary); // "_summary"
if (description != null && description.length() > 0)
msgQosData.addClientProperty(Constants.EVENTPLUGIN_PROP_DESCRIPTION, description);
if (eventType != null && eventType.length() > 0)
msgQosData.addClientProperty(Constants.EVENTPLUGIN_PROP_EVENTTYPE, eventType);
if (errorCode != null && errorCode.length() > 0)
msgQosData.addClientProperty(Constants.EVENTPLUGIN_PROP_ERRORCODE, errorCode);
if (sessionName != null) {
msgQosData.addClientProperty(Constants.EVENTPLUGIN_PROP_PUBSESSIONID,
sessionName.getPublicSessionId());
msgQosData.addClientProperty(Constants.EVENTPLUGIN_PROP_SUBJECTID,
sessionName.getLoginName());
msgQosData.addClientProperty(Constants.EVENTPLUGIN_PROP_ABSOLUTENAME,
sessionName.getAbsoluteName());
/*
// To be backwards compatible with loginEvent=true setting:
// deprecated:
msgQosData.addClientProperty("__publicSessionId",
sessionName.getPublicSessionId());
msgQosData.addClientProperty("__subjectId",
sessionName.getLoginName());
msgQosData.addClientProperty("__absoluteName",
sessionName.getAbsoluteName());
// TODO: backwards compatible?
//msgUnit.setContent(sessionName.getLoginName().getBytes());
// To be backwards compatible with loginEvent=true setting:
*/
}
msgQosData.addClientProperty(Constants.EVENTPLUGIN_PROP_NODEID, engineGlob.getId());
return msgQosData;
}