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
    • CANDIDATE_CHANNEL_NAME_LIST

      public static final String 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.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.

      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 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:
      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, 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