Class ApplyCandidateAction


  • public class ApplyCandidateAction
    extends Object
    Merges a "candidate" server into base server. The "candidate" can be an update or revert.
    • Field Detail

      • STANDALONE_STARTUP_MARKER

        public static final Path STANDALONE_STARTUP_MARKER
      • DOMAIN_STARTUP_MARKER

        public static final Path DOMAIN_STARTUP_MARKER
    • Constructor Detail

      • ApplyCandidateAction

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

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

        public void removeUpdateCandidate​(boolean remove)
      • 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