Class ClusterOperationUtil


  • public class ClusterOperationUtil
    extends Object
    Utility Class to replicate commands to the cluster.
    • Constructor Detail

      • ClusterOperationUtil

        public ClusterOperationUtil()
    • Method Detail

      • getCompletedInstances

        public static List<Server> getCompletedInstances()
      • clearInstanceList

        public static void clearInstanceList()
      • replicateCommand

        public static ActionReport.ExitCode replicateCommand​(String commandName,
                                                             FailurePolicy failPolicy,
                                                             FailurePolicy offlinePolicy,
                                                             FailurePolicy neverStartedPolicy,
                                                             List<Server> instancesForReplication,
                                                             AdminCommandContext context,
                                                             ParameterMap parameters,
                                                             org.glassfish.hk2.api.ServiceLocator habitat,
                                                             File intermediateDownloadDir)
        Replicates a given command on the given list of targets, optionally gathering downloaded result payloads from the instance commands into a directory.

        If intermediateDownloadDir is non-null, then any files returned from the instances in the payload of the HTTP response will be stored in a directory tree like this:

         ${intermediateDownloadDir}/
             ${instanceA}/
                 file(s) returned from instance A
             ${instanceB}/
                 file(s) returned from instance B
             ...
         
        where ${instanceA}, ${instanceB}, etc. are the names of the instances to which the command was replicated. This method does no further processing on the downloaded files but leaves that to the calling command.
      • replicateCommand

        public static ActionReport.ExitCode replicateCommand​(String commandName,
                                                             FailurePolicy failPolicy,
                                                             FailurePolicy offlinePolicy,
                                                             FailurePolicy neverStartedPolicy,
                                                             Collection<String> targetNames,
                                                             AdminCommandContext context,
                                                             ParameterMap parameters,
                                                             org.glassfish.hk2.api.ServiceLocator habitat,
                                                             File intermediateDownloadDir)
        Replicates a given command on the given list of targets, optionally gathering downloaded result payloads from the instance commands into a directory.

        If intermediateDownloadDir is non-null, then any files returned from the instances in the payload of the HTTP response will be stored in a directory tree like this:

         ${intermediateDownloadDir}/
             ${instanceA}/
                 file(s) returned from instance A
             ${instanceB}/
                 file(s) returned from instance B
             ...
         
        where ${instanceA}, ${instanceB}, etc. are the names of the instances to which the command was replicated. This method does no further processing on the downloaded files but leaves that to the calling command.