String qos = (String)obj[0];
String key = (String)obj[1];
byte[] content = (byte[])obj[2];
Integer referenceCounter = (Integer)obj[3];
Integer historyReferenceCounter = (Integer)obj[4];
PublishQosServer publishQosServer = new PublishQosServer(glob, qos, true); // true marks from persistent store (prevents new timestamp)
MsgKeyData msgKeyData = glob.getMsgKeyFactory().readObject(key);
MsgUnit msgUnit = new MsgUnit(msgKeyData, content, publishQosServer.getData());
MsgUnitWrapper msgUnitWrapper = new MsgUnitWrapper(glob, msgUnit, storageId,
referenceCounter.intValue(), historyReferenceCounter.intValue(), sizeInBytes);
msgUnitWrapper.startExpiryTimer();
return msgUnitWrapper;
}
catch (Exception ex) {
throw new XmlBlasterException(glob, ErrorCode.INTERNAL_UNKNOWN, ME, "createEntry-MsgUnitWrapper", ex);
}
}
else if (ENTRY_TYPE_MSG_SERIAL.equalsIgnoreCase(type)) { // probably unused (not found in my tests)
try {
ObjectInputStream objStream = new ObjectInputStream(is);
Object[] obj = (Object[])objStream.readObject();
if (obj.length < 3) {
throw new XmlBlasterException(glob, ErrorCode.INTERNAL_ILLEGALARGUMENT, ME,
"Expected 3 entries in serialized object stream but got " + obj.length + " for priority=" + priority + " timestamp=" + timestamp);
}
MsgUnit msgUnit = (MsgUnit)obj[0];
Integer referenceCounter = (Integer)obj[1];
Integer historyReferenceCounter = (Integer)obj[2];
msgUnit.setGlobal(glob);
MsgUnitWrapper msgUnitWrapper = new MsgUnitWrapper(glob, msgUnit, storageId,
referenceCounter.intValue(), historyReferenceCounter.intValue(), sizeInBytes);
msgUnitWrapper.startExpiryTimer();
return msgUnitWrapper;
}
catch (Exception ex) {
throw new XmlBlasterException(glob, ErrorCode.INTERNAL_UNKNOWN, ME, "createEntry-MsgUnitWrapper", ex);
}
}
else if (ENTRY_TYPE_TOPIC_XML.equalsIgnoreCase(type)) { // still used
try {
ObjectInputStream objStream = new ObjectInputStream(is);
Object[] obj = (Object[])objStream.readObject();
if (obj.length < 2) {
throw new XmlBlasterException(glob, ErrorCode.INTERNAL_ILLEGALARGUMENT, ME,
"Expected 2 entries in serialized object stream but got " + obj.length + " for priority=" + priority + " timestamp=" + timestamp);
}
String qos = (String)obj[0];
String key = (String)obj[1];
byte[] content = null;
PublishQosServer publishQosServer = new PublishQosServer(glob, qos, true); // true marks from persistent store (prevents new timestamp)
MsgKeyData msgKeyData = glob.getMsgKeyFactory().readObject(key);
MsgUnit msgUnit = new MsgUnit(msgKeyData, content, publishQosServer.getData());
TopicEntry topicEntry = new TopicEntry(glob, msgUnit, storageId, type, sizeInBytes);
return topicEntry;
}
catch (Exception ex) {
throw new XmlBlasterException(glob, ErrorCode.INTERNAL_UNKNOWN, ME, "createEntry-TopicEntry", ex);