com.h3c.sdn.adm.backup

## Class BackupServer

- java.lang.Object
- - com.h3c.sdn.adm.backup.BackupServer

-     public class BackupServer
      extends Object

  Backup server class providing all the business logic to perform backup, restore, download and upload operation. 1. Backup flare controller system 2. Check the backup status using the backup session identifier 3. Restore flare controller system 4. Get the last restore information from the controller system 5. Upload backup file to the controller system 6. Download backup file from the controller system

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BackupServer(AuditLogService auditLogService, TaskExecutorService taskExecService, AdminRest adminRestClient, SystemInformationService systemInfoService)` BackupServer constructor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `File` | `downloadBackup(String backupFolder, boolean csum, Authentication auth)` Method to download the backup file from the controller.
    `BackupStatus` | `getBackupStatus(Token token, String fileLoc, Authentication auth)` Method to query the backup status.
    `BackupInformation` | `getLastRestoreInformation(String fileLoc, Authentication auth)` Get last restore information.
    `Token` | `startSystemBackup(Authentication auth)` Backup controller system artifacts.
    `Token` | `startSystemRestore(String backupFolder, Authentication auth)` Method for Restore of a backup file.
    `void` | `uploadBackup(String fileName, InputStream in, String uploadFolder, Authentication auth)` Method to upload the backup file to the controller.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### BackupServer

          public BackupServer(AuditLogService auditLogService,
                      TaskExecutorService taskExecService,
                      AdminRest adminRestClient,
                      SystemInformationService systemInfoService)

      BackupServer constructor.
      Parameters:
        `auditLogService` - the audit log service handle
        `taskExecService` - the task executor handle
        `adminRestClient` - the admin rest handle
        `systemInfoService` - system information service handle

  - ### Method Detail

    - #### startSystemBackup

          public Token startSystemBackup(Authentication auth)

      Backup controller system artifacts.
      Parameters:
        `auth` - the authentication record for the user that invoked this method
      Returns:
        Token instance

    - #### getBackupStatus

          public BackupStatus getBackupStatus(Token token,
                                     String fileLoc,
                                     Authentication auth)

      Method to query the backup status.
      Parameters:
        `token` - the token/session id string
        `fileLoc` - the backup status file location
        `auth` - the authentication record for the user that invoked this method
      Returns:
        the backup status of the last backup session

    - #### downloadBackup

          public File downloadBackup(String backupFolder,
                            boolean csum,
                            Authentication auth)

      Method to download the backup file from the controller.
      Parameters:
        `backupFolder` - the backup folder location
        `csum` - set to true to download the checksum
        `auth` - the authentication record for the user that invoked this method
      Returns:
        the backup/checksum file

    - #### uploadBackup

          public void uploadBackup(String fileName,
                          InputStream in,
                          String uploadFolder,
                          Authentication auth)

      Method to upload the backup file to the controller.
      Parameters:
        `fileName` - the upload file name
        `in` - the input stream
        `uploadFolder` - the upload folder
        `auth` - the authentication record for the user that invoked this method

    - #### startSystemRestore

          public Token startSystemRestore(String backupFolder,
                                 Authentication auth)

      Method for Restore of a backup file.
      Parameters:
        `backupFolder` - the folder where backup file is present
        `auth` - the authentication record for the user that invoked this method
      Returns:
        restore token

    - #### getLastRestoreInformation

          public BackupInformation getLastRestoreInformation(String fileLoc,
                                                    Authentication auth)

      Get last restore information.
      Parameters:
        `fileLoc` - the location of info file
        `auth` - the authentication record for the user that invoked this method
      Returns:
        BackupInformation

Copyright © 2014. All Rights Reserved.