|
- package altk.comm.engine.exception;
-
-
- @SuppressWarnings("serial")
- public class BroadcastException extends EngineException
- {
- public final BroadcastError errorCode;
-
- public BroadcastException(BroadcastError errorCode, String errorText)
- {
- this(errorCode, errorText, null);
- }
-
- public BroadcastException(BroadcastError errorCode, String errorText, Throwable t)
- {
- super(errorCode.toString(), errorText, t);
- this.errorCode = errorCode;
- }
-
- /*
- public BroadcastException(Broadcast broadcast, BroadcastError errorCode, String errorText)
- {
- this(broadcast.broadcastName, broadcast.broadcastId, errorCode, errorText);
- }
-
- public BroadcastException(String broadcastName, String broadcastId,
- BroadcastError errorCode, String errorText)
- {
- this(broadcastName, broadcastId, errorCode, errorText, null);
- }
-
- public BroadcastException(Broadcast broadcast, BroadcastError errorCode, String errorText, Throwable t)
- {
- this(broadcast.broadcastName, broadcast.broadcastId, errorCode, errorText, t);
- }
-
- public BroadcastException(String broadcastName, String broadcastId,
- BroadcastError errorCode, String errorText, Throwable t)
- {
- super(errorCode.toString() + ": " + errorText, t);
- this.broadcastName = broadcastName;
- this.broadcastId = broadcastId;
- this.errorCode = errorCode;
- this.errorText = errorText;
- }
-
- public String mkResponseXML()
- {
- StringBuffer responseXML = new StringBuffer("<" + broadcastName + "_response");
- if (broadcastId != null && broadcastId.length() > 0)
- {
- responseXML.append(" broadcast_id=\"");
- responseXML.append(broadcastId);
- responseXML.append("\"");
- }
- if (errorCode != null)
- {
- responseXML.append(" error=\"");
- responseXML.append(errorCode.toString());
- responseXML.append("\"");
- if (errorText != null)
- {
- responseXML.append("><error_text>");
- responseXML.append(errorText);
- responseXML.append("</error_text></" + broadcastName + "_response>");
- }
- else
- {
- responseXML.append("/>");
- }
- }
- return responseXML.toString();
- }
- */
-
- }
|