[LIB-13] Lazy scanners init, scan by URL and rename API functions
[chesshog-scanner.git] / src / main / java / org / hedgecode / chess / scanner / portal / ChessBombScanner.java
index d8b6ed0..7b19256 100644 (file)
@@ -41,7 +41,7 @@ public class ChessBombScanner extends AbstractSettingsScanner {
     }
 
     @Override
-    public PGNTournament getTournament(String tournamentId) throws ChessHogScannerException {
+    public PGNTournament scanTournament(String tournamentId) throws ChessHogScannerException {
         String decodeTournament = decodeUrlByRegex(
                 assignUrl(tournamentId, null),
                 getSettings().getTournamentGamesUrlRegex()
@@ -55,7 +55,7 @@ public class ChessBombScanner extends AbstractSettingsScanner {
 
         for (String gameId : tournamentFormat.gameUrls()) {
             tournament.addGame(
-                    getGame(gameId, tournamentId)
+                    scanGame(gameId, tournamentId)
             );
         }
 
@@ -74,19 +74,19 @@ public class ChessBombScanner extends AbstractSettingsScanner {
         String tournamentId = arenaFormat.findTournament(tournamentName);
 
         return tournamentId != null
-                ? getTournament(tournamentId)
+                ? scanTournament(tournamentId)
                 : null;
     }
 
     @Override
-    public PGNGame getGame(String gameId) throws ChessHogScannerException {
+    public PGNGame scanGame(String gameId) throws ChessHogScannerException {
         throw new ChessHogScannerException(
                 "ChessBomb does not support searching game without a tournament name!"
         );
     }
 
     @Override
-    public PGNGame getGame(String gameId, String tournamentId) throws ChessHogScannerException {
+    public PGNGame scanGame(String gameId, String tournamentId) throws ChessHogScannerException {
         String decodeGame = decodeUrlByRegex(
                 assignUrl(gameId, tournamentId, true),
                 getSettings().getGameUrlRegex()
@@ -100,6 +100,11 @@ public class ChessBombScanner extends AbstractSettingsScanner {
         );
     }
 
+    @Override
+    public PGNGame scanUrl(String gameUrl) throws ChessHogScannerException {
+        return null;
+    }
+
     private String decodeUrlByRegex(String url, String regex) throws ChessHogScannerException {
         String encodeString = match(
                 url,