@Override
    protected Request encodeRequest(Version version, Route route, RPCServiceAddress address, Message msg,
                                    long timeRemaining, byte[] payload, int traceLevel)
    {

        Request req = new Request(METHOD_NAME);
        Values v = req.parameters();

        v.add(new Int8Value(CompressionType.NONE.getCode()));
        v.add(new Int32Value(0));
        v.add(new DataValue(new byte[0]));

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

        root.setString(VERSION_F, version.toUtf8().getBytes());
        root.setString(ROUTE_F, route.toString());
        root.setString(SESSION_F, address.getSessionName());
        root.setString(PROTOCOL_F, msg.getProtocol().toString());
        root.setBool(USERETRY_F, msg.getRetryEnabled());
        root.setLong(RETRY_F, msg.getRetry());
        root.setLong(TIMEREMAINING_F, msg.getTimeRemaining());
        root.setLong(TRACELEVEL_F, traceLevel);
        root.setData(BLOB_F, payload);

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

        v.add(new Int8Value(compressionResult.type().getCode()));
        v.add(new Int32Value(compressionResult.uncompressedSize()));
        v.add(new DataValue(compressionResult.data()));

        return req;
    }
Implements the request adapter for method "mbus.slime".

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