bootstrapP
Interface BackupperInterface

All Known Implementing Classes:
FileBackupper

public interface BackupperInterface

This interface represents a general backupper, witch may be a file backupper, a remote backupper, a RAID-like backupper, or any other kind of service to permanently store datas.

Author:
Marco Cornolti

Method Summary
 void backupMs(ManagedMessageServer ms)
          Backup a single server data.
 void backupUser(RegisteredUser reg)
          Backup a single user data.
 void backupWholeData(java.util.List<RegisteredUser> rUsers, java.util.List<ManagedMessageServer> mMss)
          Backups the whole data given by argument replacing completely the previous backups.
 void removeBackuppedMs(ManagedMessageServer ms)
          Remove a server contained in the backup.
 void removeBackuppedUser(RegisteredUser reg)
          Remove a user contained in the backup.
 int restoreData(java.util.List<RegisteredUser> restoredUsers, java.util.List<ManagedMessageServer> restoredMss)
           
 

Method Detail

backupWholeData

void backupWholeData(java.util.List<RegisteredUser> rUsers,
                     java.util.List<ManagedMessageServer> mMss)
                     throws java.io.IOException
Backups the whole data given by argument replacing completely the previous backups.

Parameters:
rUsers - the list of registered users to backup.
mMss - the list of managed message servers to backup.
Throws:
java.io.IOException - if an Input/Output problem occurred.

restoreData

int restoreData(java.util.List<RegisteredUser> restoredUsers,
                java.util.List<ManagedMessageServer> restoredMss)
                throws java.io.IOException,
                       java.lang.ClassNotFoundException,
                       java.io.InvalidClassException,
                       java.io.StreamCorruptedException,
                       java.io.OptionalDataException,
                       java.lang.IllegalArgumentException
Parameters:
restoredUsers - a list where the restored users data must be copied to.
restoredMss - a list where the restored servers data must be copied to.
Returns:
the number of read datas (message servers + users).
Throws:
java.io.IOException - if an Input/Output problem occurred.
java.lang.ClassNotFoundException - if a version compatibility problem occurred.
java.io.InvalidClassException - if a version compatibility problem occurred.
java.io.StreamCorruptedException - if the input stream could not be read.
java.io.OptionalDataException - if the backupped datas were not expected.
java.lang.IllegalArgumentException - if the lists given by argument are null or not empty.

backupUser

void backupUser(RegisteredUser reg)
                throws java.io.IOException,
                       java.io.FileNotFoundException
Backup a single user data.

Parameters:
reg - the user whose data must be backupped.
Throws:
java.io.IOException - if an error occured while writing.
java.io.FileNotFoundException

backupMs

void backupMs(ManagedMessageServer ms)
              throws java.io.IOException
Backup a single server data.

Parameters:
ms - the server whose data must be backupped.
Throws:
java.io.IOException - if an error occured while writing.

removeBackuppedUser

void removeBackuppedUser(RegisteredUser reg)
                         throws java.io.IOException
Remove a user contained in the backup.

Parameters:
reg - the user to remove.
Throws:
java.io.IOException - if an InputOutput exception occurred.

removeBackuppedMs

void removeBackuppedMs(ManagedMessageServer ms)
                       throws java.io.IOException
Remove a server contained in the backup.

Parameters:
ms - the server to remove.
Throws:
java.io.IOException - if an InputOutput exception occurred.