|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.dbmaintain.script.Script
public class Script
A class representing a script file and it's content.
Constructor Summary | |
---|---|
Script(String fileName,
ScriptIndexes scriptIndexes,
String targetDatabaseName,
Long fileLastModifiedAt,
String checkSum,
ScriptContentHandle scriptContentHandle,
boolean postProcessingScript,
boolean patchScript,
boolean ignored,
Set<Qualifier> qualifiers)
Creates a script with the given fileName and content or checksum. |
Method Summary | |
---|---|
int |
compareTo(Script script)
Compares the given script to this script by comparing the versions. |
boolean |
equals(Object object)
|
String |
getCheckSum()
|
Long |
getFileLastModifiedAt()
|
String |
getFileName()
|
String |
getFileNameWithoutPath()
|
Set<Qualifier> |
getQualifiers()
|
ScriptContentHandle |
getScriptContentHandle()
|
ScriptIndexes |
getScriptIndexes()
|
String |
getTargetDatabaseName()
|
int |
hashCode()
|
boolean |
isIgnored()
|
boolean |
isIncremental()
|
boolean |
isPatchScript()
|
boolean |
isPostProcessingScript()
|
boolean |
isRepeatable()
|
boolean |
isScriptContentEqualTo(Script other,
boolean useLastModificationDates)
|
String |
toString()
Gets a string representation of this script. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Script(String fileName, ScriptIndexes scriptIndexes, String targetDatabaseName, Long fileLastModifiedAt, String checkSum, ScriptContentHandle scriptContentHandle, boolean postProcessingScript, boolean patchScript, boolean ignored, Set<Qualifier> qualifiers)
fileName
- The name of the script file, not nullscriptIndexes
- The indexes of the script, not nulltargetDatabaseName
- The target database, null if there is no target databasefileLastModifiedAt
- The time when the file was last modified (in ms), not nullcheckSum
- Checksum calculated for the contents of the file, leave null if a script content handle is providedscriptContentHandle
- Handle providing access to the contents of the script, null if the content is unknown (a checksum is then required)postProcessingScript
- True if this script is a post processing scriptpatchScript
- True if this script is a patch script (has a patch qualifier)ignored
- True if this script should be ignored (because the revision is lower than the baseline revision)qualifiers
- The qualifiers of this script, not nullMethod Detail |
---|
public String getFileName()
public String getFileNameWithoutPath()
public ScriptIndexes getScriptIndexes()
public String getTargetDatabaseName()
public Long getFileLastModifiedAt()
public String getCheckSum()
public ScriptContentHandle getScriptContentHandle()
public boolean isScriptContentEqualTo(Script other, boolean useLastModificationDates)
other
- Another script, not nulluseLastModificationDates
- If true, this method first checks if the lastModifiedAt property of
this Script is equal to the given one. If equal, we assume that the contents are also equal and we don't
compare the checksums. If not equal, we compare the checksums to find out whether there is a difference.
By setting this value to true, performance is heavily improved when you check for updates regularly from
the same workstation (which is the case when you use unitils's automatic database maintenance for testing).
This is because, to calculate a checksum, the script contents have to be read. This can take a few seconds
to complete, which we want to avoid since a check for database updates is started every time a test is launched
that accesses the test database.
For applying changes to an environment that can only be updated incrementally (e.g. a database use by testers
or even the production database), this parameter should be false, since working with last modification dates
is not guaranteed to be 100% bulletproof (although unlikely, it is possible that a different version of
the same file is checked out on different systems on exactly the same time).
public boolean isIncremental()
public boolean isRepeatable()
public boolean isPostProcessingScript()
public boolean isIgnored()
public boolean isPatchScript()
public Set<Qualifier> getQualifiers()
public int compareTo(Script script)
compareTo
in interface Comparable<Script>
script
- The other script, not null
public int hashCode()
hashCode
in class Object
public boolean equals(Object object)
equals
in class Object
object
- The object to compare with
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |