/javaProject/src/controllers/IndexController.java
Java | 42 lines | 29 code | 10 blank | 3 comment | 1 complexity | e00224242a3361ed99a79b8a534c572b MD5 | raw file
- package controllers;
- import java.util.ArrayList;
- import models.Books;
- import scheduler.ControlCargador;
- import com.google.gson.JsonObject;
- import comparacion.Comparador;
- import comparacion.DtoRespuesta;
- public class IndexController
- {
- public static ArrayList<DtoRespuesta> getBook(String title){
-
- Comparador.getInstance( ).resultadoBusqueda( title );
-
- return Comparador.getInstance( ).getRtaLibreria( );
- }
-
- public static String getStatistics(){
-
- JsonObject response = Books.getStatistics( );
-
- ControlCargador control;
- try
- {
- control = ControlCargador.getInstance( );
- if(!control.estaCorriendo( ))
- control.CorrerUnaHora( );
- }
- catch( Exception e )
- {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- //response.put( "booksQuantity", ser.getObjetoBiblioteca( ).size( ) );
- //response.put( "statsDB", connector.getMongoDB( ).getStats( ).toMap( ) );
-
- return response.toString( );
- }
- }