PageRenderTime 45ms CodeModel.GetById 38ms RepoModel.GetById 1ms app.codeStats 0ms

/src/mpv5/webshopinterface/wsdjobs/newSystemMessages.java

http://mp-rechnungs-und-kundenverwaltung.googlecode.com/
Java | 77 lines | 32 code | 15 blank | 30 comment | 0 complexity | d66de7bf44d5da515f4842b1dafdacd7 MD5 | raw file
Possible License(s): LGPL-3.0, Apache-2.0, GPL-3.0, GPL-2.0, AGPL-3.0, JSON, BSD-3-Clause
  1. /*
  2. * This file is part of YaBS.
  3. *
  4. * YaBS is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation, either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * YaBS is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with YaBS. If not, see <http://www.gnu.org/licenses/>.
  16. */
  17. package mpv5.webshopinterface.wsdjobs;
  18. //~--- non-JDK imports --------------------------------------------------------
  19. import mpv5.logging.Log;
  20. import mpv5.webshopinterface.WSConnectionClient;
  21. import mpv5.webshopinterface.WSDaemon;
  22. import mpv5.webshopinterface.WSDaemonJob;
  23. import org.apache.xmlrpc.XmlRpcException;
  24. /**
  25. * This job tries to fetch new msgs
  26. */
  27. public class newSystemMessages implements WSDaemonJob {
  28. private final WSDaemon daemon;
  29. /**
  30. * Create a new job
  31. * @param ddaemon
  32. */
  33. public newSystemMessages(WSDaemon ddaemon) {
  34. this.daemon = ddaemon;
  35. }
  36. @Override
  37. public boolean isOneTimeJob() {
  38. return false;
  39. }
  40. @Override
  41. public boolean isDone() {
  42. return false;
  43. }
  44. @Override
  45. public void work(WSConnectionClient client) {
  46. Object itd = "0";
  47. try {
  48. Object d =
  49. client.getClient().invokeGetCommand(WSConnectionClient.COMMANDS.GET_NEW_SYSTEM_MESSAGES.toString(),
  50. new Object[] { itd }, new Object());
  51. Log.Debug(this, d);
  52. // List<ItemMessage> obs = WSIManager.createObjects(d, new ItemMessage());
  53. //
  54. // for (ItemMessage itemMessage : obs) {
  55. // Popup.notice(itemMessage);
  56. // }
  57. } catch (XmlRpcException ex) {
  58. Log.Debug(this, ex.getMessage());
  59. }
  60. }
  61. }
  62. //~ Formatted by Jindent --- http://www.jindent.com