Esempio n. 1
0
        public void TranslateExternalUnDeleteCommandToAkkaMessage(HTTPSourcedCommand cmdExternal)
        {
            JObject jo = cmdExternal.Data as JObject;
            string  id = jo.Value <string>("Id") ?? jo.Value <string>("id");
            ClientUnDeleteCommand deleteCmd = new ClientUnDeleteCommand(id, cmdExternal.User, cmdExternal.ConnectionId);

            SendTo.Tell(deleteCmd, ReplyTo);
        }
Esempio n. 2
0
 private void UnDeleteClientCommand(ClientUnDeleteCommand c)
 {
     if (_ActorState.isActive == true)
     {
         var message = new ClientFailedUnDeleteEvent("Client is already active.", c.Id, c.User, c.ConnectionId);
         Sender.Tell(message, Self);
     }
     else
     {
         // Journal the fact that the client was deleted
         Persist <ClientUnDeleteCommand>(c, PostUnDeleteHandler);
     }
 }
Esempio n. 3
0
        private void PostUnDeleteHandler(ClientUnDeleteCommand c)
        {
            _ActorState.isActive = true;

            // Once a client has been marked as inactive we want to save the state so that future incarnations of the actor will
            // be in a inactive state.
            AutoSaveSnashot(true);
            _logger.Debug($"User:{c.User} undeleted client id:{_ActorState.Id}.");

            ClientUnDeletedEvent message = new ClientUnDeletedEvent(_ActorState.Clone(), c.User, c.ConnectionId);

            Sender.Tell(message, Self);
            NotifyCommandEventSubscribers(message);
        }
Esempio n. 4
0
 private bool UnDeleteClientRecoveryCommand(ClientUnDeleteCommand c)
 {
     _ActorState.isActive = true;
     return(true);
 }