Package org.wildfly.prospero.actions
Class ApplyCandidateAction
java.lang.Object
org.wildfly.prospero.actions.ApplyCandidateAction
Merges a "candidate" server into base server. The "candidate" can be an update or revert.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enum -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapplyUpdate(ApplyCandidateAction.Type operation) Applies changes from prepare update atupdateDirtoinstallationDir.list artifacts changed between base and candidate servers.returns the revision of the candidate serverlist conflicts between the candidate (installationDirand target serverupdateDir.booleanremoveCandidate(File updateDir) verifyCandidate(ApplyCandidateAction.Type operation) checks that the candidate is an update of a current state of installation
-
Field Details
-
STANDALONE_STARTUP_MARKER
-
DOMAIN_STARTUP_MARKER
-
CANDIDATE_CHANNEL_NAME_LIST
- See Also:
-
-
Constructor Details
-
ApplyCandidateAction
public ApplyCandidateAction(Path installationDir, Path updateDir) throws org.jboss.galleon.ProvisioningException, OperationException - Throws:
org.jboss.galleon.ProvisioningExceptionOperationException
-
-
Method Details
-
applyUpdate
public List<FileConflict> applyUpdate(ApplyCandidateAction.Type operation) throws org.jboss.galleon.ProvisioningException, OperationException Applies changes from prepare update atupdateDirtoinstallationDir. The update candidate has to contain a marker file.installation/.update.txt.If the Operation is a Revert, the content of the installation dir is compared with the content of the updated dir to verify there are changes where revert to. This content check is done using .galleon/hashes files and ./installation/installer-channels.yaml file.
Any update files from
updateDirare copied toinstallationDir. If any of the updates (apart fromsystem-paths) conflict with user changes, the user changes are preserved and the updated file is added with'.glnew'suffix.- Returns:
- list of solved
FileConflicts - Throws:
org.jboss.galleon.ProvisioningException- - if unable to apply the changes fromupdateDirtoinstallationDirInvalidUpdateCandidateException- - if the folder atupdateDiris not a valid updateMetadataException- - if unable to read or write the installation of update metadataOperationException
-
verifyCandidate
public ApplyCandidateAction.ValidationResult verifyCandidate(ApplyCandidateAction.Type operation) throws MetadataException checks that the candidate is an update of a current state of installation- Returns:
- ValidationResult that represents the result of the verification
- Throws:
MetadataException- - if the metadata of candidate or installation cannot be read
-
getConflicts
public List<FileConflict> getConflicts() throws org.jboss.galleon.ProvisioningException, OperationExceptionlist conflicts between the candidate (installationDirand target serverupdateDir.- Returns:
- list of
FileConflictor empty list if no conflicts found. - Throws:
org.jboss.galleon.ProvisioningExceptionOperationException
-
removeCandidate
-
findUpdates
list artifacts changed between base and candidate servers.- Returns:
- list of changes
- Throws:
OperationException
-
getCandidateRevision
returns the revision of the candidate server- Returns:
SavedState- Throws:
MetadataException- - if unable to read the candidate server metadata
-