コード例 #1
0
        public bool TranslateAkkaUnDeleteEventToExternalMessage(CommandEventMessage internalCommandEvent)
        {
            UserUnDeletedEvent e = internalCommandEvent as UserUnDeletedEvent;

            HTTPExternalInterface.HandleEDStateMessage(
                new HTTPDestinedCommandStateEvent(
                    MicroServices.ProcessingStatus.Processed,
                    e.Message,
                    new HTTPSourcedCommand(
                        e.CommandType.ToString(),
                        e.Area.ToString(),
                        null,
                        e.ResultUserState,
                        e.User,
                        e.ConnectionId,
                        e.Id
                        )
                    ),
                false //User only?
                );
            return(true);
        }
コード例 #2
0
        /// <summary>
        /// Removes User(item) from the list.  If an instance of the UserActor is in memory it unloads it.
        /// </summary>
        /// <param name="e"></param>
        /// <returns></returns>
        private void HandleUserUnDeletedEvent(UserUnDeletedEvent e)
        {
            // Is the item still in the list?
            if (_ActorState[e.Id] == null)
            {
                _logger.Info($"{e.User} tried undeleting from User list id:{e.Id} but was not found.");
            }
            else
            {
                UserListItem cliNewState = _ActorState[e.Id].Copy();
                cliNewState.IsActive = true;

                // Memorialize that we are recovering the item from the list in the journal
                UserListUnDeleteCommand UserListUnDeleteCommand = new UserListUnDeleteCommand(
                    cliNewState,
                    e.User,
                    e.ConnectionId);

                _logger.Info($"Undeleting User list item Id{e.Id} UserName:{e.ResultUserState.UserName}.");
                Persist <UserListUnDeleteCommand>(UserListUnDeleteCommand, PostUserListUnDeleteHandler);
            }
        }