Package com.openindex.openestate.tool.db
Class DbUpdateHandlerImpl
- java.lang.Object
-
- com.openindex.openestate.tool.db.DbUpdateHandlerImpl
-
- All Implemented Interfaces:
DbUpdateHandler
,Comparable<DbUpdateHandler>
- Direct Known Subclasses:
HSqlDbUpdateHandler
public abstract class DbUpdateHandlerImpl extends Object implements DbUpdateHandler
DbUpdateHandlerImpl.- Author:
- Andreas Rudolph
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DbUpdateHandlerImpl.Type
-
Field Summary
-
Fields inherited from interface com.openindex.openestate.tool.db.DbUpdateHandler
PRIORITY_APP, PRIORITY_PLUGIN, PRIORITY_PLUGIN_RELATION
-
-
Constructor Summary
Constructors Constructor Description DbUpdateHandlerImpl(String id, DbUpdateHandlerImpl.Type type, long localVersion, String uninstallQuery, String resourcePath, ClassLoader classLoader, AbstractDbUpdateListener listener)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description int
compareTo(DbUpdateHandler o)
boolean
equals(Object o)
abstract void
execute(Connection c, String file)
ClassLoader
getClassLoader()
long
getDbVersion(Connection c, DbExtension dbExtension)
String
getId()
long
getLocalVersion()
String
getParentUpdateId(long version)
Long
getParentUpdateVersion(long version)
int
getPriority()
String
getResourcePath()
DbUpdateHandlerImpl.Type
getType()
String
getUninstallQuery()
int
hashCode()
protected Properties
loadSettings()
void
register(Connection c, AbstractDbDriver dbDriver, DbExtension dbExtension, long version)
void
update(Connection c, AbstractDbDriver dbDriver, long version)
void
updateFinish(Connection c, AbstractDbDriver dbDriver, long version)
void
updateFinished(Connection c, AbstractDbDriver dbDriver, DbExtension dbExtension, long oldDbVersion, long newDbVersion)
-
-
-
Constructor Detail
-
DbUpdateHandlerImpl
public DbUpdateHandlerImpl(String id, DbUpdateHandlerImpl.Type type, long localVersion, String uninstallQuery, String resourcePath, ClassLoader classLoader, AbstractDbUpdateListener listener)
-
-
Method Detail
-
compareTo
public int compareTo(DbUpdateHandler o)
- Specified by:
compareTo
in interfaceComparable<DbUpdateHandler>
-
execute
public abstract void execute(Connection c, String file) throws SQLException, IOException
- Throws:
SQLException
IOException
-
getClassLoader
public final ClassLoader getClassLoader()
-
getDbVersion
public final long getDbVersion(Connection c, DbExtension dbExtension) throws SQLException, IOException
- Specified by:
getDbVersion
in interfaceDbUpdateHandler
- Throws:
SQLException
IOException
-
getLocalVersion
public final long getLocalVersion()
- Specified by:
getLocalVersion
in interfaceDbUpdateHandler
-
getId
public final String getId()
- Specified by:
getId
in interfaceDbUpdateHandler
-
getParentUpdateId
public final String getParentUpdateId(long version)
- Specified by:
getParentUpdateId
in interfaceDbUpdateHandler
-
getParentUpdateVersion
public final Long getParentUpdateVersion(long version)
- Specified by:
getParentUpdateVersion
in interfaceDbUpdateHandler
-
getPriority
public final int getPriority()
- Specified by:
getPriority
in interfaceDbUpdateHandler
-
getResourcePath
public final String getResourcePath()
-
getType
public final DbUpdateHandlerImpl.Type getType()
-
getUninstallQuery
public final String getUninstallQuery()
- Specified by:
getUninstallQuery
in interfaceDbUpdateHandler
-
loadSettings
protected Properties loadSettings() throws IOException
- Throws:
IOException
-
register
public void register(Connection c, AbstractDbDriver dbDriver, DbExtension dbExtension, long version) throws SQLException, IOException
- Specified by:
register
in interfaceDbUpdateHandler
- Throws:
SQLException
IOException
-
update
public void update(Connection c, AbstractDbDriver dbDriver, long version) throws SQLException, IOException
- Specified by:
update
in interfaceDbUpdateHandler
- Throws:
SQLException
IOException
-
updateFinish
public void updateFinish(Connection c, AbstractDbDriver dbDriver, long version) throws SQLException, IOException
- Specified by:
updateFinish
in interfaceDbUpdateHandler
- Throws:
SQLException
IOException
-
updateFinished
public void updateFinished(Connection c, AbstractDbDriver dbDriver, DbExtension dbExtension, long oldDbVersion, long newDbVersion) throws SQLException, IOException
- Specified by:
updateFinished
in interfaceDbUpdateHandler
- Throws:
SQLException
IOException
-
-