Example #1
0
        /// <summary>
        /// Process the projection asynchronously and return the end state of the projection
        /// </summary>
        /// <param name="projectionToProcess">
        /// The projection to run
        /// </param>
        /// <returns>
        /// The sequence number up until which the projection was run
        /// </returns>
        public async Task <IProjectionResponse> ProcessAsync(IProjectionUntyped projectionToProcess,
                                                             OrchestrationCallbackIdentity responseSource = null)
        {
            await  Process(projectionToProcess);

            return(ProjectionResponse.Create(projectionToProcess, responseSource));
        }
Example #2
0
 public async Task  Process(IProjectionUntyped projectionToProcess)
 {
     if (null != _projectionProcessor)
     {
         await _projectionProcessor.Process(projectionToProcess);
     }
 }
        /// <summary>
        /// Classify whether the aggregate instance is inside or outside the group as determined by the classifier
        /// </summary>
        /// <param name="classifierToProcess">
        /// The class containing the classifier logic to run
        /// </param>
        /// <param name="effectiveDateTime">
        /// The time as-of which to ge the classificiation (or if null, get the latest possible )
        /// </param>
        /// <param name="forceExclude">
        /// If set, consider anything not classified as included to be excluded
        /// </param>
        /// <param name="projection">
        /// If set and the classification depends on the result of a projection use the projection
        /// </param>
        public async Task <IClassifierDataSourceHandler.EvaluationResult> Classify(IClassifierUntyped classifierToProcess = null,
                                                                                   DateTime?effectiveDateTime             = null,
                                                                                   bool forceExclude             = false,
                                                                                   IProjectionUntyped projection = null)
        {
            _classifierProcessor = CQRSAzure.IdentifierGroup.Azure.Blob.AzureBlobClassifierUntyped.CreateClassifierProcessor(new ClassifierAttribute(_domainName,
                                                                                                                                                     _aggregateTypeName,
                                                                                                                                                     _aggregateInstanceKey,
                                                                                                                                                     _classifierTypeName),
                                                                                                                             classifierToProcess,
                                                                                                                             ConnectionStringNameAttribute.DefaultBlobStreamSettings(_domainName, _aggregateTypeName));

            if (null != _classifierProcessor)
            {
                return(await _classifierProcessor.Classify(classifierToProcess,
                                                           effectiveDateTime,
                                                           forceExclude,
                                                           projection));
            }
            else
            {
                if (forceExclude)
                {
                    return(IClassifierDataSourceHandler.EvaluationResult.Exclude);
                }
                else
                {
                    return(IClassifierDataSourceHandler.EvaluationResult.Unchanged);
                }
            }
        }
 public IClassifierDataSourceHandler.EvaluationResult Classify(IClassifierUntyped classifierToProcess = null,
                                                               DateTime?effectiveDateTime             = null,
                                                               bool forceExclude             = false,
                                                               IProjectionUntyped projection = null)
 {
     throw new NotImplementedException();
 }
Example #5
0
 public static ProjectionResponse Create(IProjectionUntyped projectionRun,
                                         OrchestrationCallbackIdentity responseSource = null)
 {
     return(new ProjectionResponse(projectionRun.CurrentAsOfDate,
                                   (int)projectionRun.CurrentSequenceNumber,
                                   GetValuesAsArray(projectionRun.CurrentValues),
                                   responseSource));
 }
Example #6
0
        /// <summary>
        /// Classify whether the aggregate instance is inside or outside the group as determined by the type of classifier
        /// </summary>
        /// <typeparam name="TClassifier">
        /// The type of the class containing the classifier logic to run
        /// </typeparam>
        /// <param name="effectiveDateTime">
        /// The time as-of which to ge the classificiation (or if null, get the latest possible )
        /// </param>
        /// <param name="forceExclude">
        /// If set, consider anything not classified as included to be excluded
        /// </param>
        /// <param name="projection">
        /// If set and the classification depends on the result of a projection use the projection
        /// </param>
        public async Task <IClassifierDataSourceHandler.EvaluationResult> Classify <TClassifier>(DateTime?effectiveDateTime    = null,
                                                                                                 bool forceExclude             = false,
                                                                                                 IProjectionUntyped projection = null) where TClassifier : IClassifierUntyped, new()
        {
            IClassifierUntyped classifierToProcess = new TClassifier();

            if (null != classifierToProcess)
            {
                return(await Classify(classifierToProcess,
                                      effectiveDateTime,
                                      forceExclude, projection));
            }
            else
            {
                return(await Task.FromResult(IClassifierDataSourceHandler.EvaluationResult.Unchanged));
            }
        }