diff --git a/ipaacalib/java/src/ipaaca/IUConverter.java b/ipaacalib/java/src/ipaaca/IUConverter.java index d2138d6945bafbaff9a797f3b5b9fee5412ef635..d03660f633f325e1a53e27b935a273a70298517b 100644 --- a/ipaacalib/java/src/ipaaca/IUConverter.java +++ b/ipaacalib/java/src/ipaaca/IUConverter.java @@ -1,10 +1,10 @@ /* * This file is part of IPAACA, the * "Incremental Processing Architecture - * for Artificial Conversational Agents". + * for Artificial Conversational Agents". * * Copyright (c) 2009-2013 Sociable Agents Group - * CITEC, Bielefeld University + * CITEC, Bielefeld University * * http://opensource.cit-ec.de/projects/ipaaca/ * http://purl.org/net/ipaaca @@ -21,7 +21,7 @@ * You should have received a copy of the LGPL along with this * program. If not, go to http://www.gnu.org/licenses/lgpl.html * or write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * The development of this software was supported by the * Excellence Cluster EXC 277 Cognitive Interaction Technology. @@ -55,7 +55,7 @@ import com.google.protobuf.InvalidProtocolBufferException; /** * Serializes AbstractIUs into protocolbuffer IUs and vice versa. * @author hvanwelbergen - * + * */ public class IUConverter implements Converter<ByteBuffer> { @@ -96,10 +96,11 @@ public class IUConverter implements Converter<ByteBuffer> IU iu = IU.newBuilder().setUid(iua.getUid()).setRevision(iua.getRevision()).setCategory(iua.getCategory()) .setOwnerName(iua.getOwnerName()).setCommitted(iua.isCommitted()).setAccessMode(accessMode) .setReadOnly(iua.isReadOnly()).setPayloadType("STR").addAllPayload(payloadItems).addAllLinks(links).build(); - return new WireContents<ByteBuffer>(ByteBuffer.wrap(iu.toByteArray()), "ipaaca-iu"); + String wireFormat = (accessMode == IU.AccessMode.MESSAGE) ? "ipaaca-messageiu" : "ipaaca-iu"; + return new WireContents<ByteBuffer>(ByteBuffer.wrap(iu.toByteArray()), wireFormat); } - + @Override public UserData<?> deserialize(String wireSchema, ByteBuffer buffer) throws ConversionException {