public abstract class UpgradeAction
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected ConfigService |
configService |
protected Diagnostics |
diags |
protected java.util.logging.Logger |
logger |
Modifier | Constructor and Description |
---|---|
protected |
UpgradeAction(ConfigService configService, Diagnostics diags) |
Modifier and Type | Method and Description |
---|---|
void |
execute(ConfigJar.CanonicalForm rform) |
void |
execute(ConfigJar.SerializedForm sform, ConfigJar.CanonicalForm cform) |
Diagnostics |
getDiagnostics() |
abstract Ref |
getFailureDiagnosticTarget()
Returns the ref which the diagnostic will be about if this action fails to execute
|
abstract Ref |
getSourceRef() |
abstract Ref |
getSuccessDiagnosticTarget()
Returns the ref which the diagnostic will be about if this action executes successfully;
|
abstract Ref |
getTargetRef() |
static UpgradeAction |
makeAddResourceAction(ConfigService configService, Ref ref, java.lang.Object canonicalData, Diagnostics diags)
Action for adding a new resource to the configuration jar file
|
static UpgradeAction |
makeDeleteAction(ConfigService configService, Ref ref, Diagnostics diags)
Action for deleting an existing resource in the configuration jar file
|
static UpgradeAction |
makeUpdateResourceAction(ConfigService configService, Ref ref, java.lang.Object newdata, Diagnostics diags)
Action for updating the deserialized/parsed data for an existing resource in teh configuration jar file
|
static UpgradeAction |
makeUpgradeFailedAction(ConfigService configService, Ref ref, Diagnostic diag)
Action for signalling that the attempt to upgrade the given resource has failed, and therefore should be dropped from the import
|
protected final ConfigService configService
protected final java.util.logging.Logger logger
protected final Diagnostics diags
protected UpgradeAction(ConfigService configService, Diagnostics diags)
public static final UpgradeAction makeAddResourceAction(ConfigService configService, Ref ref, java.lang.Object canonicalData, Diagnostics diags)
configService
- config service instanceref
- the reference for the new resourcecanonicalData
- canonical representation of the datapublic static final UpgradeAction makeDeleteAction(ConfigService configService, Ref ref, Diagnostics diags)
ref
- the reference to the resource to be deletedpublic static final UpgradeAction makeUpdateResourceAction(ConfigService configService, Ref ref, java.lang.Object newdata, Diagnostics diags)
configService
- config service instanceref
- the reference to the resourcenewdata
- the new data for the resourcepublic static final UpgradeAction makeUpgradeFailedAction(ConfigService configService, Ref ref, Diagnostic diag)
ref
-diag
-public final void execute(ConfigJar.SerializedForm sform, ConfigJar.CanonicalForm cform) throws java.lang.Exception
java.lang.Exception
public final void execute(ConfigJar.CanonicalForm rform) throws java.lang.Exception
java.lang.Exception
public Diagnostics getDiagnostics()
public abstract Ref getSourceRef()
public abstract Ref getTargetRef()
public abstract Ref getSuccessDiagnosticTarget()
public abstract Ref getFailureDiagnosticTarget()