|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectbootstrapP.FileBackupper
public class FileBackupper
An implementation of a backupper that works on a single file.
Field Summary | |
---|---|
private java.io.File |
bkFile
|
Constructor Summary | |
---|---|
FileBackupper(java.lang.String backupFilePath)
The file backupper constructor. |
Method Summary | |
---|---|
void |
backupMs(ManagedMessageServer ms)
Backup a single server data. |
void |
backupSingleData(java.lang.Object obj,
boolean remove)
Backups or removes a single data from the file. |
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. |
java.lang.String |
getFilename()
Get the file name of the backupper. |
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)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.io.File bkFile
Constructor Detail |
---|
public FileBackupper(java.lang.String backupFilePath)
backupFilePath
- the file path to backup the data to.Method Detail |
---|
public java.lang.String getFilename()
public void backupWholeData(java.util.List<RegisteredUser> rUsers, java.util.List<ManagedMessageServer> mMss) throws java.io.IOException
BackupperInterface
backupWholeData
in interface BackupperInterface
rUsers
- the list of registered users to backup.mMss
- the list of managed message servers to backup.
java.io.IOException
- if an Input/Output problem occurred.public void backupSingleData(java.lang.Object obj, boolean remove) throws java.io.IOException
obj
- the object to backup.remove
- true if the object must be removed from the backup file, false if the object must be saved.
java.io.IOException
- if an Input/Output problem occurred.public void backupMs(ManagedMessageServer ms) throws java.io.IOException
BackupperInterface
backupMs
in interface BackupperInterface
ms
- the server whose data must be backupped.
java.io.IOException
- if an error occured while writing.public void backupUser(RegisteredUser reg) throws java.io.IOException
BackupperInterface
backupUser
in interface BackupperInterface
reg
- the user whose data must be backupped.
java.io.IOException
- if an error occured while writing.public void removeBackuppedMs(ManagedMessageServer ms) throws java.io.IOException
BackupperInterface
removeBackuppedMs
in interface BackupperInterface
ms
- the server to remove.
java.io.IOException
- if an InputOutput exception occurred.public void removeBackuppedUser(RegisteredUser reg) throws java.io.IOException
BackupperInterface
removeBackuppedUser
in interface BackupperInterface
reg
- the user to remove.
java.io.IOException
- if an InputOutput exception occurred.public 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
restoreData
in interface BackupperInterface
restoredUsers
- a list where the restored users data must be copied to.restoredMss
- a list where the restored servers data must be copied to.
java.io.IOException
- if an Input/Output 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.ClassNotFoundException
- if a version compatibility problem occurred.
java.lang.IllegalArgumentException
- if the lists given by argument are null or not empty.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |