}
else
qos = new PublishQos(this.glob);
qos.setSubscribable(true);
// to force to fill the client properties map !!
ClientPropertiesInfo tmpInfo = new ClientPropertiesInfo(attrMap);
new ClientPropertiesInfo(qos.getData().getClientProperties(), tmpInfo);
addStringPropToQos(attrMap, qos.getData());
PublishKey key = null;
if (changeKey != null && changeKey.length() > 0)
key = new PublishKey(this.glob, changeKey);
else
key = new PublishKey(this.glob, "dbWatcherUnspecified");
key.setContentMime("text/xml");
MsgUnit msg = new MsgUnit(key, out, qos);
PublishReturnQos prq = this.con.publish(msg);
String id = (prq.getRcvTimestamp()!=null)?prq.getRcvTimestamp().toString():"queued";
if (log.isLoggable(Level.FINE)) log.fine("Published '" + prq.getKeyOid() + "' '" + id + "'");
return id;
}
if (this.eraseOnDrop && "DROP".equals(command)) {
String oid = this.glob.getMsgKeyFactory().readObject(pk).getOid();
EraseKey ek = new EraseKey(glob, oid);
EraseQos eq = new EraseQos(glob);
con.erase(ek, eq);
log.info("Topic '" + pk + "' is erased:" + out);
return "0";
}
if (this.eraseOnDelete && "DELETE".equals(command)) {
String oid = this.glob.getMsgKeyFactory().readObject(pk).getOid();
EraseKey ek = new EraseKey(glob, oid);
EraseQos eq = new EraseQos(glob);
con.erase(ek, eq);
log.info("Topic '" + pk + "' is erased:" + out);
return "0";
}
if (log.isLoggable(Level.FINER))
log.finer("Topic '" + pk + "' is published: " + out);
try {
String oid = (String)attrMap.remove(ContribConstants.TOPIC_NAME); // consume it since only used to inform this method
if (destination != null) {
pk = this.adminKey;
}
if (oid != null)
pk = "<key oid='" + oid + "'/>";
MsgUnit msgUnit = new MsgUnit(pk, out, this.publishQos);
String tmp = msgUnit.getKeyData().getContentMime();
// FIXME pass this in the map and set only if explicitly set in the map
if (tmp == null || tmp.equals("text/plain")) {
msgUnit.getKeyData().setContentMime("text/xml");
}
if (destination != null)
((MsgQosData)msgUnit.getQosData()).addDestination(destination);
// to force to fill the client properties map !!
ClientPropertiesInfo tmpInfo = new ClientPropertiesInfo(attrMap);
new ClientPropertiesInfo(msgUnit.getQosData().getClientProperties(), tmpInfo);
addStringPropToQos(attrMap, (MsgQosData)msgUnit.getQosData());
PublishReturnQos prq = this.con.publish(msgUnit);
String id = (prq.getRcvTimestamp()!=null)?prq.getRcvTimestamp().toString():"queued";
if (log.isLoggable(Level.FINE))