All Downloads are FREE. Search and download functionalities are using the official Maven repository.

templates.graphql.handlerYml Maven / Gradle / Ivy

package templates.graphql;

import java.io.IOException;
import com.fizzed.rocker.ForIterator;
import com.fizzed.rocker.RenderingException;
import com.fizzed.rocker.RockerContent;
import com.fizzed.rocker.RockerOutput;
import com.fizzed.rocker.runtime.DefaultRockerTemplate;
import com.fizzed.rocker.runtime.PlainTextUnloadedClassLoader;
// import @ [1:1]
import java.util.Map;
// import @ [2:1]
import java.util.List;

/*
 * Auto generated code to render template templates/graphql/handlerYml.rocker.raw
 * Do not edit this file. Changes will eventually be overwritten by Rocker parser!
 */
@SuppressWarnings("unused")
public class handlerYml extends com.fizzed.rocker.runtime.DefaultRockerModel {

    static public com.fizzed.rocker.ContentType getContentType() { return com.fizzed.rocker.ContentType.RAW; }
    static public String getTemplateName() { return "handlerYml.rocker.raw"; }
    static public String getTemplatePackageName() { return "templates.graphql"; }
    static public String getHeaderHash() { return "788525461"; }
    static public long getModifiedAt() { return 1645995245871L; }
    static public String[] getArgumentNames() { return new String[] { "serviceId", "prometheusMetrics", "useLightProxy" }; }

    // argument @ [3:2]
    private String serviceId;
    // argument @ [3:2]
    private boolean prometheusMetrics;
    // argument @ [3:2]
    private boolean useLightProxy;

    public handlerYml serviceId(String serviceId) {
        this.serviceId = serviceId;
        return this;
    }

    public String serviceId() {
        return this.serviceId;
    }

    public handlerYml prometheusMetrics(boolean prometheusMetrics) {
        this.prometheusMetrics = prometheusMetrics;
        return this;
    }

    public boolean prometheusMetrics() {
        return this.prometheusMetrics;
    }

    public handlerYml useLightProxy(boolean useLightProxy) {
        this.useLightProxy = useLightProxy;
        return this;
    }

    public boolean useLightProxy() {
        return this.useLightProxy;
    }

    static public handlerYml template(String serviceId, boolean prometheusMetrics, boolean useLightProxy) {
        return new handlerYml()
            .serviceId(serviceId)
            .prometheusMetrics(prometheusMetrics)
            .useLightProxy(useLightProxy);
    }

    @Override
    protected DefaultRockerTemplate buildTemplate() throws RenderingException {
        // optimized for convenience (runtime auto reloading enabled if rocker.reloading=true)
        return com.fizzed.rocker.runtime.RockerRuntime.getInstance().getBootstrap().template(this.getClass(), this);
    }

    static public class Template extends com.fizzed.rocker.runtime.DefaultRockerTemplate {

        // \n\n# Handler middleware chain configuration\n---\nenabled: true\n\n#------------------------------------------------------------------------------\n# Support individual handler chains for each separate endpoint. It allows framework\n# handlers like health check, server info to bypass majority of the middleware handlers\n# and allows mixing multiple frameworks like OpenAPI and GraphQL in the same instance.\n#\n# handlers  --  list of handlers to be used across chains in this microservice\n#  ...
        static private final byte[] PLAIN_TEXT_0_0;
        //   - com.networknt.metrics.prometheus.PrometheusHandler@prometheus
        static private final byte[] PLAIN_TEXT_1_0;
        //   - com.networknt.metrics.MetricsHandler@metrics
        static private final byte[] PLAIN_TEXT_2_0;
        // \n  - com.networknt.traceability.TraceabilityHandler@traceability\n  - com.networknt.correlation.CorrelationHandler@correlation 
        static private final byte[] PLAIN_TEXT_3_0;
        // \n  - com.networknt.graphql.security.JwtVerifyHandler@security\n  - com.networknt.graphql.validator.ValidatorHandler@validator
        static private final byte[] PLAIN_TEXT_4_0;
        // \n  # Framework endpoint handlers\n  - com.networknt.health.HealthGetHandler@health\n  - com.networknt.info.ServerInfoGetHandler@info\n  # - com.networknt.metrics.prometheus.PrometheusGetHandler@getprometheus\n  # GraphQL handlers\n  - com.networknt.graphql.router.handlers.GraphqlGetHandler@get\n  - com.networknt.graphql.router.handlers.GraphqlPostHandler@post\n  - com.networknt.graphql.router.handlers.GraphqlOptionsHandler@options\n  # Business Handlers\n\nchains:\n  default:\n    - exception\n
        static private final byte[] PLAIN_TEXT_5_0;
        //     - prometheus
        static private final byte[] PLAIN_TEXT_6_0;
        //     - metrics
        static private final byte[] PLAIN_TEXT_7_0;
        // \n    - traceability\n    - correlation 
        static private final byte[] PLAIN_TEXT_8_0;
        // \n    - security\n    - validator
        static private final byte[] PLAIN_TEXT_9_0;
        // \n\npaths:\n  - path: '/graphql'\n    method: 'get'\n    exec:\n      - default\n      - get\n  - path: '/graphql'\n    method: 'post'\n    exec:\n      - default\n      - post\n  - path: '/graphql'\n    method: 'options'\n    exec:\n      - default\n      - options\n\n  - path: '/health/${server.serviceId:
        static private final byte[] PLAIN_TEXT_10_0;
        // }'\n    method: 'get'\n    exec:\n      - health\n\n  - path: '/server/info'\n    method: 'get'\n    exec:\n      - info\n\n
        static private final byte[] PLAIN_TEXT_11_0;
        //   - path: '/prometheus'\n    method: 'get'\n    exec:\n      - getprometheus\n
        static private final byte[] PLAIN_TEXT_12_0;
        // \n
        static private final byte[] PLAIN_TEXT_13_0;

        static {
            PlainTextUnloadedClassLoader loader = PlainTextUnloadedClassLoader.tryLoad(handlerYml.class.getClassLoader(), handlerYml.class.getName() + "$PlainText", "UTF-8");
            PLAIN_TEXT_0_0 = loader.tryGet("PLAIN_TEXT_0_0");
            PLAIN_TEXT_1_0 = loader.tryGet("PLAIN_TEXT_1_0");
            PLAIN_TEXT_2_0 = loader.tryGet("PLAIN_TEXT_2_0");
            PLAIN_TEXT_3_0 = loader.tryGet("PLAIN_TEXT_3_0");
            PLAIN_TEXT_4_0 = loader.tryGet("PLAIN_TEXT_4_0");
            PLAIN_TEXT_5_0 = loader.tryGet("PLAIN_TEXT_5_0");
            PLAIN_TEXT_6_0 = loader.tryGet("PLAIN_TEXT_6_0");
            PLAIN_TEXT_7_0 = loader.tryGet("PLAIN_TEXT_7_0");
            PLAIN_TEXT_8_0 = loader.tryGet("PLAIN_TEXT_8_0");
            PLAIN_TEXT_9_0 = loader.tryGet("PLAIN_TEXT_9_0");
            PLAIN_TEXT_10_0 = loader.tryGet("PLAIN_TEXT_10_0");
            PLAIN_TEXT_11_0 = loader.tryGet("PLAIN_TEXT_11_0");
            PLAIN_TEXT_12_0 = loader.tryGet("PLAIN_TEXT_12_0");
            PLAIN_TEXT_13_0 = loader.tryGet("PLAIN_TEXT_13_0");
        }

        // argument @ [3:2]
        protected final String serviceId;
        // argument @ [3:2]
        protected final boolean prometheusMetrics;
        // argument @ [3:2]
        protected final boolean useLightProxy;

        public Template(handlerYml model) {
            super(model);
            __internal.setCharset("UTF-8");
            __internal.setContentType(getContentType());
            __internal.setTemplateName(getTemplateName());
            __internal.setTemplatePackageName(getTemplatePackageName());
            this.serviceId = model.serviceId();
            this.prometheusMetrics = model.prometheusMetrics();
            this.useLightProxy = model.useLightProxy();
        }

        @Override
        protected void __doRender() throws IOException, RenderingException {
            // PlainText @ [3:75]
            __internal.aboutToExecutePosInTemplate(3, 75);
            __internal.writeValue(PLAIN_TEXT_0_0);
            // IfBlockBegin @ [38:1]
            __internal.aboutToExecutePosInTemplate(38, 1);
            if (prometheusMetrics) {
                // PlainText @ [38:24]
                __internal.aboutToExecutePosInTemplate(38, 24);
                __internal.writeValue(PLAIN_TEXT_1_0);
                // IfBlockElse @ [38:90]
                __internal.aboutToExecutePosInTemplate(38, 90);
            } else { // else @ [38:90]
                // PlainText @ [38:98]
                __internal.aboutToExecutePosInTemplate(38, 98);
                __internal.writeValue(PLAIN_TEXT_2_0);
                // IfBlockEnd @ [38:1]
                __internal.aboutToExecutePosInTemplate(38, 1);
            } // if end @ [38:1]
            // PlainText @ [38:148]
            __internal.aboutToExecutePosInTemplate(38, 148);
            __internal.writeValue(PLAIN_TEXT_3_0);
            // IfBlockBegin @ [40:63]
            __internal.aboutToExecutePosInTemplate(40, 63);
            if (!useLightProxy) {
                // PlainText @ [40:84]
                __internal.aboutToExecutePosInTemplate(40, 84);
                __internal.writeValue(PLAIN_TEXT_4_0);
                // IfBlockEnd @ [40:63]
                __internal.aboutToExecutePosInTemplate(40, 63);
            } // if end @ [40:63]
            // PlainText @ [42:65]
            __internal.aboutToExecutePosInTemplate(42, 65);
            __internal.writeValue(PLAIN_TEXT_5_0);
            // IfBlockBegin @ [56:1]
            __internal.aboutToExecutePosInTemplate(56, 1);
            if (prometheusMetrics) {
                // PlainText @ [56:24]
                __internal.aboutToExecutePosInTemplate(56, 24);
                __internal.writeValue(PLAIN_TEXT_6_0);
                // IfBlockElse @ [56:40]
                __internal.aboutToExecutePosInTemplate(56, 40);
            } else { // else @ [56:40]
                // PlainText @ [56:48]
                __internal.aboutToExecutePosInTemplate(56, 48);
                __internal.writeValue(PLAIN_TEXT_7_0);
                // IfBlockEnd @ [56:1]
                __internal.aboutToExecutePosInTemplate(56, 1);
            } // if end @ [56:1]
            // PlainText @ [56:62]
            __internal.aboutToExecutePosInTemplate(56, 62);
            __internal.writeValue(PLAIN_TEXT_8_0);
            // IfBlockBegin @ [58:19]
            __internal.aboutToExecutePosInTemplate(58, 19);
            if (!useLightProxy) {
                // PlainText @ [58:39]
                __internal.aboutToExecutePosInTemplate(58, 39);
                __internal.writeValue(PLAIN_TEXT_9_0);
                // IfBlockEnd @ [58:19]
                __internal.aboutToExecutePosInTemplate(58, 19);
            } // if end @ [58:19]
            // PlainText @ [60:17]
            __internal.aboutToExecutePosInTemplate(60, 17);
            __internal.writeValue(PLAIN_TEXT_10_0);
            // ValueExpression @ [79:39]
            __internal.aboutToExecutePosInTemplate(79, 39);
            __internal.renderValue(serviceId, false);
            // PlainText @ [79:21]
            __internal.aboutToExecutePosInTemplate(79, 21);
            __internal.writeValue(PLAIN_TEXT_11_0);
            // IfBlockBegin @ [89:1]
            __internal.aboutToExecutePosInTemplate(89, 1);
            if (prometheusMetrics) {
                // PlainText @ [89:24]
                __internal.aboutToExecutePosInTemplate(89, 24);
                __internal.writeValue(PLAIN_TEXT_12_0);
                // IfBlockEnd @ [89:1]
                __internal.aboutToExecutePosInTemplate(89, 1);
            } // if end @ [89:1]
            // PlainText @ [93:2]
            __internal.aboutToExecutePosInTemplate(93, 2);
            __internal.writeValue(PLAIN_TEXT_13_0);
        }
    }

    private static class PlainText {

        static private final String PLAIN_TEXT_0_0 = "\n\n# Handler middleware chain configuration\n---\nenabled: true\n\n#------------------------------------------------------------------------------\n# Support individual handler chains for each separate endpoint. It allows framework\n# handlers like health check, server info to bypass majority of the middleware handlers\n# and allows mixing multiple frameworks like OpenAPI and GraphQL in the same instance.\n#\n# handlers  --  list of handlers to be used across chains in this microservice\n#               including the routing handlers for ALL endpoints\n#           --  format: fully qualified handler class name@optional:given name\n# chains    --  allows forming of [1..N] chains, which could be wholly or\n#               used to form handler chains for each endpoint\n#               ex.: default chain below, reused partially across multiple endpoints\n# paths     --  list all the paths to be used for routing within the microservice\n#           ----  path: the URI for the endpoint (ex.: path: '/v1/pets')\n#           ----  method: the operation in use (ex.: 'post')\n#           ----  exec: handlers to be executed -- this element forms the list and\n#                       the order of execution for the handlers\n#\n# IMPORTANT NOTES:\n# - to avoid executing a handler, it has to be removed/commented out in the chain\n#   or change the enabled:boolean to false for a middleware handler configuration.\n# - all handlers, routing handler included, are to be listed in the execution chain\n# - for consistency, give a name to each handler; it is easier to refer to a name\n#   vs a fully qualified class name and is more elegant\n# - you can list in chains the fully qualified handler class names, and avoid using the\n#   handlers element altogether\n#------------------------------------------------------------------------------\nhandlers:\n  # Light-framework cross-cutting concerns implemented in the microservice\n  - com.networknt.exception.ExceptionHandler@exception\n";
        static private final String PLAIN_TEXT_1_0 = "  - com.networknt.metrics.prometheus.PrometheusHandler@prometheus";
        static private final String PLAIN_TEXT_2_0 = "  - com.networknt.metrics.MetricsHandler@metrics";
        static private final String PLAIN_TEXT_3_0 = "\n  - com.networknt.traceability.TraceabilityHandler@traceability\n  - com.networknt.correlation.CorrelationHandler@correlation ";
        static private final String PLAIN_TEXT_4_0 = "\n  - com.networknt.graphql.security.JwtVerifyHandler@security\n  - com.networknt.graphql.validator.ValidatorHandler@validator";
        static private final String PLAIN_TEXT_5_0 = "\n  # Framework endpoint handlers\n  - com.networknt.health.HealthGetHandler@health\n  - com.networknt.info.ServerInfoGetHandler@info\n  # - com.networknt.metrics.prometheus.PrometheusGetHandler@getprometheus\n  # GraphQL handlers\n  - com.networknt.graphql.router.handlers.GraphqlGetHandler@get\n  - com.networknt.graphql.router.handlers.GraphqlPostHandler@post\n  - com.networknt.graphql.router.handlers.GraphqlOptionsHandler@options\n  # Business Handlers\n\nchains:\n  default:\n    - exception\n";
        static private final String PLAIN_TEXT_6_0 = "    - prometheus";
        static private final String PLAIN_TEXT_7_0 = "    - metrics";
        static private final String PLAIN_TEXT_8_0 = "\n    - traceability\n    - correlation ";
        static private final String PLAIN_TEXT_9_0 = "\n    - security\n    - validator";
        static private final String PLAIN_TEXT_10_0 = "\n\npaths:\n  - path: '/graphql'\n    method: 'get'\n    exec:\n      - default\n      - get\n  - path: '/graphql'\n    method: 'post'\n    exec:\n      - default\n      - post\n  - path: '/graphql'\n    method: 'options'\n    exec:\n      - default\n      - options\n\n  - path: '/health/${server.serviceId:";
        static private final String PLAIN_TEXT_11_0 = "}'\n    method: 'get'\n    exec:\n      - health\n\n  - path: '/server/info'\n    method: 'get'\n    exec:\n      - info\n\n";
        static private final String PLAIN_TEXT_12_0 = "  - path: '/prometheus'\n    method: 'get'\n    exec:\n      - getprometheus\n";
        static private final String PLAIN_TEXT_13_0 = "\n";

    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy