com.tinkerpop.rexster.protocol.serializer.msgpack.templates.messages.SessionResponseMessageTemplate Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rexster-protocol Show documentation
Show all versions of rexster-protocol Show documentation
RexPro is a binary protocol for Rexster graph server.
package com.tinkerpop.rexster.protocol.serializer.msgpack.templates.messages;
import com.tinkerpop.rexster.protocol.msg.SessionResponseMessage;
import org.msgpack.packer.Packer;
import org.msgpack.unpacker.Unpacker;
import java.io.IOException;
/**
* @author Blake Eggleston (bdeggleston.github.com)
*/
public class SessionResponseMessageTemplate extends RexProMessageTemplate {
protected int messageArraySize() {
return super.messageArraySize() + 1;
}
protected SessionResponseMessage instantiateMessage() {
return new SessionResponseMessage();
}
protected void writeMessageArray(final Packer pk, final SessionResponseMessage msg) throws IOException {
super.writeMessageArray(pk, msg);
pk.writeArrayBegin(msg.Languages.length);
for (String lang : msg.Languages) {
pk.write(lang);
}
pk.writeArrayEnd();
}
protected SessionResponseMessage readMessageArray(final Unpacker un, final SessionResponseMessage msg) throws IOException {
SessionResponseMessage message = super.readMessageArray(un, msg);
if (!un.trySkipNil()){
message.Languages = new String[un.readArrayBegin()];
for (int i=0; i
© 2015 - 2025 Weber Informatics LLC | Privacy Policy