/** * Copyright © 2013 Titan Framework. All Rights Reserved. * * Developed by Laboratory for Precision Livestock, Environment and Software Engineering (PLEASE Lab) * of Embrapa Beef Cattle at Campo Grande - MS - Brazil. * * @see http://please.cnpgc.embrapa.br * * @author Camilo Carromeu * @author Jairo Ricardes Rodrigues Filho * * @version -1-alpha */ package .ws; import org.apache.http.HttpResponse; import .exception.TechnicalException; import .util.HttpHelper; import .util.WebServiceHelper; public class WebService { private HttpResponse response; public WebService () {} public String list (long time) { try { response = WebServiceHelper.singleton ().get ("/getName () ?>/list/" + time); return HttpHelper.getResponseContentString (response); } catch (TechnicalException e) { throw e; } catch (Exception e) { throw new TechnicalException ("Problemas técnicos na autenticação!", e); } } public static String active () { try { return HttpHelper.getResponseContentString (WebServiceHelper.singleton ().get ("/getName () ?>/active")); } catch (TechnicalException e) { throw e; } catch (Exception e) { throw new TechnicalException ("Problemas técnicos na autenticação!", e); } } public long getServerTime () { return WebServiceHelper.singleton ().getServerTime (response); } }