Uses of Class
com.ultikits.ultitools.utils.ModuleFileTransactions.Record
Packages that use ModuleFileTransactions.Record
-
Uses of ModuleFileTransactions.Record in com.ultikits.ultitools.utils
Fields in com.ultikits.ultitools.utils with type parameters of type ModuleFileTransactions.RecordModifier and TypeFieldDescriptionprivate final List<ModuleFileTransactions.Record> ModuleFileTransactions.appliedThisStartMethods in com.ultikits.ultitools.utils that return ModuleFileTransactions.RecordModifier and TypeMethodDescriptionprivate static ModuleFileTransactions.RecordModuleFileTransactions.readRecord(File recordFile) Reads one record.private ModuleFileTransactions.RecordModuleFileTransactions.readRecordOrReport(File recordFile) private ModuleFileTransactions.RecordModuleFileTransactions.removalRecordIn(File recordFile) The removal record inrecordFile, ornullwhen it holds none: a record of another type, or one that cannot be read or fails the validation start-up applies (ModuleFileTransactions.problemWith(com.ultikits.ultitools.utils.ModuleFileTransactions.Record, java.io.File): for example a null entry).private ModuleFileTransactions.RecordModuleFileTransactions.updateRecordIn(File recordFile) The update record inrecordFile, ornullwhen it cannot be read or is not one.Methods in com.ultikits.ultitools.utils with parameters of type ModuleFileTransactions.RecordModifier and TypeMethodDescriptionprivate booleanModuleFileTransactions.abandonedBeforeApply(ModuleFileTransactions.Record record, File work, File old, File backup) Abandons the transaction, before anything is moved, when the old JAR is no longer the one staged against.private voidModuleFileTransactions.applyGuarded(ModuleFileTransactions.Record record) Carries out one record.private voidModuleFileTransactions.applyRecord(ModuleFileTransactions.Record record) private voidModuleFileTransactions.applyRemoval(ModuleFileTransactions.Record record) Deletes the JARs an uninstall recorded, before any module loads: each only if it is confirmed to still be the file that was recorded.private voidModuleFileTransactions.applyUpdate(ModuleFileTransactions.Record record) private FileModuleFileTransactions.backupOf(ModuleFileTransactions.Record record) private booleanModuleFileTransactions.cancelOne(ModuleFileTransactions.Record record, File recordFile) Cancels one staged update: its working folder and record are deleted -- unless the record is held for the operator, or its folder holds a file the transaction cannot identify, which is then held for the operator rather than deleted (foreign-file rule).ModuleFileTransactions.checkExisting(ModuleFileTransactions.Record lookup) What an existing record of this module says about staging now, under the lock:nullto go ahead (after discarding aFAILEDrecord, whose failure is left inModuleFileTransactions.lastDiscardedFailure), or the refusal to return.private StringModuleFileTransactions.discardFailed(ModuleFileTransactions.Record record) Discards aFAILEDrecord before staging again: the apply is undone (ModuleFileTransactions.undoApply(com.ultikits.ultitools.utils.ModuleFileTransactions.Record): the new JAR out of the modules folder, the old JAR back if it is still aside), then the working folder and the record are deleted.ModuleFileTransactions.download(ModuleFileTransactions.Record record, File work, String identifyString, ModuleFileTransactions.Reservation reservation, ModuleFileTransactions.Catalogue catalogue, ModuleFileTransactions.Downloader downloader, Function<UltiToolsPlugin, String> mainClassOf) The part of staging that touches the network and the staged file, run outside the lock; only the record write at its end takes the lock again.ModuleFileTransactions.existingOutcome(ModuleFileTransactions.Record existing, File existingFile) What a valid existing record of this module means for staging now: an update already waiting, one in progress, one held for the operator (refused until the operator removes the record), or aFAILEDone, discarded -- unless discarding it would touch a file the transaction cannot identify, which holds it for the operator instead.private voidModuleFileTransactions.failApply(ModuleFileTransactions.Record record, File file, Throwable error) The apply could not be made.private voidModuleFileTransactions.failApply(ModuleFileTransactions.Record record, File file, Throwable error, ModuleFileTransactions.Report specific) ModuleFileTransactions.failApply(Record, File, Throwable)with the line to log, when the old JAR is back in place, given by the caller instead of the generic one.private voidModuleFileTransactions.failStagedIdentity(ModuleFileTransactions.Record record, File staged, String actual) The staged JAR is not the file recorded at staging (changed, or gone): the apply fails throughModuleFileTransactions.failApply(com.ultikits.ultitools.utils.ModuleFileTransactions.Record, java.io.File, java.lang.Throwable), so a kept old JAR goes back and the record isFAILED; the line names the staged path and both hashes.private voidModuleFileTransactions.failUnexpectedly(ModuleFileTransactions.Record record, String entryState, RuntimeException error) An unchecked exception ended one transaction.private voidModuleFileTransactions.finishCommit(ModuleFileTransactions.Record record) private voidModuleFileTransactions.finishRollback(ModuleFileTransactions.Record record, ModuleFileTransactions.RollbackPhase phase) Removes the new JAR -- recognised by content, so nothing else is ever deleted -- and puts the old JAR back.private voidModuleFileTransactions.holdForOperator(ModuleFileTransactions.Record record, String detail) Keeps the record asNEEDS_OPERATOR, says so once, and ends the step.private static StringModuleFileTransactions.idOf(ModuleFileTransactions.Record record) The name a record's files take: its type and a hash of its key, never text from the record.private booleanModuleFileTransactions.isLoadedFrom(ModuleFileTransactions.Record record, File target, List<UltiToolsPlugin> loaded, Function<UltiToolsPlugin, File> codeSource) private static booleanModuleFileTransactions.isStagedJar(File file, ModuleFileTransactions.Record record) Whetherfileis the JAR this transaction staged, by content.private voidModuleFileTransactions.markApplied(ModuleFileTransactions.Record record) private static StringModuleFileTransactions.missingField(ModuleFileTransactions.Record record) The first field a record of its type needs and lacks, ornullwhen it is complete.private booleanModuleFileTransactions.persist(ModuleFileTransactions.Record record) ModuleFileTransactions.writeRecord(Record)at start-up, where a failure is a report line, not an abort.private StringModuleFileTransactions.problemWith(ModuleFileTransactions.Record record, File recordFile) Why a record read from a file cannot be carried out, ornullwhen it can: the one validation start-up and staging share.private FileModuleFileTransactions.recordFileOf(ModuleFileTransactions.Record record) private voidModuleFileTransactions.refuseLinkedFolders(ModuleFileTransactions.Record record) The working folder and its two subfolders are this class's own; one that is a symbolic link would take every name confined to it somewhere else, so the record is refused.private voidModuleFileTransactions.requireRecorded(ModuleFileTransactions.Record record, ModuleFileTransactions.Expected... expected) The foreign-file rule, at every destructive step: the transaction only ever moves, replaces or deletes a file whose SHA-256 matches the record -- the staged new JAR or the kept old JAR -- and only into a place that is free.ModuleFileTransactions.reserve(ModuleFileTransactions.Record record, File work, String identifyString, List<UltiToolsPlugin> loaded, Function<UltiToolsPlugin, File> codeSource) The checks staging makes before it downloads, underModuleFileTransactions.LOCK: no download of this module running, no update already staged, no kept old JAR left without its record.private voidModuleFileTransactions.restoreAfterFailure(ModuleFileTransactions.Record record) A failed apply found at a later start: make sure it is undone -- the new JAR out of the modules folder and the old JAR back (ModuleFileTransactions.undoApply(com.ultikits.ultitools.utils.ModuleFileTransactions.Record)) -- and say so if it cannot be.private StringModuleFileTransactions.restoreBackup(ModuleFileTransactions.Record record) Moves the kept old JAR back into the modules folder when it is not there.private voidModuleFileTransactions.resumeWithoutStagedJar(ModuleFileTransactions.Record record, File target, File staged) The staged JAR is not in its folder: either the new JAR was moved in and the start ended beforeAPPLIEDwas recorded, or the staged JAR is gone.private StringModuleFileTransactions.returnStagedJar(ModuleFileTransactions.Record record) Moves the new JAR back to the staged folder when it was already moved into the modules folder -- recognised by its recorded hash, so nothing else is ever moved.private FileModuleFileTransactions.stagedOf(ModuleFileTransactions.Record record) private booleanModuleFileTransactions.stoppedBeforeMoving(ModuleFileTransactions.Record record, File work, File old, File target, File backup, File staged) The checks an apply makes before it moves anything; each that fails ends the transaction.private StringModuleFileTransactions.undoApply(ModuleFileTransactions.Record record) Undoes whatever part of an apply happened: the new JAR goes back to the staged folder if it is in the modules folder (ModuleFileTransactions.returnStagedJar(com.ultikits.ultitools.utils.ModuleFileTransactions.Record), by its recorded hash), then the kept old JAR goes back (ModuleFileTransactions.restoreBackup(com.ultikits.ultitools.utils.ModuleFileTransactions.Record)) -- in that order, and the second only once the first is done, so the modules folder never holds both.private static ModuleFileTransactions.StageResultModuleFileTransactions.verifyStaged(ModuleFileTransactions.Record record, File work, File staged, String latest, String previousFailure) Checks the downloaded JAR -- the size/entry guard, its identity, that it declares the version the catalogue offered, and that itsapi-versionis one this framework installs (ModuleApiLevels; plan 18-40) -- and on success records its version and SHA-256.private FileModuleFileTransactions.workFolder(ModuleFileTransactions.Record record) private voidModuleFileTransactions.writeRecord(ModuleFileTransactions.Record record) Writes a record atomically: a temporary file in the same folder, then an atomic move over the record, so a crash leaves either the previous record or the new one, never a torn file.ModuleFileTransactions.writeStaged(ModuleFileTransactions.Record record, File work, String previousFailure) Writes thePENDINGrecord of a staged JAR, under the lock; the staging is discarded when it cannot be.