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.
  • Field Details

    • STANDALONE_STARTUP_MARKER

      public static final Path STANDALONE_STARTUP_MARKER
    • DOMAIN_STARTUP_MARKER

      public static final Path DOMAIN_STARTUP_MARKER
  • Constructor Details

    • ApplyCandidateAction

      public ApplyCandidateAction(Path installationDir, Path updateDir) throws org.jboss.galleon.ProvisioningException, OperationException
      Throws:
      org.jboss.galleon.ProvisioningException
      OperationException
  • Method Details

    • applyUpdate

      public List<FileConflict> applyUpdate(ApplyCandidateAction.Type operation) throws org.jboss.galleon.ProvisioningException, OperationException
      Applies changes from prepare update at updateDir to installationDir. The update candidate has to contain a marker file .installation/.update.txt with revision matching current installation's revision. Any update files from updateDir are copied to installationDir. If any of the updates (apart from system-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 from updateDir to installationDir
      InvalidUpdateCandidateException - - if the folder at updateDir is not a valid update
      MetadataException - - if unable to read or write the installation of update metadata
      OperationException
    • verifyCandidate

      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 file
      MetadataException - - 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 (installationDir and target server updateDir.
      Returns:
      list of FileConflict or empty list if no conflicts found.
      Throws:
      org.jboss.galleon.ProvisioningException
      OperationException
    • removeCandidate

      public boolean removeCandidate(File updateDir)
    • 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