byte[] content = (byte[])obj[2];
MsgQosData msgQosData = glob.getMsgQosFactory().readObject(qos);
MsgKeyData msgKeyData = glob.getMsgKeyFactory().readObject(key);
MsgUnit msgUnit = new MsgUnit(msgKeyData, content, msgQosData);
return new MsgQueuePublishEntry(glob, methodName, PriorityEnum.toPriorityEnum(priority), storageId,
new Timestamp(timestamp), sizeInBytes, msgUnit);
}
else if (methodName == MethodName.SUBSCRIBE) {
if (obj.length != 2) {
throw new XmlBlasterException(glob, ErrorCode.INTERNAL_ILLEGALARGUMENT, ME,
"Expected 2 entries in serialized object '" + type + "' but got " + obj.length + " for priority=" + priority + " timestamp=" + timestamp + ". Could be a version incompatibility.");
}
String qos = (String)obj[0];
String key = (String)obj[1];
return new MsgQueueSubscribeEntry(glob, PriorityEnum.toPriorityEnum(priority), storageId,
new Timestamp(timestamp), sizeInBytes,
glob.getQueryKeyFactory().readObject(key),
glob.getQueryQosFactory().readObject(qos));
}
else if (methodName == MethodName.UNSUBSCRIBE) {
if (obj.length != 2) {
throw new XmlBlasterException(glob, ErrorCode.INTERNAL_ILLEGALARGUMENT, ME,
"Expected 2 entries in serialized object '" + type + "' but got " + obj.length + " for priority=" + priority + " timestamp=" + timestamp + ". Could be a version incompatibility.");
}
String qos = (String)obj[0];
String key = (String)obj[1];
return new MsgQueueUnSubscribeEntry(glob, PriorityEnum.toPriorityEnum(priority), storageId,
new Timestamp(timestamp), sizeInBytes,
new UnSubscribeKey(glob, glob.getQueryKeyFactory().readObject(key)),
new UnSubscribeQos(glob, glob.getQueryQosFactory().readObject(qos)) );
}
else if (methodName == MethodName.ERASE) {
if (obj.length != 2) {
throw new XmlBlasterException(glob, ErrorCode.INTERNAL_ILLEGALARGUMENT, ME,
"Expected 2 entries in serialized object '" + type + "' but got " + obj.length + " for priority=" + priority + " timestamp=" + timestamp + ". Could be a version incompatibility.");
}
String qos = (String)obj[0];
String key = (String)obj[1];
return new MsgQueueEraseEntry(glob, PriorityEnum.toPriorityEnum(priority), storageId,
new Timestamp(timestamp), sizeInBytes,
new EraseKey(glob, glob.getQueryKeyFactory().readObject(key)),
new EraseQos(glob, glob.getQueryQosFactory().readObject(qos)) );
}
else if (methodName == MethodName.GET) {
throw new XmlBlasterException(glob, ErrorCode.INTERNAL_NOTIMPLEMENTED, ME, "Object '" + type + "' not implemented, you can't use synchronous GET requests in queues.");
}
else if (methodName == MethodName.CONNECT) {
if (obj.length != 1) {
throw new XmlBlasterException(glob, ErrorCode.INTERNAL_ILLEGALARGUMENT, ME,
"Expected 1 entries in serialized object '" + type + "' but got " + obj.length + " for priority=" + priority + " timestamp=" + timestamp + ". Could be a version incompatibility.");
}
String qos = (String)obj[0];
ConnectQosData connectQosData = glob.getConnectQosFactory().readObject(qos);
return new MsgQueueConnectEntry(glob, PriorityEnum.toPriorityEnum(priority), storageId,
new Timestamp(timestamp), sizeInBytes, connectQosData);
}
else if (methodName == MethodName.DISCONNECT) {
if (obj.length != 1) {
throw new XmlBlasterException(glob, ErrorCode.INTERNAL_ILLEGALARGUMENT, ME,
"Expected 1 entries in serialized object '" + type + "' but got " + obj.length + " for priority=" + priority + " timestamp=" + timestamp + ". Could be a version incompatibility.");
}
String qos = (String)obj[0];
DisconnectQos disconnectQos = new DisconnectQos(glob, glob.getDisconnectQosFactory().readObject(qos));
return new MsgQueueDisconnectEntry(glob, PriorityEnum.toPriorityEnum(priority), storageId,
new Timestamp(timestamp), sizeInBytes, disconnectQos);
}
else if (methodName == MethodName.DUMMY) { // for testsuite only
byte[] bytes = (byte[])obj[0];
DummyEntry entry = new DummyEntry(glob, PriorityEnum.toPriorityEnum(priority), new Timestamp(timestamp),
storageId, bytes.length, bytes, persistent);
//entry.setUniqueId(timestamp);
return entry;
}