// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.config;

import com.yahoo.jrt.Method;
import com.yahoo.jrt.Request;

/**
 * Defines methods used for RPC config requests.
 */
public class JRTMethods {

    public static final String configV3getConfigMethodName = "config.v3.getConfig";
    private static final String configV3GetConfigRequestTypes = "s";
    private static final String configV3GetConfigResponseTypes = "sx";
    public static Method createConfigV3GetConfigMethod(Object handler, String handlerMethod) {
        return new Method(configV3getConfigMethodName, configV3GetConfigRequestTypes, configV3GetConfigResponseTypes,
                handler, handlerMethod)
                .methodDesc("get config v3")
                .paramDesc(0, "request", "config request")
                .returnDesc(0, "response", "config response")
                .returnDesc(1, "payload", "config response payload");
    }

    public static boolean checkV3ReturnTypes(Request request) {
        return request.checkReturnTypes(JRTMethods.configV3GetConfigResponseTypes);
    }
}

@@ -174,16 +174,52 @@
 Method;%0A
+import com.yahoo.jrt.MethodHandler;%0A
 import c
@@ -240,16 +240,16 @@
 equest;%0A
-
 %0A/**%0A * 
@@ -549,16 +549,17 @@
 = %22sx%22;%0A
+%0A
     publ
@@ -660,16 +660,49 @@
  return 
+addDescriptions(%0A                
 new Meth
@@ -799,65 +799,383 @@
 pes,
-%0A  
+ handler, handlerMethod));%0A
     
+%7D%0A%0A
     
-      handler, handlerMethod)
+public static Method createConfigV3GetConfigMethod(MethodHandler methodHandler) %7B%0A        return addDescriptions(%0A                new Method(configV3getConfigMethodName, configV3GetConfigRequestTypes, configV3GetConfigResponseTypes, methodHandler));
 %0A    
+%7D%0A%0A
     
-        
+private static Method addDescriptions(Method method) %7B%0A        return method
 .met

Add createConfigV3GetConfigMethod overload taking MethodHandler