示例#1
0
  protected void changeStatus(BackupStorageStatus status) {
    if (status == self.getStatus()) {
      return;
    }

    BackupStorageStatus oldStatus = self.getStatus();

    self.setStatus(status);
    dbf.update(self);

    BackupStorageStatusChangedData d = new BackupStorageStatusChangedData();
    d.setBackupStorageUuid(self.getUuid());
    d.setNewStatus(status.toString());
    d.setOldStatus(oldStatus.toString());
    d.setInventory(BackupStorageInventory.valueOf(self));
    evtf.fire(BackupStorageCanonicalEvents.BACKUP_STORAGE_STATUS_CHANGED, d);

    logger.debug(
        String.format("change backup storage[uuid:%s] status to %s", self.getUuid(), status));
  }
示例#2
0
 private void handle(final ChangeBackupStorageStatusMsg msg) {
   changeStatus(
       BackupStorageStatus.valueOf(msg.getStatus()),
       new NoErrorCompletion(msg) {
         @Override
         public void done() {
           ChangeBackupStorageStatusReply reply = new ChangeBackupStorageStatusReply();
           bus.reply(msg, reply);
         }
       });
 }