public DefaultFtpRequestGeneratorAction(IEventBus eventBus, ActorIdentityWithActionName reponseParserActor, int maxConnectionPool = -1,
                                                IBlobStorageConfiguration blobStorageConfiguration = null,
                                                IServiceConfiguration serviceConfig = null, string ftpDispatcherActorService = null, string sectionName = null)
            : base(eventBus)
        {
            _blobStorageConfiguration = blobStorageConfiguration;
            _serviceConfiguration     = serviceConfig;
            _maxConnectionPool        = maxConnectionPool;

            ReponseParserActor        = reponseParserActor;
            FtpDispatcherActorService = ftpDispatcherActorService;
            SectionKeyName            = (string.IsNullOrEmpty(sectionName)) ? GetType().BaseType?.Name : sectionName;
        }
        /*
         * protected Common.Flow.Flow RegisterFlow(string keyName)
         * {
         *  Flow = BaseDependencyResolver.ResolveFlow(keyName);
         *  if (Flow != null)
         *  {
         *      CurrentRefStep = Flow.GetCurrentStep(CurrentActorServiceWithActorIdNotSpecified);
         *      NextStep = Flow.GetNextStep(CurrentRefStep);
         *      Orders = NextStep.Orders;
         *  }
         *  return Flow;
         * }*/

        /// <summary>
        /// For custom resolve step before going next step
        /// </summary>
        /// <param name="actionName"></param>
        /// <param name="actorId"></param>
        /// <param name="occurrence"></param>
        /// <returns></returns>
        protected Step ResolveStep(string actionName, string actorId = null, int occurrence = 0)
        {
            if (string.IsNullOrEmpty(actionName))
            {
                // if having actorId then need to resolve with the correct id
                ActorIdentityWithActionName actorIdentityWithActionName = CurrentActorIdentityWithName(actionName);
                if (string.IsNullOrEmpty(actorId))
                {
                    actorIdentityWithActionName.ActorId = actorId;
                }

                CurrentRefStep = Flow.GetCurrentStep(actorIdentityWithActionName, true, occurrence);
                NextStep       = Flow.GetNextStep(CurrentRefStep);
                Orders         = NextStep.Orders;
            }
            else // no need action name to resolve
            {
                CurrentRefStep = Flow.GetCurrentStep(CurrentActorServiceWithActorIdNotSpecified);
                NextStep       = Flow.GetNextStep(CurrentRefStep);
                Orders         = NextStep.Orders;
            }
            return(CurrentRefStep);
        }
Esempio n. 3
0
 public DispatchRequest(object requestData, Type typeOfPayload, string domain, ActorIdentityWithActionName responseActor, string dispatchActionName) : base(requestData, typeOfPayload, domain, responseActor, dispatchActionName)
 {
 }
Esempio n. 4
0
 public DispatchRequest(T requestData, string domain, ActorIdentityWithActionName responseActor, string dispatchActionName) : this(requestData, typeof(T), domain, responseActor, dispatchActionName)
 {
 }