Class AppModel
java.lang.Object
eirb.pub.app.display.javafx.model.AppModel
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a listener for eventvoidaddUserData(UserData userData) Add new password to the vaultvoidaddUserData(UserData userData, String event) Add new password to the vaultvoidclose the vault by unbinding infosvoidcreateEmptyVaultFile(String name, String password) Create an empty VaultFile, and set the plainVault in the modelvoidvoidfirePropertyChange(String propertyName, Object oldValue, Object newValue) Gets the current Custom Password Information.Get the plain vault to show his dataGet parent directory of databaseGet the File of the databaseGet database absolute pathvoidInitializes the Custom Password Information with default values.voidputUserData(UUID userDataID, UserData userData) Edit the UserData with the ID userDataIDvoidRemove the listener to the param pcsvoidStop the automatic synchronizationvoidremoveUserData(UUID userDataID) Remove the UserData with the ID userDataIDvoidSave the databasevoidsetCustomPassInfos(CustomPasswordData customizer) Sets the Custom Password Information.voidsetPlainVault(String password) Set the plain vault in modelvoidsetServerAuth(ServerAuthentication servAut) Set the server authenticationvoidsetServerURL(URL serverURL) voidsetSync()Instance the Synchronisation objectvoidsetVaultDir(Path newDir) Set parent directory of databasevoidsetVaultFile(VaultFile newVaultFile) voidsetVaultFile(Path newVaultFile) Set the new vault file and path to itvoidsetVaultPath(Path newPath) Set database absolute path (/directory/file.dbx.json)shareUserData(UserData userData, ServerUser receiver) voidManually synchronize the vault with the server
-
Field Details
-
DEFAULT_SERVER_URL
- See Also:
-
-
Constructor Details
-
AppModel
public AppModel()
-
-
Method Details
-
getServerURL
-
setServerURL
-
getVaultFile
Get the File of the database- Returns:
- the File of the database
-
firePropertyChange
-
setVaultFile
Set the new vault file and path to it- Parameters:
newVaultFile- the new file of the database- Throws:
VaultFileIOException- If the read of the file failedVaultFileFormatException- If the format of the file is incorrect
-
setVaultFile
-
setPlainVault
public void setPlainVault(String password) throws PasswordException, CipherVaultException, IOException Set the plain vault in model- Parameters:
password- the password of the database selected- Throws:
PasswordException- if it's the wrong password throw errorCipherVaultException- if an error occurred in the cipherVault decryptionIOException
-
createEmptyVaultFile
public void createEmptyVaultFile(String name, String password) throws VaultFileGenerationException, PasswordException, CipherVaultException, IOException Create an empty VaultFile, and set the plainVault in the model- Parameters:
name- the name of the databasepassword- the password of the database selected- Throws:
VaultFileGenerationException- if the generation of an empty file failedPasswordExceptionCipherVaultExceptionIOException
-
getPlainVault
Get the plain vault to show his data- Returns:
- the plain vault
-
setVaultPath
Set database absolute path (/directory/file.dbx.json)- Parameters:
newPath- new path
-
getVaultPath
Get database absolute path- Returns:
- actual absolute path
-
setVaultDir
Set parent directory of database- Parameters:
newDir- new parent directory
-
getVaultDir
Get parent directory of database- Returns:
- actual parent directory
-
saveToPath
Save the database- Throws:
VaultFileIOException- if it can't save it because of a IO errorVaultFileFormatException- if the format of the file provided is wrong
-
addUserData
Add new password to the vault- Parameters:
userData- UserData to add- Throws:
VaultOperationException- if an error during the operation
-
addUserData
Add new password to the vault- Parameters:
userData- UserData to add- Throws:
VaultOperationException- if an error during the operation
-
putUserData
Edit the UserData with the ID userDataID- Parameters:
userDataID- id of the UserData to changeuserData- new value of the UserData- Throws:
VaultOperationException- if an error during the operation
-
removeUserData
Remove the UserData with the ID userDataID- Parameters:
userDataID- id of the UserData to remove from the vault- Throws:
VaultOperationException- if an error during the operation
-
addPropertyChangeListener
Add a listener for event- Parameters:
listener- who listen event
-
removePropertyChangeListener
Remove the listener to the param pcs- Parameters:
listener- view which implement PropertyChangeListener
-
closeVault
public void closeVault()close the vault by unbinding infos -
initCustomPassInfos
public void initCustomPassInfos()Initializes the Custom Password Information with default values. This method creates a new instance of CustomPasswordData with predefined parameters.The default values are: - Length: 12 - Uppercase: true - Lowercase: true - Digits: true - Special Characters: true
-
setCustomPassInfos
Sets the Custom Password Information. This method allows updating the CustomPasswordData instance with a new custom configuration.- Parameters:
customizer- A CustomPasswordData object that contains the new password customization settings.
-
getCustomPassInfos
Gets the current Custom Password Information. This method returns the CustomPasswordData object that holds the current settings for the custom password generation.- Returns:
- The current CustomPasswordData instance.
-
createExtensionServer
- Throws:
IOException
-
setServerAuth
Set the server authentication- Parameters:
servAut- the server authentication
-
getAuthenticatedUser
-
getServerAuth
-
getServerVault
-
setSync
public void setSync()Instance the Synchronisation object -
removeSync
public void removeSync()Stop the automatic synchronization -
synchronizeVault
public void synchronizeVault() throws ForbiddenAccessException, AuthenticationException, VaultUpdateException, IOException, TimeoutExceptionManually synchronize the vault with the server- Throws:
ForbiddenAccessException- if the user doesn't have access to the serverAuthenticationException- if the authentication failedVaultUpdateException- if the update of the vault failedIOException- if an IO error occurredTimeoutException
-