PageRenderTime 199ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/javaProject/src/controllers/IndexController.java

https://bitbucket.org/ericson_cepeda/repbiblioteca
Java | 42 lines | 29 code | 10 blank | 3 comment | 1 complexity | e00224242a3361ed99a79b8a534c572b MD5 | raw file
  1. package controllers;
  2. import java.util.ArrayList;
  3. import models.Books;
  4. import scheduler.ControlCargador;
  5. import com.google.gson.JsonObject;
  6. import comparacion.Comparador;
  7. import comparacion.DtoRespuesta;
  8. public class IndexController
  9. {
  10. public static ArrayList<DtoRespuesta> getBook(String title){
  11. Comparador.getInstance( ).resultadoBusqueda( title );
  12. return Comparador.getInstance( ).getRtaLibreria( );
  13. }
  14. public static String getStatistics(){
  15. JsonObject response = Books.getStatistics( );
  16. ControlCargador control;
  17. try
  18. {
  19. control = ControlCargador.getInstance( );
  20. if(!control.estaCorriendo( ))
  21. control.CorrerUnaHora( );
  22. }
  23. catch( Exception e )
  24. {
  25. // TODO Auto-generated catch block
  26. e.printStackTrace();
  27. }
  28. //response.put( "booksQuantity", ser.getObjetoBiblioteca( ).size( ) );
  29. //response.put( "statsDB", connector.getMongoDB( ).getStats( ).toMap( ) );
  30. return response.toString( );
  31. }
  32. }