// Path: inventory-cmd-producer/src/main/java/org/myeslib/cmdproducer/datasets/CreateCommandDataSet.java
// public class CreateCommandDataSet extends DataSetSupport {
// 
// 	private final List<UUID> ids ;
// 	
// 	public CreateCommandDataSet(List<UUID> ids, int howManyAggregates) {
// 		this.ids = ids;
// 		setSize(howManyAggregates);
// 		setReportCount(Math.min(100, howManyAggregates));
// 	}
// 
// 	@Override
// 	protected Object createMessageBody(long messageIndex) {
// 		UUID id = ids.get((int) messageIndex);
// 		CreateInventoryItem command = new CreateInventoryItem(UUID.randomUUID(), id);
// 		return command;
// 	}
// 	
// }
// 
// Path: inventory-cmd-producer/src/main/java/org/myeslib/cmdproducer/datasets/DecreaseCommandDataSet.java
// public class DecreaseCommandDataSet extends DataSetSupport {
// 
// 	public final List<UUID> ids;
// 	
// 	public DecreaseCommandDataSet(List<UUID> ids, int howManyAggregates) {
// 		this.ids = ids;
// 		setSize(howManyAggregates);
// 		setReportCount(Math.min(100, howManyAggregates));
// 	}
// 
// 	@Override
// 	protected Object createMessageBody(long messageIndex) {
// 		UUID id = ids.get((int) messageIndex);
// 		DecreaseInventory command = new DecreaseInventory(UUID.randomUUID(), id, 1, 2L);
// 		return command;
// 	}
// 	
// }
// 
// Path: inventory-cmd-producer/src/main/java/org/myeslib/cmdproducer/datasets/IncreaseCommandDataSet.java
// public class IncreaseCommandDataSet extends DataSetSupport {
// 
// 	public final List<UUID> ids ;
// 	
// 	public IncreaseCommandDataSet(List<UUID> ids, int howManyAggregates) {
// 		this.ids = ids;
// 		setSize(howManyAggregates);
// 		setReportCount(Math.min(100, howManyAggregates));
// 	}
// 
// 	@Override
// 	protected Object createMessageBody(long messageIndex) {
// 		UUID id = ids.get((int) messageIndex);
// 		IncreaseInventory command = new IncreaseInventory(UUID.randomUUID(), id, 2, 1L);
// 		return command;
// 	}
// 	
// }
// 
// Path: inventory-cmd-producer/src/main/java/org/myeslib/cmdproducer/routes/CommandsDataSetsRoute.java
// @AllArgsConstructor
// public class CommandsDataSetsRoute extends RouteBuilder {
// 
// 	final Gson gson;
// 	final String targetEndpoint;
// 	final Type commandType = new TypeToken<Command>() {}.getType();
// 
// 	final int datasetSize;
// 	final int delayBetweenDatasets;
// 	final int initialDelay;
// 
// 	public void configure() throws Exception {
// 
// 		fromF("dataset:createCommandDataset?initialDelay=%d", initialDelay)
// 				.routeId("dataset:createCommandsDataset")
// 				.startupOrder(1).autoStartup(true)
// 				.process(new MarshalProcessor()).to(targetEndpoint)
//                 .aggregate(constant(0), AggregationStrategies.useLatest()).completionSize(datasetSize)
//     			    .log("finished")
//     			    .log("will start next dataset")
//     			    .to("controlbus:route?routeId=dataset:increaseCommandsDataset&action=start")
// 				.end()
//     			;
// 
// 		fromF("dataset:increaseCommandDataset?initialDelay=%d", delayBetweenDatasets)
// 				.routeId("dataset:increaseCommandsDataset")
//                 .startupOrder(2).autoStartup(false)
// 				.process(new MarshalProcessor()).to(targetEndpoint)
// 				.aggregate(constant(0), AggregationStrategies.useLatest()).completionSize(datasetSize)
//                     .log("finished")
//                     .log("will start next dataset")
//                     .to("controlbus:route?routeId=dataset:decreaseCommandsDataset&action=start")
//                 .end();
// 				;
// 
// 		fromF("dataset:decreaseCommandDataset?initialDelay=%d", delayBetweenDatasets)
// 		        .routeId("dataset:decreaseCommandsDataset")
//                 .startupOrder(3).autoStartup(false)
// 				.process(new MarshalProcessor()).to(targetEndpoint)
//                 .aggregate(constant(0), AggregationStrategies.useLatest()).completionSize(datasetSize)
//                     .log("finished")
//                 .end();
// 		;
// 
// 	}
// 
// 	class MarshalProcessor implements Processor {
// 		@Override
// 		public void process(Exchange e) throws Exception {
// 			Command c = e.getIn().getBody(Command.class);
// 			String asJson = gson.toJson(c, commandType);
// 			e.getOut().setBody(asJson);
// 			e.getOut().setHeader(Exchange.CONTENT_TYPE, "application/json");
// 			e.getOut().setHeader(Exchange.HTTP_METHOD, constant("POST"));
// 		}
// 	}
// }


import java.util.List;
import java.util.UUID;
import java.util.Vector;
import javax.inject.Inject;
import lombok.extern.slf4j.Slf4j;
import org.apache.camel.CamelContext;
import org.apache.camel.impl.DefaultCamelContext;
import org.apache.camel.impl.SimpleRegistry;
import org.apache.camel.main.Main;
import org.myeslib.cmdproducer.datasets.CreateCommandDataSet;
import org.myeslib.cmdproducer.datasets.DecreaseCommandDataSet;
import org.myeslib.cmdproducer.datasets.IncreaseCommandDataSet;
import org.myeslib.cmdproducer.routes.CommandsDataSetsRoute;
import com.google.inject.Guice;
import com.google.inject.Injector;
package org.myeslib.cmdproducer;






@Slf4j
public class CmdProducer {
	
    final Main main;
	final SimpleRegistry registry;
	final CamelContext context;
	
	static int dataSetSize;
	static int delayBetweenDataSets;
	static int initialDelay;
	
	final List<UUID> ids = new Vector<>();
	
// Path: inventory-cmd-producer/src/main/java/org/myeslib/cmdproducer/datasets/CreateCommandDataSet.java
// public class CreateCommandDataSet extends DataSetSupport {
// 
// 	private final List<UUID> ids ;
// 	
// 	public CreateCommandDataSet(List<UUID> ids, int howManyAggregates) {
// 		this.ids = ids;
// 		setSize(howManyAggregates);
// 		setReportCount(Math.min(100, howManyAggregates));
// 	}
// 
// 	@Override
// 	protected Object createMessageBody(long messageIndex) {
// 		UUID id = ids.get((int) messageIndex);
// 		CreateInventoryItem command = new CreateInventoryItem(UUID.randomUUID(), id);
// 		return command;
// 	}
// 	
// }
// 
// Path: inventory-cmd-producer/src/main/java/org/myeslib/cmdproducer/datasets/DecreaseCommandDataSet.java
// public class DecreaseCommandDataSet extends DataSetSupport {
// 
// 	public final List<UUID> ids;
// 	
// 	public DecreaseCommandDataSet(List<UUID> ids, int howManyAggregates) {
// 		this.ids = ids;
// 		setSize(howManyAggregates);
// 		setReportCount(Math.min(100, howManyAggregates));
// 	}
// 
// 	@Override
// 	protected Object createMessageBody(long messageIndex) {
// 		UUID id = ids.get((int) messageIndex);
// 		DecreaseInventory command = new DecreaseInventory(UUID.randomUUID(), id, 1, 2L);
// 		return command;
// 	}
// 	
// }
// 
// Path: inventory-cmd-producer/src/main/java/org/myeslib/cmdproducer/datasets/IncreaseCommandDataSet.java
// public class IncreaseCommandDataSet extends DataSetSupport {
// 
// 	public final List<UUID> ids ;
// 	
// 	public IncreaseCommandDataSet(List<UUID> ids, int howManyAggregates) {
// 		this.ids = ids;
// 		setSize(howManyAggregates);
// 		setReportCount(Math.min(100, howManyAggregates));
// 	}
// 
// 	@Override
// 	protected Object createMessageBody(long messageIndex) {
// 		UUID id = ids.get((int) messageIndex);
// 		IncreaseInventory command = new IncreaseInventory(UUID.randomUUID(), id, 2, 1L);
// 		return command;
// 	}
// 	
// }
// 
// Path: inventory-cmd-producer/src/main/java/org/myeslib/cmdproducer/routes/CommandsDataSetsRoute.java
// @AllArgsConstructor
// public class CommandsDataSetsRoute extends RouteBuilder {
// 
// 	final Gson gson;
// 	final String targetEndpoint;
// 	final Type commandType = new TypeToken<Command>() {}.getType();
// 
// 	final int datasetSize;
// 	final int delayBetweenDatasets;
// 	final int initialDelay;
// 
// 	public void configure() throws Exception {
// 
// 		fromF("dataset:createCommandDataset?initialDelay=%d", initialDelay)
// 				.routeId("dataset:createCommandsDataset")
// 				.startupOrder(1).autoStartup(true)
// 				.process(new MarshalProcessor()).to(targetEndpoint)
//                 .aggregate(constant(0), AggregationStrategies.useLatest()).completionSize(datasetSize)
//     			    .log("finished")
//     			    .log("will start next dataset")
//     			    .to("controlbus:route?routeId=dataset:increaseCommandsDataset&action=start")
// 				.end()
//     			;
// 
// 		fromF("dataset:increaseCommandDataset?initialDelay=%d", delayBetweenDatasets)
// 				.routeId("dataset:increaseCommandsDataset")
//                 .startupOrder(2).autoStartup(false)
// 				.process(new MarshalProcessor()).to(targetEndpoint)
// 				.aggregate(constant(0), AggregationStrategies.useLatest()).completionSize(datasetSize)
//                     .log("finished")
//                     .log("will start next dataset")
//                     .to("controlbus:route?routeId=dataset:decreaseCommandsDataset&action=start")
//                 .end();
// 				;
// 
// 		fromF("dataset:decreaseCommandDataset?initialDelay=%d", delayBetweenDatasets)
// 		        .routeId("dataset:decreaseCommandsDataset")
//                 .startupOrder(3).autoStartup(false)
// 				.process(new MarshalProcessor()).to(targetEndpoint)
//                 .aggregate(constant(0), AggregationStrategies.useLatest()).completionSize(datasetSize)
//                     .log("finished")
//                 .end();
// 		;
// 
// 	}
// 
// 	class MarshalProcessor implements Processor {
// 		@Override
// 		public void process(Exchange e) throws Exception {
// 			Command c = e.getIn().getBody(Command.class);
// 			String asJson = gson.toJson(c, commandType);
// 			e.getOut().setBody(asJson);
// 			e.getOut().setHeader(Exchange.CONTENT_TYPE, "application/json");
// 			e.getOut().setHeader(Exchange.HTTP_METHOD, constant("POST"));
// 		}
// 	}
// }


// Path: inventory-cmd-producer/src/main/java/org/myeslib/cmdproducer/CmdProducer.java
import java.util.List;
import java.util.UUID;
import java.util.Vector;
import javax.inject.Inject;
import lombok.extern.slf4j.Slf4j;
import org.apache.camel.CamelContext;
import org.apache.camel.impl.DefaultCamelContext;
import org.apache.camel.impl.SimpleRegistry;
import org.apache.camel.main.Main;
import org.myeslib.cmdproducer.datasets.CreateCommandDataSet;
import org.myeslib.cmdproducer.datasets.DecreaseCommandDataSet;
import org.myeslib.cmdproducer.datasets.IncreaseCommandDataSet;
import org.myeslib.cmdproducer.routes.CommandsDataSetsRoute;
import com.google.inject.Guice;
import com.google.inject.Injector;

package org.myeslib.cmdproducer;






@Slf4j
public class CmdProducer {
	
    final Main main;
	final SimpleRegistry registry;
	final CamelContext context;
	
	static int dataSetSize;
	static int delayBetweenDataSets;
	static int initialDelay;
	
	final List<UUID> ids = new Vector<>();
	
	public static void main(String[] args) throws Exception {