Skip to content

Commit

Permalink
structural refactorings
Browse files Browse the repository at this point in the history
  • Loading branch information
eviltester committed Apr 6, 2024
1 parent 2736eb4 commit 0aca49c
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import uk.co.compendiumdev.challenge.challengesrouting.*;
import uk.co.compendiumdev.challenge.gui.ChallengerWebGUI;
import uk.co.compendiumdev.challenge.persistence.PersistenceLayer;
import uk.co.compendiumdev.challenge.practicemodes.mirror.MirrorRoutes;
import uk.co.compendiumdev.challenge.practicemodes.simulation.SimulationRoutes;
import uk.co.compendiumdev.thingifier.Thingifier;
import uk.co.compendiumdev.thingifier.api.docgen.ThingifierApiDocumentationDefn;
import uk.co.compendiumdev.thingifier.application.httprouting.ThingifierHttpApiRoutings;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package uk.co.compendiumdev.challenge.challengesrouting;
package uk.co.compendiumdev.challenge.practicemodes.mirror;

import uk.co.compendiumdev.thingifier.api.http.headers.headerparser.AcceptHeaderParser;
import uk.co.compendiumdev.thingifier.api.http.HttpApiRequest;
import uk.co.compendiumdev.thingifier.api.response.ApiResponse;
import uk.co.compendiumdev.thingifier.application.internalhttpconversion.StringPair;
import uk.co.compendiumdev.thingifier.application.routehandlers.HttpApiRequestHandler;
import uk.co.compendiumdev.thingifier.core.domain.definitions.EntityDefinition;
import uk.co.compendiumdev.thingifier.core.domain.instances.EntityInstance;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
package uk.co.compendiumdev.challenge.challengesrouting;
package uk.co.compendiumdev.challenge.practicemodes.mirror;

import uk.co.compendiumdev.thingifier.api.http.HttpApiRequest;
import uk.co.compendiumdev.thingifier.api.http.headers.headerparser.AcceptHeaderParser;
import uk.co.compendiumdev.thingifier.api.response.ApiResponse;
import uk.co.compendiumdev.thingifier.application.internalhttpconversion.StringPair;
import uk.co.compendiumdev.thingifier.application.routehandlers.HttpApiRequestHandler;
import uk.co.compendiumdev.thingifier.core.domain.definitions.EntityDefinition;
import uk.co.compendiumdev.thingifier.core.domain.instances.EntityInstance;
import uk.co.compendiumdev.thingifier.core.query.FilterBy;
import uk.co.compendiumdev.thingifier.core.query.QueryFilterParams;

public class MirrorHttpApiTextRequestHandler implements HttpApiRequestHandler {

public ApiResponse handle(final HttpApiRequest myRequest) {
// convert request into a string for message body- getRequestDetails
String requestDetails = getRequestDetails(myRequest);

ApiResponse response=null;
ApiResponse response;

response = ApiResponse.success().setHeader("Content-Type", "text/plain");
response.setBody(requestDetails);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package uk.co.compendiumdev.challenge.challengesrouting;
package uk.co.compendiumdev.challenge.practicemodes.mirror;

import spark.Route;
import uk.co.compendiumdev.thingifier.api.docgen.ThingifierApiDocumentationDefn;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package uk.co.compendiumdev.challenge.challengesrouting;
package uk.co.compendiumdev.challenge.practicemodes.mirror;

import spark.Request;
import spark.Response;
import uk.co.compendiumdev.challenge.spark.SparkMessageLengthValidator;
import uk.co.compendiumdev.thingifier.Thingifier;
import uk.co.compendiumdev.thingifier.api.http.headers.headerparser.AcceptHeaderParser;
import uk.co.compendiumdev.thingifier.api.response.ApiResponse;
import uk.co.compendiumdev.thingifier.application.routehandlers.SparkApiRequestResponseHandler;
import uk.co.compendiumdev.thingifier.core.domain.definitions.EntityDefinition;
import uk.co.compendiumdev.thingifier.core.domain.instances.EntityInstanceCollection;
import uk.co.compendiumdev.thingifier.core.domain.definitions.field.definition.Field;
import uk.co.compendiumdev.thingifier.core.domain.definitions.field.definition.FieldType;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package uk.co.compendiumdev.challenge.challengesrouting;
package uk.co.compendiumdev.challenge.practicemodes.simulation;

import uk.co.compendiumdev.thingifier.Thingifier;
import uk.co.compendiumdev.thingifier.api.docgen.ThingifierApiDocumentationDefn;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package uk.co.compendiumdev.challenge.challengesrouting;
package uk.co.compendiumdev.challenge.spark;

import spark.Request;
import spark.Response;
Expand All @@ -16,7 +16,7 @@ public class SparkMessageLengthValidator {

private final int maxLength;

SparkMessageLengthValidator(){
public SparkMessageLengthValidator(){
this(DEFAULT_MAX_LENGTH);
}

Expand Down

0 comments on commit 0aca49c

Please sign in to comment.