package _VisualDVM.ComponentsServer;
import Common.Database.SQLITE.SQLiteDatabase;
import Common.Passes.PassCode_;
import _VisualDVM.ComponentsServer.SubscriberWorkspace.SubscriberWorkspaceDBTable;
import _VisualDVM.ComponentsServer.UserAccount.UserAccountsDBTable;
import _VisualDVM.Passes.PassCode;

import java.nio.file.Paths;
public class CredentialsDatabase extends SQLiteDatabase {
    public UserAccountsDBTable userAccounts;
    public SubscriberWorkspaceDBTable workspaces;
    public CredentialsDatabase() {
        super(Paths.get(System.getProperty("user.dir"), "Data", "credentials.sqlite").toFile());
    }
    @Override
    protected void initAllTables() throws Exception {
        addTable(userAccounts = new UserAccountsDBTable());
        addTable(workspaces = new SubscriberWorkspaceDBTable());
    }
    @Override
    public PassCode_ getSynchronizePassCode() {
        return PassCode.SynchronizeCredentials;
    }
    @Override
    public void DropUI() {
        super.DropUI();
        userAccounts.ClearUI();
        workspaces.ClearUI();
    }
    @Override
    public void ResetUI() {
        userAccounts.ShowUI();
        super.ResetUI();
    }
}
