Package org.wildfly.prospero.actions
Class ApplyCandidateAction
- java.lang.Object
-
- org.wildfly.prospero.actions.ApplyCandidateAction
-
public class ApplyCandidateAction extends Object
Merges a "candidate" server into base server. The "candidate" can be an update or revert.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classApplyCandidateAction.Typestatic classApplyCandidateAction.ValidationResult
-
Field Summary
Fields Modifier and Type Field Description static PathDOMAIN_STARTUP_MARKERstatic PathSTANDALONE_STARTUP_MARKER
-
Constructor Summary
Constructors Constructor Description ApplyCandidateAction(Path installationDir, Path updateDir)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<FileConflict>applyUpdate(ApplyCandidateAction.Type operation)Applies changes from prepare update atupdateDirtoinstallationDir.UpdateSetfindUpdates()list artifacts changed between base and candidate servers.SavedStategetCandidateRevision()returns the revision of the candidate serverList<FileConflict>getConflicts()list conflicts between the candidate (installationDirand target serverupdateDir.voidremoveUpdateCandidate(boolean remove)ApplyCandidateAction.ValidationResultverifyCandidate(ApplyCandidateAction.Type operation)checks that the candidate is an update of a current state of installation
-
-
-
Constructor Detail
-
ApplyCandidateAction
public ApplyCandidateAction(Path installationDir, Path updateDir) throws org.jboss.galleon.ProvisioningException, OperationException
- Throws:
org.jboss.galleon.ProvisioningExceptionOperationException
-
-
Method Detail
-
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.txtwith revision matching current installation's revision. Any update files fromupdateDirare 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 InvalidUpdateCandidateException, MetadataException
checks that the candidate is an update of a current state of installation- Returns:
- true if the candidate can be applied to installation
- Throws:
InvalidUpdateCandidateException- - if the candidate has no marker fileMetadataException- - if the metadata of candidate or installation cannot be read
-
getConflicts
public List<FileConflict> getConflicts() throws org.jboss.galleon.ProvisioningException, OperationException
list conflicts between the candidate (installationDirand target serverupdateDir.- Returns:
- list of
FileConflictor empty list if no conflicts found. - Throws:
org.jboss.galleon.ProvisioningExceptionOperationException
-
removeUpdateCandidate
public void removeUpdateCandidate(boolean remove)
-
findUpdates
public UpdateSet findUpdates() throws OperationException
list artifacts changed between base and candidate servers.- Returns:
- list of changes
- Throws:
OperationException
-
getCandidateRevision
public SavedState getCandidateRevision() throws MetadataException
returns the revision of the candidate server- Returns:
SavedState- Throws:
MetadataException- - if unable to read the candidate server metadata
-
-