Imported from dev1.link2tek.net CommEngine.git
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

77 lignes
2.4 KiB

  1. package altk.comm.engine.exception;
  2. @SuppressWarnings("serial")
  3. public class BroadcastException extends EngineException
  4. {
  5. public final BroadcastError errorCode;
  6. public BroadcastException(BroadcastError errorCode, String errorText)
  7. {
  8. this(errorCode, errorText, null);
  9. }
  10. public BroadcastException(BroadcastError errorCode, String errorText, Throwable t)
  11. {
  12. super(errorCode.toString(), errorText, t);
  13. this.errorCode = errorCode;
  14. }
  15. /*
  16. public BroadcastException(Broadcast broadcast, BroadcastError errorCode, String errorText)
  17. {
  18. this(broadcast.broadcastName, broadcast.broadcastId, errorCode, errorText);
  19. }
  20. public BroadcastException(String broadcastName, String broadcastId,
  21. BroadcastError errorCode, String errorText)
  22. {
  23. this(broadcastName, broadcastId, errorCode, errorText, null);
  24. }
  25. public BroadcastException(Broadcast broadcast, BroadcastError errorCode, String errorText, Throwable t)
  26. {
  27. this(broadcast.broadcastName, broadcast.broadcastId, errorCode, errorText, t);
  28. }
  29. public BroadcastException(String broadcastName, String broadcastId,
  30. BroadcastError errorCode, String errorText, Throwable t)
  31. {
  32. super(errorCode.toString() + ": " + errorText, t);
  33. this.broadcastName = broadcastName;
  34. this.broadcastId = broadcastId;
  35. this.errorCode = errorCode;
  36. this.errorText = errorText;
  37. }
  38. public String mkResponseXML()
  39. {
  40. StringBuffer responseXML = new StringBuffer("<" + broadcastName + "_response");
  41. if (broadcastId != null && broadcastId.length() > 0)
  42. {
  43. responseXML.append(" broadcast_id=\"");
  44. responseXML.append(broadcastId);
  45. responseXML.append("\"");
  46. }
  47. if (errorCode != null)
  48. {
  49. responseXML.append(" error=\"");
  50. responseXML.append(errorCode.toString());
  51. responseXML.append("\"");
  52. if (errorText != null)
  53. {
  54. responseXML.append("><error_text>");
  55. responseXML.append(errorText);
  56. responseXML.append("</error_text></" + broadcastName + "_response>");
  57. }
  58. else
  59. {
  60. responseXML.append("/>");
  61. }
  62. }
  63. return responseXML.toString();
  64. }
  65. */
  66. }