Package com.openindex.openestate.tool.db
Class DbAdminHandlerImpl
- java.lang.Object
-
- com.openindex.openestate.tool.db.DbAdminHandlerImpl
-
- All Implemented Interfaces:
DbAdminHandler
- Direct Known Subclasses:
HSqlDbAdminHandler
public abstract class DbAdminHandlerImpl extends Object implements DbAdminHandler
DbAdminHandlerImpl.- Author:
- Andreas Rudolph
-
-
Constructor Summary
Constructors Constructor Description DbAdminHandlerImpl()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
backupLocalDb(Connection c, File backupArchive)
abstract void
backupRemoteDb(Connection c, String dbName)
abstract void
createAccount(Connection c, String account, char[] password)
abstract void
defrag(Connection c)
abstract void
dumpLocalDb(Connection c, File backupArchive)
abstract String[]
getAccounts(Connection c, boolean includeAdmin)
abstract String[]
getProcedures(Connection c)
abstract String[]
getRoles(Connection c, boolean includeAdmin)
abstract DbSession[]
getSessions(Connection c)
abstract String[]
getTables(Connection c)
abstract String[]
getViews(Connection c)
abstract boolean
grantRole(Connection c, String account, String role)
boolean
hasRole(Connection c, String role)
abstract boolean
hasRole(Connection c, String account, String role)
boolean
isAdmin(Connection c)
abstract boolean
isAdmin(Connection c, String account)
boolean
isEnabled(Connection c)
abstract boolean
isEnabled(Connection c, String account)
abstract boolean
isLocalDbBackupSupported()
abstract boolean
isLocalDbDumpSupported()
abstract boolean
isRemoteDbBackupSupported()
abstract void
removeAccount(Connection c, String account)
abstract boolean
revokeRole(Connection c, String account, String role)
abstract File
selectLocalBackupFile(Component parentComponent, File defaultDir)
abstract File
selectLocalDumpFile(Component parentComponent, File defaultDir)
abstract void
setAdmin(Connection c, String account, boolean isAdmin)
abstract void
setEnabled(Connection c, String account, boolean isEnabled)
abstract void
updateAccount(Connection c, String account, char[] password)
-
-
-
Method Detail
-
backupLocalDb
public abstract void backupLocalDb(Connection c, File backupArchive) throws SQLException
- Specified by:
backupLocalDb
in interfaceDbAdminHandler
- Throws:
SQLException
-
backupRemoteDb
public abstract void backupRemoteDb(Connection c, String dbName) throws SQLException
- Specified by:
backupRemoteDb
in interfaceDbAdminHandler
- Throws:
SQLException
-
createAccount
public abstract void createAccount(Connection c, String account, char[] password) throws SQLException
- Specified by:
createAccount
in interfaceDbAdminHandler
- Throws:
SQLException
-
dumpLocalDb
public abstract void dumpLocalDb(Connection c, File backupArchive) throws SQLException
- Specified by:
dumpLocalDb
in interfaceDbAdminHandler
- Throws:
SQLException
-
defrag
public abstract void defrag(Connection c) throws SQLException
- Specified by:
defrag
in interfaceDbAdminHandler
- Throws:
SQLException
-
getAccounts
public abstract String[] getAccounts(Connection c, boolean includeAdmin) throws SQLException
- Specified by:
getAccounts
in interfaceDbAdminHandler
- Throws:
SQLException
-
getProcedures
public abstract String[] getProcedures(Connection c) throws SQLException
- Specified by:
getProcedures
in interfaceDbAdminHandler
- Throws:
SQLException
-
getRoles
public abstract String[] getRoles(Connection c, boolean includeAdmin) throws SQLException
- Specified by:
getRoles
in interfaceDbAdminHandler
- Throws:
SQLException
-
getSessions
public abstract DbSession[] getSessions(Connection c) throws SQLException
- Specified by:
getSessions
in interfaceDbAdminHandler
- Throws:
SQLException
-
getTables
public abstract String[] getTables(Connection c) throws SQLException
- Specified by:
getTables
in interfaceDbAdminHandler
- Throws:
SQLException
-
getViews
public abstract String[] getViews(Connection c) throws SQLException
- Specified by:
getViews
in interfaceDbAdminHandler
- Throws:
SQLException
-
grantRole
public abstract boolean grantRole(Connection c, String account, String role) throws SQLException
- Specified by:
grantRole
in interfaceDbAdminHandler
- Throws:
SQLException
-
hasRole
public final boolean hasRole(Connection c, String role) throws SQLException
- Specified by:
hasRole
in interfaceDbAdminHandler
- Throws:
SQLException
-
hasRole
public abstract boolean hasRole(Connection c, String account, String role) throws SQLException
- Specified by:
hasRole
in interfaceDbAdminHandler
- Throws:
SQLException
-
isAdmin
public final boolean isAdmin(Connection c) throws SQLException
- Specified by:
isAdmin
in interfaceDbAdminHandler
- Throws:
SQLException
-
isAdmin
public abstract boolean isAdmin(Connection c, String account) throws SQLException
- Specified by:
isAdmin
in interfaceDbAdminHandler
- Throws:
SQLException
-
isEnabled
public final boolean isEnabled(Connection c) throws SQLException
- Specified by:
isEnabled
in interfaceDbAdminHandler
- Throws:
SQLException
-
isEnabled
public abstract boolean isEnabled(Connection c, String account) throws SQLException
- Specified by:
isEnabled
in interfaceDbAdminHandler
- Throws:
SQLException
-
isLocalDbBackupSupported
public abstract boolean isLocalDbBackupSupported()
- Specified by:
isLocalDbBackupSupported
in interfaceDbAdminHandler
-
isLocalDbDumpSupported
public abstract boolean isLocalDbDumpSupported()
- Specified by:
isLocalDbDumpSupported
in interfaceDbAdminHandler
-
isRemoteDbBackupSupported
public abstract boolean isRemoteDbBackupSupported()
- Specified by:
isRemoteDbBackupSupported
in interfaceDbAdminHandler
-
removeAccount
public abstract void removeAccount(Connection c, String account) throws SQLException
- Specified by:
removeAccount
in interfaceDbAdminHandler
- Throws:
SQLException
-
revokeRole
public abstract boolean revokeRole(Connection c, String account, String role) throws SQLException
- Specified by:
revokeRole
in interfaceDbAdminHandler
- Throws:
SQLException
-
selectLocalBackupFile
public abstract File selectLocalBackupFile(Component parentComponent, File defaultDir)
- Specified by:
selectLocalBackupFile
in interfaceDbAdminHandler
-
selectLocalDumpFile
public abstract File selectLocalDumpFile(Component parentComponent, File defaultDir)
- Specified by:
selectLocalDumpFile
in interfaceDbAdminHandler
-
setAdmin
public abstract void setAdmin(Connection c, String account, boolean isAdmin) throws SQLException
- Specified by:
setAdmin
in interfaceDbAdminHandler
- Throws:
SQLException
-
setEnabled
public abstract void setEnabled(Connection c, String account, boolean isEnabled) throws SQLException
- Specified by:
setEnabled
in interfaceDbAdminHandler
- Throws:
SQLException
-
updateAccount
public abstract void updateAccount(Connection c, String account, char[] password) throws SQLException
- Specified by:
updateAccount
in interfaceDbAdminHandler
- Throws:
SQLException
-
-