public interface DarwinStorage
| Modifier and Type | Interface and Description |
|---|---|
static class |
DarwinStorage.SqlScriptStatus
Contains all possible states of the SQL script.
|
| Modifier and Type | Method and Description |
|---|---|
Patch |
getPatchByResourcePath(String resourcePath,
String componentName)
Returns record for the patch by its path and component name in case it exists in database.
|
VersionDescriptor |
getVersionDescriptorForComponent(String componentName)
Returns version descriptor for particular component.
|
void |
insertComponentToDatabase(String componentName)
Inserts information about the component to the database with initial data layer version of 1.0
|
Patch |
insertPatchToDatabase(String patchName,
String componentName,
LocalDateTime detectedOn,
Platform platform)
Inserts patch to db and returns its ID.
|
void |
insertSqlScriptToDB(Patch patch,
SqlCommand sqlCommand)
Inserts information about performed SQL command to database.
|
boolean |
isAnyPatchRecordedFor(String componentName)
Returns true if there is any patch recorded for this component.
|
boolean |
isPatchFinishedInDb(Patch patch)
Tries to find record for the patch in internal database and looks for timestamp
Patch#getFinishedOn() that
signalizes that patch was successfully and entirely applied. |
boolean |
isPatchRecordedByResourcePath(String resourcePath,
String componentName)
Check if the patch by its path and component name in case it exists in database.
|
void |
markPatchAsFinished(Patch patch)
Stores timestamp of the completely and successfully applied patch.
|
void |
setResourceAccessor(ResourceAccessor resourceAccessor)
Sets initialized resource utils.
|
void |
updateSqlScriptInDB(Patch patch,
SqlCommand sqlCommand)
Updates information about performed SQL command in database.
|
void |
updateVersionDescriptorForComponent(String componentName,
String version)
Updates version descriptor for particular component.
|
DarwinStorage.SqlScriptStatus |
wasSqlCommandAlreadyExecuted(int patchId,
String script,
int occurrence)
Checks if is sql command was already applied to the database.
|
void setResourceAccessor(ResourceAccessor resourceAccessor)
resourceAccessor - to use for accessing resourcesVersionDescriptor getVersionDescriptorForComponent(String componentName)
componentName - unique identification of the component to retrieve version for.void updateVersionDescriptorForComponent(String componentName, String version)
componentName - unique identification of the component for updating versionversion - of the componentPatch insertPatchToDatabase(String patchName, String componentName, LocalDateTime detectedOn, Platform platform)
patchName - file name of the patchcomponentName - unique identification of the component this patch belongs todetectedOn - date and time patch was observed for the first timeplatform - target database platform of the patchvoid insertSqlScriptToDB(Patch patch, SqlCommand sqlCommand)
patch - file name of the patchsqlCommand - contents of the SQL command inside the patchvoid updateSqlScriptInDB(Patch patch, SqlCommand sqlCommand)
patch - file name of the patchsqlCommand - contents of the SQL command inside the patchvoid markPatchAsFinished(Patch patch)
patch - identificationPatch getPatchByResourcePath(String resourcePath, String componentName)
resourcePath - platform and name of patch, example mysql/patch_1.1.sqlcomponentName - name of component on which is patch appliedboolean isPatchFinishedInDb(Patch patch)
Patch#getFinishedOn() that
signalizes that patch was successfully and entirely applied.patch - identificationboolean isPatchRecordedByResourcePath(String resourcePath, String componentName)
resourcePath - platform and name of patch, example mysql/patch_1.1.sqlcomponentName - name of component on which is patch appliedboolean isAnyPatchRecordedFor(String componentName)
componentName - name of component what we want checkvoid insertComponentToDatabase(String componentName)
DarwinStorage.SqlScriptStatus wasSqlCommandAlreadyExecuted(int patchId, String script, int occurrence)
patchId - id of the patch this script is part ofscript - SqlCommand#getStatement()occurrence - number of the identical occurence of the same script in the patchCopyright © 2020 FG Forrest, a.s.. All rights reserved.