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

import org.apache.camel.AsyncCallback;
import org.apache.camel.Exchange;
import org.apache.camel.spi.InvokeOnHeaderStrategy;
import org.apache.camel.component.dynamicrouter.control.DynamicRouterControlProducer;

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

    @Override
    public Object invoke(Object obj, String key, Exchange exchange, AsyncCallback callback) throws Exception {
        org.apache.camel.component.dynamicrouter.control.DynamicRouterControlProducer target = (org.apache.camel.component.dynamicrouter.control.DynamicRouterControlProducer) obj;
        switch (key) {
        case "list": target.performList(exchange, callback); return callback;
        case "statistics": target.performStats(exchange, callback); return callback;
        case "subscribe": target.performSubscribe(exchange.getMessage(), callback); return callback;
        case "unsubscribe": target.performUnsubscribe(exchange.getMessage(), callback); return callback;
        case "update": target.performUpdate(exchange.getMessage(), callback); return callback;
        default: return null;
        }
    }

}

