Class AppController
java.lang.Object
eirb.pub.app.display.javafx.controller.AppController
-
Constructor Summary
ConstructorsConstructorDescriptionAppController(javafx.stage.Stage stage) Create the controller for the whole application - Create views - Manipulate data -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd the listener to the modelvoidaddUserData(UserData userData) Add new password to the vaultvoidaddUserData(UserData userData, String event) Add new password to the vaultvoidaddUserDataWithUndo(UserData userData) voidclose the vault by unbinding infosvoidcreateEmptyVaultFile(String name, String password) Set the plain vault in modelvoideditUserDataWithUndo(UUID id, UserData oldData, UserData newData) voidfirePropertyChange(String propertyName, Object oldValue, Object newValue) Fires a property change event to notify listeners of changes to a specific property.Retrieves the current custom password information.javafx.stage.StagegetModel()Get the name of the databaseGet the plain vault to show his dataGet parent directory of databaseGet database absolute pathbooleanvoidInitializes the custom password information with default values.booleanisOnline()voidredo()voidRemove the listener to the param pcsvoidvoidremoveUserData(UUID userDataID) Remove the UserData with the ID userDataIDvoidremoveUserDataWithUndo(UserData userInfos) voidSave the databasevoidsetCustomPassInfos(CustomPasswordData customizor) Sets the custom password information using the provided CustomPasswordData object.voidsetOnline(boolean connected) voidsetPlainVault(String password) Set the plain vault in modelvoidsetServerAuth(ServerAuthentication servAut) voidsetSync()voidsetVaultDir(Path newDir) Set parent directory of databasevoidsetVaultFile(VaultFile newVaultFile) voidsetVaultFile(Path newVaultFile) Set a new File of the database and call the listener for "absolutePath"voidsetVaultPath(Path newPath) Set database absolute path (/directory/file.dbx.json)shareUserData(UserData userData, ServerUser receiver) voidCreate a popup on the main windowvoidCreate a popup on the main window for an errorvoidshowHome()Show the view where you can select one of the four method of connection ( CloudConnection / CloudRegister / VaultOpener / VaultFileCreator )voidshowNotification(String content) voidShow the view where you can registervoidvoidshowVaultFileCreator(boolean online) Show the view where you can create a new vaultvoidshowVaultOpener(VaultFile vaultfile, boolean online) Show the view where you can open a local vaultvoidShow the main view of the application with the passwordvoidvoidundo()
-
Constructor Details
-
AppController
public AppController(javafx.stage.Stage stage) Create the controller for the whole application - Create views - Manipulate data- Parameters:
stage- the main window of the application
-
-
Method Details
-
getModel
-
showAlert
Create a popup on the main window- Parameters:
type- Error / Information / Warning / Confirmationtitle- name of the popupmessage- the message in the popup
-
showError
Create a popup on the main window for an error- Parameters:
message- the message in the popup
-
showHome
public void showHome()Show the view where you can select one of the four method of connection ( CloudConnection / CloudRegister / VaultOpener / VaultFileCreator ) -
showVaultFileCreator
public void showVaultFileCreator(boolean online) Show the view where you can create a new vault -
showRegister
public void showRegister()Show the view where you can register -
showVaultViewer
public void showVaultViewer()Show the main view of the application with the password -
showVaultOpener
Show the view where you can open a local vault -
showServerVaultList
public void showServerVaultList() -
getMainWindow
public javafx.stage.Stage getMainWindow() -
setVaultFile
Set a new File of the database and call the listener for "absolutePath"- Parameters:
newVaultFile- the new path of the database- Throws:
VaultFileIOException- IO errorVaultFileFormatException- The format of the provided file is incorrect
-
setVaultFile
-
getNameVault
Get the name of the database- Returns:
- the name of the database
-
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 during the decryption of the CipherVaultIOException
-
getPlainVault
Get the plain vault to show his data- Returns:
- the plain vault
-
createEmptyVaultFile
public void createEmptyVaultFile(String name, String password) throws VaultFileGenerationException, PasswordException, CipherVaultException, IOException Set the plain vault in model- Parameters:
password- the password of the database selected- Throws:
VaultFileGenerationException- if the generation of the file failedPasswordExceptionCipherVaultExceptionIOException
-
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 IO operationVaultFileFormatException- if the format is incorrect
-
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
-
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 the listener to the model- Parameters:
listener- view which implement PropertyChangeListener
-
removePropertyChangeListener
Remove the listener to the param pcs- Parameters:
listener- view which implement PropertyChangeListener
-
closeVault
public void closeVault()close the vault by unbinding infos -
firePropertyChange
Fires a property change event to notify listeners of changes to a specific property. This method is used to propagate property changes to the model so that observers can respond to the change.- Parameters:
propertyName- The name of the property that has changed.oldValue- The previous value of the property.newValue- The new value of the property.
-
initCustomPassInfos
public void initCustomPassInfos()Initializes the custom password information with default values. This method delegates to the model to initialize the custom password settings for the application. -
setCustomPassInfos
Sets the custom password information using the provided CustomPasswordData object. This method delegates to the model to update the custom password settings with the specified configuration.- Parameters:
customizor- A CustomPasswordData object that contains the new password customization settings.
-
getCustomPassInfos
Retrieves the current custom password information. This method delegates to the model to return the current password settings stored in the application.- Returns:
- The current CustomPasswordData instance.
-
addUserDataWithUndo
- Throws:
VaultOperationException
-
removeUserDataWithUndo
- Throws:
VaultOperationException
-
editUserDataWithUndo
public void editUserDataWithUndo(UUID id, UserData oldData, UserData newData) throws VaultOperationException - Throws:
VaultOperationException
-
undo
public void undo() -
redo
public void redo() -
hasUnsavedChanges
public boolean hasUnsavedChanges() -
setServerAuth
-
getServerVault
-
setSync
public void setSync() -
removeSync
public void removeSync() -
setOnline
public void setOnline(boolean connected) -
isOnline
public boolean isOnline() -
synchronizeVault
public void synchronizeVault() throws ForbiddenAccessException, AuthenticationException, VaultUpdateException, IOException, TimeoutException -
getServerAuth
-
getAuthenticatedUser
-
showNotification
-