Examples of YamlParser


Examples of by.stub.yaml.YamlParser

            ANSITerminal.info(String.format("\nConfiguration scan detected change in %s\n", dataStore.getDataYaml().getAbsolutePath()));

            try {
               lastModified = currentFileModified;
               final List<StubHttpLifecycle> stubHttpLifecycles = new YamlParser().parse(dataYaml.getParent(), FileUtils.constructReader(dataYaml));

               dataStore.resetStubHttpLifecycles(stubHttpLifecycles);
               ANSITerminal.ok(String.format("%sSuccessfully performed live reload of YAML configuration from: %s%s",
                  "\n",
                  dataYaml.getAbsolutePath(),
View Full Code Here

Examples of by.stub.yaml.YamlParser

            ANSITerminal.info(String.format("\nExternal file scan detected change in %s\n", offendingFilename));

            try {
               final List<StubHttpLifecycle> stubHttpLifecycles =
                  new YamlParser().parse(stubbedDataManager.getYamlParentDirectory(), FileUtils.constructReader(stubbedDataManager.getDataYaml()));

               stubbedDataManager.resetStubHttpLifecycles(stubHttpLifecycles);
               ANSITerminal.ok(String.format("%sSuccessfully performed live refresh of main YAML with external files from: %s on [" + new Date().toString().trim() + "]%s",
                  "\n",
                  stubbedDataManager.getDataYaml(),
View Full Code Here

Examples of by.stub.yaml.YamlParser

            ANSITerminal.info(String.format("\nMain YAML scan detected change in %s\n", stubbedDataManager.getYamlAbsolutePath()));

            try {
               mainYamlLastModified = currentFileModified;
               final List<StubHttpLifecycle> stubHttpLifecycles = new YamlParser().parse(dataYaml.getParent(), FileUtils.constructReader(dataYaml));

               stubbedDataManager.resetStubHttpLifecycles(stubHttpLifecycles);
               ANSITerminal.ok(String.format("%sSuccessfully performed live refresh of main YAML file from: %s on [" + new Date().toString().trim() + "]%s",
                  "\n",
                  dataYaml.getAbsolutePath(),
View Full Code Here

Examples of by.stub.yaml.YamlParser

         final String errorMessage = String.format("%s request on URI %s was empty", request.getMethod(), request.getRequestURI());
         HandlerUtils.configureErrorResponse(wrapper, HttpStatus.NO_CONTENT_204, errorMessage);
         return;
      }

      final List<StubHttpLifecycle> stubHttpLifecycles = new YamlParser().parse(stubbedDataManager.getYamlParentDirectory(), FileUtils.constructReader(put));
      final StubHttpLifecycle newStubHttpLifecycle = stubHttpLifecycles.get(0);
      stubbedDataManager.updateStubHttpLifecycleByIndex(stubIndexToUpdate, newStubHttpLifecycle);

      wrapper.setStatus(HttpStatus.CREATED_201);
      wrapper.addHeader(HttpHeaders.LOCATION, newStubHttpLifecycle.getRequest().getUrl());
View Full Code Here

Examples of by.stub.yaml.YamlParser

         final String errorMessage = String.format("%s request on URI %s was empty", request.getMethod(), request.getRequestURI());
         HandlerUtils.configureErrorResponse(wrapper, HttpStatus.NO_CONTENT_204, errorMessage);
         return;
      }

      final List<StubHttpLifecycle> stubHttpLifecycles = new YamlParser().parse(stubbedDataManager.getYamlParentDirectory(), FileUtils.constructReader(post));
      stubbedDataManager.resetStubHttpLifecycles(stubHttpLifecycles);

      if (stubHttpLifecycles.size() == 1) {
         wrapper.addHeader(HttpHeaders.LOCATION, stubHttpLifecycles.get(0).getRequest().getUrl());
      }
View Full Code Here

Examples of by.stub.yaml.YamlParser

   public synchronized StubbyManager construct(final String dataYamlFilename, final Map<String, String> commandLineArgs) throws Exception {

      Log.setLog(new EmptyLogger());

      final File dataYamlFile = new File(dataYamlFilename);
      final List<StubHttpLifecycle> httpLifecycles = new YamlParser().parse(dataYamlFile.getParent(), FileUtils.constructReader(dataYamlFile));

      System.out.println();

      final StubbedDataManager stubbedDataManager = new StubbedDataManager(dataYamlFile, httpLifecycles);
      final JettyFactory jettyFactory = new JettyFactory(commandLineArgs, stubbedDataManager);
View Full Code Here

Examples of by.stub.yaml.YamlParser

         return;
      }

      try {

         final List<StubHttpLifecycle> stubHttpLifecycles = new YamlParser().parse(dataStore.getDataYaml().getParent(), FileUtils.constructReader(post));

         dataStore.resetStubHttpLifecycles(stubHttpLifecycles);

         response.setStatus(HttpStatus.CREATED_201);
         response.getWriter().println("Configuration created successfully");
View Full Code Here

Examples of by.stub.yaml.YamlParser

      synchronized (JettyManagerFactory.class) {

         Log.setLog(new EmptyLogger());

         final YamlParser yamlParser = new YamlParser(yamlConfigFilename);
         final List<StubHttpLifecycle> httpLifecycles = yamlParser.parseAndLoad();
         System.out.println();
         final DataStore dataStore = new DataStore(httpLifecycles);
         final JettyFactory jettyFactory = new JettyFactory(commandLineArgs, dataStore, yamlParser);
         final Server server = jettyFactory.construct(dataStore, yamlParser);
View Full Code Here

Examples of by.stub.yaml.YamlParser

      synchronized (JettyManagerFactory.class) {

         Log.setLog(new EmptyLogger());

         final YamlParser yamlParser = new YamlParser(yamlConfigFilename);
         final List<StubHttpLifecycle> httpLifecycles = yamlParser.parseAndLoad();
         System.out.println();
         final DataStore dataStore = new DataStore(httpLifecycles);
         final JettyFactory jettyFactory = new JettyFactory(commandLineArgs, dataStore, yamlParser);
         final Server server = jettyFactory.construct();
View Full Code Here

Examples of by.stub.yaml.YamlParser

         final String errorMessage = String.format("%s request on URI %s was empty", request.getMethod(), request.getRequestURI());
         HandlerUtils.configureErrorResponse(wrapper, HttpStatus.NO_CONTENT_204, errorMessage);
         return;
      }

      final List<StubHttpLifecycle> stubHttpLifecycles = new YamlParser().parse(dataStore.getYamlParentDirectory(), FileUtils.constructReader(post));
      dataStore.resetStubHttpLifecycles(stubHttpLifecycles);

      if (stubHttpLifecycles.size() == 1) {
         wrapper.addHeader(HttpHeaders.LOCATION, stubHttpLifecycles.get(0).getRequest().getUrl());
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.