Package by.stub.yaml

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(put));
      final StubHttpLifecycle newStubHttpLifecycle = stubHttpLifecycles.get(0);
      dataStore.updateStubHttpLifecycleByIndex(stubIndexToUpdate, newStubHttpLifecycle);

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


            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 refresh of YAML configuration from: %s%s",
                  "\n",
                  dataYaml.getAbsolutePath(),
View Full Code Here

         return;
      }

      try {

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

         dataStore.resetStubHttpLifecycles(stubHttpLifecycles);

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


      Log.setLog(new EmptyLogger());

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

      System.out.println();

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

            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%s",
                  "\n",
                  stubbedDataManager.getDataYaml(),
View Full Code Here

            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%s",
                  "\n",
                  dataYaml.getAbsolutePath(),
View Full Code Here

      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

            }

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

            try {
               stubbedDataManager.refreshStubbedData(new YamlParser());
               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(),
                  "\n"));
            } catch (final Exception ex) {
View Full Code Here

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

            try {
               mainYamlLastModified = currentFileModified;
               stubbedDataManager.refreshStubbedData(new YamlParser());
               ANSITerminal.ok(String.format("%sSuccessfully performed live refresh of main YAML file from: %s on [" + new Date().toString().trim() + "]%s",
                  "\n",
                  dataYaml.getAbsolutePath(),
                  "\n"));
            } catch (final Exception ex) {
View Full Code Here

      wrapper.setContentType(MimeTypes.TEXT_PLAIN_UTF_8);
      wrapper.setStatus(HttpStatus.OK_200);
      wrapper.setHeader(HttpHeaders.SERVER, HandlerUtils.constructHeaderServerName());

      try {
         stubbedDataManager.refreshStubbedData(new YamlParser());
         final String successMessage = String.format("Successfully performed live refresh of main YAML from: %s on [" + new Date().toString().trim() + "]",
            stubbedDataManager.getDataYaml());
         wrapper.getWriter().println(successMessage);
         ANSITerminal.ok(successMessage);
      } catch (final Exception ex) {
View Full Code Here

TOP

Related Classes of by.stub.yaml.YamlParser

Copyright © 2018 www.massapicom. 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.