Package mazealgo.model.server
Class SolveMazeStrategy
java.lang.Object
mazealgo.model.server.SolveMazeStrategy
- All Implemented Interfaces:
IServerStrategy
Server strategy: receives a
Maze, returns a Solution.
Consults SolutionCache first — if this exact maze was solved
earlier (same bytes → same SHA-256), the stored Solution is returned
directly and the search algorithm is not invoked.
Wire protocol (symmetric Object streams on both sides):
client ─[ObjectOutputStream]─ Maze ─→ server client ←─────── Solution ─── server
A new searcher is created per request (cheap, and avoids the
stale-state pitfalls discussed in ASearchingAlgorithm).
-
Constructor Summary
ConstructorsConstructorDescriptionSolveMazeStrategy(SolutionCache cache, Supplier<ISearchingAlgorithm> searcherFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoidserverStrategy(InputStream inFromClient, OutputStream outToClient)
-
Constructor Details
-
SolveMazeStrategy
public SolveMazeStrategy() -
SolveMazeStrategy
-
-
Method Details
-
serverStrategy
- Specified by:
serverStrategyin interfaceIServerStrategy- Throws:
Exception
-