private void HandleConstructSqlQueryMessage(HeliumConstructSqlQueryMessage requestMessage)
        {
            ActorLogger.Log(LogLevel.InfoLevel, $"Constructing {requestMessage.HeliumAction} SQL Query for {requestMessage.DataModel.GetType().Name}");

            var sqlQuery      = ConstructSelectStatement(requestMessage.DataModel);
            var resultMessage = new HeliumConstructSqlQueryResultMessage(requestMessage.HeliumAction, sqlQuery);

            resultMessage.AddStateData(requestMessage.MessageStateData);

            Sender.Tell(resultMessage, Self);
        }
        /// <summary>
        /// Helium File Connection String Actor constructor
        /// </summary>
        /// <param name="databaseSettings"></param>
        public HeliumFileConnectionStringActor(IThuriaDatabaseSettings databaseSettings)
        {
            if (databaseSettings == null)
            {
                throw new ArgumentNullException(nameof(databaseSettings));
            }

            Receive <HeliumGetConnectionStringMessage>(message =>
            {
                var connectionString = databaseSettings.GetConnectionString(message.DbContextName);
                ActorLogger.Log(LogLevel.InfoLevel, $"Retrieved Connection String Context: {message.DbContextName} String: {connectionString}");

                var resultMessage = new HeliumGetConnectionStringResultMessage(connectionString);
                resultMessage.AddStateData(message.MessageStateData);

                Sender.Tell(resultMessage);
            });
        }
Exemple #3
0
 /// <summary>
 /// Unhandled message handler
 /// </summary>
 /// <param name="message"></param>
 protected override void Unhandled(object message)
 {
     ActorLogger.Log(LogLevel.WarningLevel, $"Unhandled message received -> {message}");
     base.Unhandled(message);
 }
Exemple #4
0
 private void HandleHeliumAction(HeliumActionMessage actionMessage)
 {
     ActorLogger.Log(LogLevel.InfoLevel, $"Starting Helium Action : {actionMessage.HeliumAction}");
     StartHeliumActionProcessing(actionMessage);
 }
Exemple #5
0
        /// <summary>
        /// Make sre the actor is in a state to Perform the required action
        /// </summary>
        protected virtual void ReadyToPerformAction()
        {
            ActorLogger.Log(LogLevel.InfoLevel, $"Helium Actor ready to process {HeliumAction} Action");

            Receive <HeliumActionMessage>(HandleHeliumAction, message => message.HeliumAction == HeliumAction);
        }