Code/SifCommonFramework/Systemic.Sif.Framework/Subscriber/GenericSubscriber.cs
/// <summary>
/// This method is called when a response is received to a request made by the Subscriber.
/// </summary>
/// <param name="data">The data stream containing the SIF Response.</param>
/// <param name="error">Error details (if encountered).</param>
/// <param name="zone">Zone that SIF Response was received.</param>
/// <param name="info">Information on the received message.</param>
This method is called when a response is received to a request made by the Subscriber.
This method is called when a response is received to a request made by the Subscriber .
void IQueryResults.OnQueryResults(IDataObjectInputStream data, SIF_Error error, IZone zone, IMessageInfo info)
        {
            int count = 0;
            if (error != null)
            {
                if (log.IsErrorEnabled) log.Error("An error was received from the provider of " + SifObjectType.Name + ".");
                if (log.IsErrorEnabled) log.Error(error.SIF_Desc + "\r\n" + error.SIF_ExtendedDesc);
                return;
            }
            while (data.Available)
            {
                count++;
                T sifDataObject = (T)data.ReadDataObject();
                if (PreProcessResponse(sifDataObject, zone))
                {
                    ProcessResponse(sifDataObject, zone);
                }
            }
            if (log.IsInfoEnabled) log.Info(count + " total objects received.");
            if (((SifMessageInfo)info).MorePackets)
            {
                if (log.IsInfoEnabled) log.Info("Waiting for more packets...");
            }
            else
            {
                if (log.IsInfoEnabled) log.Info("All requested packets have been received");
            }
        }
void IQueryResults . OnQueryResults ( IDataObjectInputStream data , SIF_Error error , IZone zone , IMessageInfo info ) { int count = 0 ; if ( error != null ) { if ( log . IsErrorEnabled ) log . Error ( " " + SifObjectType . Name + " " ) ; if ( log . IsErrorEnabled ) log . Error ( error . SIF_Desc + " \r \n " + error . SIF_ExtendedDesc ) ; return ; } while ( data . Available ) { count ++ ; T sifDataObject = ( T ) data . ReadDataObject ( ) ; if ( PreProcessResponse ( sifDataObject , zone ) ) { ProcessResponse ( sifDataObject , zone ) ; } } if ( log . IsInfoEnabled ) log . Info ( count + " " ) ; if ( ( ( SifMessageInfo ) info ) . MorePackets ) { if ( log . IsInfoEnabled ) log . Info ( " " ) ; } else { if ( log . IsInfoEnabled ) log . Info ( " " ) ; } }
This method is called when a response is received to a request made by the Subscriber.
This method is called when a response is received to a request made by the Subscriber .
// Before reading data from a SIF Response, first check to see if an error was returned. // The provider returned an error message for this SIF Request. // Now, read each object from the DataObjectInputStream until Available returns false. // Print out the total number of objects recieved. // To determine if you have completed receiving all responses, check the // MorePackets property of the SIFMessageInfo object
data
IDataObjectInputStream
The data stream containing the SIF Response.
The data stream containing the SIF Response .
error
SIF_Error
Error details (if encountered).
Error details ( if encountered ) .
zone
IZone
Zone that SIF Response was received.
Zone that SIF Response was received .
info
IMessageInfo
Information on the received message.
Information on the received message .