@Override
    protected void createResponse(Values ret, Reply reply, Version version, byte [] payload) {
        ret.add(new Int8Value(CompressionType.NONE.getCode()));
        ret.add(new Int32Value(0));
        ret.add(new DataValue(new byte[0]));

        Slime slime = new Slime();
        Cursor root = slime.setObject();

        root.setString(VERSION_F, version.toUtf8().getBytes());
        root.setDouble(RETRYDELAY_F, reply.getRetryDelay());
        root.setString(PROTOCOL_F, reply.getProtocol().getBytes());
        root.setData(BLOB_F, payload);
        if (reply.getTrace().getLevel() > 0) {
            root.setString(TRACE_F, reply.getTrace().getRoot().encode());
        }

        if (reply.getNumErrors() > 0) {
            Cursor array = root.setArray(ERRORS_F);
            for (int i = 0; i < reply.getNumErrors(); i++) {
                Cursor e = array.addObject();
                Error mbusE = reply.getError(i);
                e.setLong(CODE_F, mbusE.getCode());
                e.setString(MSG_F, mbusE.getMessage());
                if (mbusE.getService() != null) {
                    e.setString(SERVICE_F, mbusE.getService());
                }
            }
        }

        Compressor.Compression compressionResult = BinaryFormat.encode_and_compress(slime, compressor);

        ret.add(new Int8Value(compressionResult.type().getCode()));
        ret.add(new Int32Value(compressionResult.uncompressedSize()));
        ret.add(new DataValue(compressionResult.data()));
    }
Implements the request adapter for method "mbus.slime".

@author baldersheim
messagebus/src/main/java/com/yahoo/messagebus/network/rpc/RPCSendV2.java