/* Generated by camel build tools - do NOT edit this file! */
package org.apache.camel.component.consul.endpoint;

import org.apache.camel.AsyncCallback;
import org.apache.camel.Exchange;
import org.apache.camel.spi.InvokeOnHeaderStrategy;
import org.apache.camel.component.consul.endpoint.ConsulStatusProducer;

/**
 * Generated by camel build tools - do NOT edit this file!
 */
@SuppressWarnings("unchecked")
public class ConsulStatusProducerInvokeOnHeaderFactory implements InvokeOnHeaderStrategy {

    @Override
    public Object invoke(Object obj, String key, Exchange exchange, AsyncCallback callback) throws Exception {
        org.apache.camel.component.consul.endpoint.ConsulStatusProducer target = (org.apache.camel.component.consul.endpoint.ConsulStatusProducer) obj;
        switch (key) {
        case "leader":
        case "LEADER": return target.invokeChecks(exchange.getMessage());
        case "peers":
        case "PEERS": return target.invokePeers(exchange.getMessage());
        default: return null;
        }
    }

}

