// Path: rsimulator-core/src/main/java/com/github/bjuvensjo/rsimulator/core/Simulator.java
// @ImplementedBy(SimulatorImpl.class)
// public interface Simulator {
// 
//     /**
//      * Returns a SimulatorResponse that matches the specified request.
//      *
//      * @param rootPath         the root path on which to search recursively for matches to the specified request
//      * @param rootRelativePath the path on which to search recursively for matches to the specified request
//      * @param request          the request
//      * @param contentType      the content type of the request, e.g. txt or xml
//      * @param vars             vars that can be used in for example scripts
//      * @return a SimulatorResponse that matches the specified request
//      */
//     Optional<SimulatorResponse> service(String rootPath, String rootRelativePath, String request, String contentType, Map<String, Object>... vars);
// }
// 
// Path: rsimulator-core/src/main/java/com/github/bjuvensjo/rsimulator/core/SimulatorResponse.java
// public interface SimulatorResponse {
// 
//     /**
//      * Returns the properties of a specific test data request and response pair. If the name of the test data request
//      * file for instance is Test1Request.xml, the properties file must be named Test1.properties. For supported
//      * properties, see *PropertiesInterceptor classes.
//      *
//      * @return the properties of a specific test data request and response pair
//      */
//     Optional<Properties> getProperties();
// 
//     /**
//      * Sets the specified properties.
//      *
//      * @param properties the properties to set
//      */
//     void setProperties(Optional<Properties> properties);
// 
//     /**
//      * Returns the test data response.
//      *
//      * @return the test data response
//      */
//     String getResponse();
// 
//     /**
//      * Sets the specified response.
//      *
//      * @param response the response to set
//      */
//     void setResponse(String response);
// 
//     /**
//      * Returns the matching request path.
//      *
//      * @return the matching request path
//      */
//     Path getMatchingRequest();
// 
//     /**
//      * Sets the specified path.
//      *
//      * @param path the path to set
//      */
//     void setMatchingRequest(Path path);
// }
// 
// Path: rsimulator-core/src/main/java/com/github/bjuvensjo/rsimulator/core/config/CoreModule.java
// public class CoreModule extends AbstractModule {
//     private final Logger log = LoggerFactory.getLogger(CoreModule.class);
//     private static final CacheManager cacheManager = CacheManager.create();
// 
//     @Provides
//     @Named("rsimulator-core-properties")
//     java.util.Properties provideProperties() {
//         java.util.Properties properties = new java.util.Properties();
//         URL resource = getClass().getResource("/rsimulator.properties");
//         if (resource == null) {
//             properties.setProperty("simulatorCache", "false");
//             properties.setProperty("ignoreXmlNamespaces", "false");
//         } else {
//             try (BufferedInputStream bis = new BufferedInputStream(resource.openStream())) {
//                 properties.load(bis);
//             } catch (Exception e) {
//                 log.error("Error reading properties from: {}", resource.getPath(), e);
//             }
//         }
//         return properties;
//     }
// 
//     @Override
//     protected void configure() {
//         MapBinder<String, Handler> map = MapBinder.newMapBinder(binder(), String.class, Handler.class);
//         map.addBinding("json").to(JsonHandler.class);
//         map.addBinding("txt").to(TxtHandler.class);
//         map.addBinding("xml").to(XmlHandler.class);
// 
//         // ***** Interceptors for cache and script *****
//         Arrays.asList("SimulatorCache", "FileUtilsCache", "PropsCache").forEach(name ->
//                 bind(net.sf.ehcache.Cache.class).annotatedWith(Names.named(name)).toInstance(cacheManager.getCache(name)));
// 
// 
//         SimulatorPropertiesInterceptor simulatorPropertiesInterceptor = new SimulatorPropertiesInterceptor();
//         SimulatorCacheInterceptor simulatorCacheInterceptor = new SimulatorCacheInterceptor();
//         SimulatorScriptInterceptor simulatorScriptInterceptor = new SimulatorScriptInterceptor();
//         FileUtilsCacheInterceptor fileUtilsCacheInterceptor = new FileUtilsCacheInterceptor();
//         PropsCacheInterceptor propsCacheInterceptor = new PropsCacheInterceptor();
// 
//         requestInjection(simulatorPropertiesInterceptor);
//         requestInjection(simulatorCacheInterceptor);
//         requestInjection(simulatorScriptInterceptor);
//         requestInjection(fileUtilsCacheInterceptor);
//         requestInjection(propsCacheInterceptor);
// 
//         // Order is significant
//         bindInterceptor(Matchers.subclassesOf(Simulator.class), Matchers.annotatedWith(Properties.class),
//                 simulatorPropertiesInterceptor);
//         bindInterceptor(Matchers.subclassesOf(Simulator.class), Matchers.annotatedWith(Cache.class),
//                 simulatorCacheInterceptor);
//         bindInterceptor(Matchers.subclassesOf(Simulator.class), Matchers.annotatedWith(Script.class),
//                 simulatorScriptInterceptor);
//         bindInterceptor(Matchers.subclassesOf(FileUtils.class), Matchers.annotatedWith(Cache.class),
//                 fileUtilsCacheInterceptor);
//         bindInterceptor(Matchers.subclassesOf(Props.class), Matchers.annotatedWith(Cache.class),
//                 propsCacheInterceptor);
//     }
// }


import com.github.bjuvensjo.rsimulator.core.Simulator;
import com.github.bjuvensjo.rsimulator.core.SimulatorResponse;
import com.github.bjuvensjo.rsimulator.core.config.CoreModule;
import com.google.inject.Guice;
import com.google.inject.Inject;
import com.google.inject.Injector;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.Properties;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
package com.github.bjuvensjo.rsimulator.camel.direct;



public class DirectProcessor implements Processor {
    private static final Pattern ACCEPT_PATTERN = Pattern.compile("([^;]+)");
    private static final Pattern CONTENT_TYPE_PATTERN = Pattern.compile("([^;]+)");
    private static final String DEFAULT = "default";
    Map<String, String> accepts;
    String endpointUri;
    DirectComponentConfig directComponentConfig;
    @Inject
// Path: rsimulator-core/src/main/java/com/github/bjuvensjo/rsimulator/core/Simulator.java
// @ImplementedBy(SimulatorImpl.class)
// public interface Simulator {
// 
//     /**
//      * Returns a SimulatorResponse that matches the specified request.
//      *
//      * @param rootPath         the root path on which to search recursively for matches to the specified request
//      * @param rootRelativePath the path on which to search recursively for matches to the specified request
//      * @param request          the request
//      * @param contentType      the content type of the request, e.g. txt or xml
//      * @param vars             vars that can be used in for example scripts
//      * @return a SimulatorResponse that matches the specified request
//      */
//     Optional<SimulatorResponse> service(String rootPath, String rootRelativePath, String request, String contentType, Map<String, Object>... vars);
// }
// 
// Path: rsimulator-core/src/main/java/com/github/bjuvensjo/rsimulator/core/SimulatorResponse.java
// public interface SimulatorResponse {
// 
//     /**
//      * Returns the properties of a specific test data request and response pair. If the name of the test data request
//      * file for instance is Test1Request.xml, the properties file must be named Test1.properties. For supported
//      * properties, see *PropertiesInterceptor classes.
//      *
//      * @return the properties of a specific test data request and response pair
//      */
//     Optional<Properties> getProperties();
// 
//     /**
//      * Sets the specified properties.
//      *
//      * @param properties the properties to set
//      */
//     void setProperties(Optional<Properties> properties);
// 
//     /**
//      * Returns the test data response.
//      *
//      * @return the test data response
//      */
//     String getResponse();
// 
//     /**
//      * Sets the specified response.
//      *
//      * @param response the response to set
//      */
//     void setResponse(String response);
// 
//     /**
//      * Returns the matching request path.
//      *
//      * @return the matching request path
//      */
//     Path getMatchingRequest();
// 
//     /**
//      * Sets the specified path.
//      *
//      * @param path the path to set
//      */
//     void setMatchingRequest(Path path);
// }
// 
// Path: rsimulator-core/src/main/java/com/github/bjuvensjo/rsimulator/core/config/CoreModule.java
// public class CoreModule extends AbstractModule {
//     private final Logger log = LoggerFactory.getLogger(CoreModule.class);
//     private static final CacheManager cacheManager = CacheManager.create();
// 
//     @Provides
//     @Named("rsimulator-core-properties")
//     java.util.Properties provideProperties() {
//         java.util.Properties properties = new java.util.Properties();
//         URL resource = getClass().getResource("/rsimulator.properties");
//         if (resource == null) {
//             properties.setProperty("simulatorCache", "false");
//             properties.setProperty("ignoreXmlNamespaces", "false");
//         } else {
//             try (BufferedInputStream bis = new BufferedInputStream(resource.openStream())) {
//                 properties.load(bis);
//             } catch (Exception e) {
//                 log.error("Error reading properties from: {}", resource.getPath(), e);
//             }
//         }
//         return properties;
//     }
// 
//     @Override
//     protected void configure() {
//         MapBinder<String, Handler> map = MapBinder.newMapBinder(binder(), String.class, Handler.class);
//         map.addBinding("json").to(JsonHandler.class);
//         map.addBinding("txt").to(TxtHandler.class);
//         map.addBinding("xml").to(XmlHandler.class);
// 
//         // ***** Interceptors for cache and script *****
//         Arrays.asList("SimulatorCache", "FileUtilsCache", "PropsCache").forEach(name ->
//                 bind(net.sf.ehcache.Cache.class).annotatedWith(Names.named(name)).toInstance(cacheManager.getCache(name)));
// 
// 
//         SimulatorPropertiesInterceptor simulatorPropertiesInterceptor = new SimulatorPropertiesInterceptor();
//         SimulatorCacheInterceptor simulatorCacheInterceptor = new SimulatorCacheInterceptor();
//         SimulatorScriptInterceptor simulatorScriptInterceptor = new SimulatorScriptInterceptor();
//         FileUtilsCacheInterceptor fileUtilsCacheInterceptor = new FileUtilsCacheInterceptor();
//         PropsCacheInterceptor propsCacheInterceptor = new PropsCacheInterceptor();
// 
//         requestInjection(simulatorPropertiesInterceptor);
//         requestInjection(simulatorCacheInterceptor);
//         requestInjection(simulatorScriptInterceptor);
//         requestInjection(fileUtilsCacheInterceptor);
//         requestInjection(propsCacheInterceptor);
// 
//         // Order is significant
//         bindInterceptor(Matchers.subclassesOf(Simulator.class), Matchers.annotatedWith(Properties.class),
//                 simulatorPropertiesInterceptor);
//         bindInterceptor(Matchers.subclassesOf(Simulator.class), Matchers.annotatedWith(Cache.class),
//                 simulatorCacheInterceptor);
//         bindInterceptor(Matchers.subclassesOf(Simulator.class), Matchers.annotatedWith(Script.class),
//                 simulatorScriptInterceptor);
//         bindInterceptor(Matchers.subclassesOf(FileUtils.class), Matchers.annotatedWith(Cache.class),
//                 fileUtilsCacheInterceptor);
//         bindInterceptor(Matchers.subclassesOf(Props.class), Matchers.annotatedWith(Cache.class),
//                 propsCacheInterceptor);
//     }
// }


// Path: rsimulator-camel-direct/src/main/java/com/github/bjuvensjo/rsimulator/camel/direct/DirectProcessor.java
import com.github.bjuvensjo.rsimulator.core.Simulator;
import com.github.bjuvensjo.rsimulator.core.SimulatorResponse;
import com.github.bjuvensjo.rsimulator.core.config.CoreModule;
import com.google.inject.Guice;
import com.google.inject.Inject;
import com.google.inject.Injector;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.Properties;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

package com.github.bjuvensjo.rsimulator.camel.direct;



public class DirectProcessor implements Processor {
    private static final Pattern ACCEPT_PATTERN = Pattern.compile("([^;]+)");
    private static final Pattern CONTENT_TYPE_PATTERN = Pattern.compile("([^;]+)");
    private static final String DEFAULT = "default";
    Map<String, String> accepts;
    String endpointUri;
    DirectComponentConfig directComponentConfig;
    @Inject
    Simulator simulator;