public void Post([FromBody]IEnumerable<BackupJob> jobs)
 {
     jobs.ToList().ForEach(job =>
     {              
         var performBackupCommand = new PerformBackupCommand();
         performBackupCommand.Id = job.Id;
         performBackupCommand.SourcePath = job.SourcePath;
         performBackupCommand.DestinationPath = job.DestinationPath;
         performBackupCommand.SourceCredential = new User { UserId = job.SourceUser.UserId, Password = job.SourceUser.Password, Domain = "ds" };
         performBackupCommand.DestinationCredential = new User { UserId = job.DestinationUser.UserId, Password = job.DestinationUser.Password, Domain = "ds" };
         bus.Send("LANBackupSystem.ClientService", performBackupCommand);
     });
 }             
Example #2
0
 static void Start(IBus bus)
 {           
     Console.WriteLine("Press 'Enter' to publish a message.To exit, Ctrl + C");
     while (true)
     {
         ConsoleKeyInfo key = Console.ReadKey();
         var performBackupCommand = new PerformBackupCommand();
         performBackupCommand.Id = Guid.NewGuid();
         performBackupCommand.SourcePath = @"\\192.168.0.143\ToShare\source";
         performBackupCommand.DestinationPath = @"\\192.168.0.143\ToShare\dest";
         performBackupCommand.SourceCredential = new Domain.User { UserId = "palania", Password = "******", Domain = "ds" };
         performBackupCommand.DestinationCredential = new Domain.User { UserId = "palania", Password = "******", Domain = "ds" };
         bus.Send("LANBackupSystem.ClientService", performBackupCommand);
         Console.WriteLine("Command sent");
     }
 }
 public BackupStatusNotifier(IBus bus, PerformBackupCommand command)
 {
     this.bus = bus;
     this.command = command;
 }
Example #4
0
 public Backupper(IBus bus,PerformBackupCommand command)
 {
     this.notifier = new BackupStatusNotifier(bus,command);
     this.command = command;
 }