public void onError(MamaSubscription subscription, MamaStatus.mamaStatus status, string subject) { Console.WriteLine("Subscription error:" + subject); }
public void onError(MamaSubscription subscription, MamaStatus.mamaStatus status, string subject) { stats.mErrorCount++; }
public void onError( MamaSubscription subscription, MamaStatus.mamaStatus status, string subject) { MamdaErrorSeverity severity = MamdaErrorSeverity.MAMDA_SEVERITY_OK; MamdaErrorCode code = MamdaErrorCode.MAMDA_NO_ERROR; switch (status) { case MamaStatus.mamaStatus.MAMA_STATUS_BAD_SYMBOL: severity = MamdaErrorSeverity.MAMDA_SEVERITY_HIGH; code = MamdaErrorCode.MAMDA_ERROR_BAD_SYMBOL; break; case MamaStatus.mamaStatus.MAMA_STATUS_TIMEOUT: severity = MamdaErrorSeverity.MAMDA_SEVERITY_HIGH; code = MamdaErrorCode.MAMDA_ERROR_TIMEOUT; break; case MamaStatus.mamaStatus.MAMA_STATUS_NOT_ENTITLED: severity = MamdaErrorSeverity.MAMDA_SEVERITY_HIGH; code = MamdaErrorCode.MAMDA_ERROR_NOT_ENTITLED; break; case MamaStatus.mamaStatus.MAMA_STATUS_NOT_FOUND: severity = MamdaErrorSeverity.MAMDA_SEVERITY_HIGH; code = MamdaErrorCode.MAMDA_ERROR_NOT_FOUND; break; case MamaStatus.mamaStatus.MAMA_STATUS_NO_SUBSCRIBERS: severity = MamdaErrorSeverity.MAMDA_SEVERITY_HIGH; code = MamdaErrorCode.MAMDA_ERROR_NO_SUBSCRIBERS; break; case MamaStatus.mamaStatus.MAMA_STATUS_EXPIRED: severity = MamdaErrorSeverity.MAMDA_SEVERITY_HIGH; code = MamdaErrorCode.MAMDA_ERROR_EXPIRED; break; case MamaStatus.mamaStatus.MAMA_STATUS_NOT_PERMISSIONED: severity = MamdaErrorSeverity.MAMDA_SEVERITY_HIGH; code = MamdaErrorCode.MAMDA_ERROR_NOT_PERMISSIONED; break; case MamaStatus.mamaStatus.MAMA_STATUS_BANDWIDTH_EXCEEDED: severity = MamdaErrorSeverity.MAMDA_SEVERITY_HIGH; code = MamdaErrorCode.MAMDA_ERROR_BANDWIDTH_EXCEEDED; break; case MamaStatus.mamaStatus.MAMA_STATUS_DELETE: severity = MamdaErrorSeverity.MAMDA_SEVERITY_HIGH; code = MamdaErrorCode.MAMDA_ERROR_DELETE; break; case MamaStatus.mamaStatus.MAMA_STATUS_PLATFORM: default: severity = MamdaErrorSeverity.MAMDA_SEVERITY_HIGH; code = MamdaErrorCode.MAMDA_ERROR_PLATFORM_STATUS; break; } for (int i=0;i<mSubscription.mErrorListeners.Count;i++) { MamdaErrorListener listener = (MamdaErrorListener) mSubscription.mErrorListeners[i]; listener.onError( mSubscription, severity, code, MamdaErrorCodes.stringForMamdaError(code)); } }
public void onError(MamaSubscription subscription, MamaStatus.mamaStatus status, string subject) { Console.WriteLine("Error creating subscription: {0}", MamaStatus.stringForStatus(status)); Exit(1); }
public void onSendComplete( MamaPublisher publisher, MamaMsg message, MamaStatus.mamaStatus status, object closure) { message.destroy(); }
/// <summary> /// Return status code as a string /// </summary> public static string stringForStatus (MamaStatus.mamaStatus status) { return String.Format("mamaStatus: ({0})", status); }
/*Invoked if any errors are encountered during subscription processing*/ public void onError(MamaSubscription subscription, MamaStatus.mamaStatus status, string subject) { Console.WriteLine ("Symbol=[" + subscription.subscSymbol + "] : " + "An error occurred creating subscription: " + MamaStatus.stringForStatus (status)); }
/// <summary> /// Constructs a new MamaException with the specified status code. /// Automatically populates the textual description of the error. /// </summary> /// <param name="status">the MAMA status code</param> public MamaException(MamaStatus.mamaStatus status) : this(status, MamaStatus.stringForStatus(status)) { }
public void onError(MamaPublisher publisher, MamaStatus.mamaStatus status, string topic) { Console.WriteLine("onPublishError: " + topic + " " + status.ToString()); }
public void onError(MamaInbox inbox, MamaStatus.mamaStatus status) { Console.WriteLine("Error creating inbox: {0}", MamaStatus.stringForStatus(status)); Exit(1); }
public void onError( MamaSubscription subscription, MamaStatus.mamaStatus status, string subject) { MamdaErrorSeverity severity = MamdaErrorSeverity.MAMDA_SEVERITY_OK; MamdaErrorCode code = MamdaErrorCode.MAMDA_NO_ERROR; string errStr = "unknown"; switch (status) { case MamaStatus.mamaStatus.MAMA_STATUS_BAD_SYMBOL: severity = MamdaErrorSeverity.MAMDA_SEVERITY_HIGH; code = MamdaErrorCode.MAMDA_ERROR_BAD_SYMBOL; errStr = "bad symbol"; break; case MamaStatus.mamaStatus.MAMA_STATUS_TIMEOUT: severity = MamdaErrorSeverity.MAMDA_SEVERITY_HIGH; code = MamdaErrorCode.MAMDA_ERROR_TIMEOUT; errStr = "timeout"; break; case MamaStatus.mamaStatus.MAMA_STATUS_NOT_ENTITLED: severity = MamdaErrorSeverity.MAMDA_SEVERITY_HIGH; code = MamdaErrorCode.MAMDA_ERROR_NOT_ENTITLED; errStr = "entitlement"; break; case MamaStatus.mamaStatus.MAMA_STATUS_NOT_FOUND: severity = MamdaErrorSeverity.MAMDA_SEVERITY_LOW; code = MamdaErrorCode.MAMDA_ERROR_NOT_FOUND; errStr = "not found"; break; default: break; } for (int i=0;i<mSubscription.mErrorListeners.Count;i++) { MamdaErrorListener listener = (MamdaErrorListener) mSubscription.mErrorListeners[i]; listener.onError( mSubscription, severity, code, MamdaErrorCodes.stringForMamdaError(code)); } }
/// <summary> /// Constructs a new MamaException with the specified status code /// and a custom error message. /// </summary> /// <param name="status">the MAMA status code</param> /// <param name="message">the custom error message</param> public MamaException(MamaStatus.mamaStatus status, string message) : base(message != null ? message : String.Empty) { this.mStatus = status; }
/// <summary> /// Handler is called whenever mama_start completes, /// </summary> /// <param name="status"> /// The status returned from mama_start. /// </param> internal void onStartBackgroundCompleted(MamaStatus.mamaStatus status) { // Invoke the callback function if (mCallback != null) { // Create a new mama status using the data passed in mCallback.onStartComplete(status); } }
/// <summary> /// Called when an error has occurred with the subscription /// </summary> /// <param name="subscription"> /// The subscription where the error has been detected. /// </param> /// <param name="status"> /// The status code associated with the error. /// </param> /// <param name="subject"> /// The subject for entitlement errors. /// </param> void MamaBasicSubscriptionCallback.onError(MamaBasicSubscription subscription, MamaStatus.mamaStatus status, string subject) { if (mCallback != null) { mCallback.onError((MamaSubscription)subscription, status, subject); } }