Class DeploymentCommandUtils


  • public class DeploymentCommandUtils
    extends Object
    Utility methods useful from deployment-related commands.
    Author:
    Tim Quinn
    • Constructor Detail

      • DeploymentCommandUtils

        public DeploymentCommandUtils()
    • Method Detail

      • replicateEnableDisableToContainingCluster

        public static ActionReport.ExitCode replicateEnableDisableToContainingCluster​(String commandName,
                                                                                      Domain domain,
                                                                                      String target,
                                                                                      String appName,
                                                                                      org.glassfish.hk2.api.ServiceLocator habitat,
                                                                                      AdminCommandContext context,
                                                                                      AdminCommand command)
                                                                               throws IllegalArgumentException,
                                                                                      IllegalAccessException
        Replicates an enable or disable command to all instances in the cluster of which the target is a member. If the target is not cluster member this method is a no-op.
        Parameters:
        commandName - name of the command to replicate to cluster instances
        domain - domain containing the relevant configuration
        target - name of the target being enabled or disabled
        appName - name of the application being enabled or disabled
        habitat - hk2 habitat
        context - command context passed to the running enable or disable command
        command - command object
        Returns:
        Throws:
        IllegalArgumentException
        IllegalAccessException
      • getLocalHostName

        public static String getLocalHostName()
      • getAccessChecksForExistingApp

        public static Collection<? extends AccessRequired.AccessCheck> getAccessChecksForExistingApp​(Domain domain,
                                                                                                     Applications applications,
                                                                                                     String target,
                                                                                                     Collection<String> matchedVersions,
                                                                                                     String appAction,
                                                                                                     String appRefAction)
        Prepares AccessChecks for an application already deployed to one or more targets, returning an access check for the application itself and access checks for each matching version on whatever targets to which it is assigned.
        Parameters:
        domain -
        applications -
        target -
        matchedVersions -
        appAction -
        appRefAction -
        Returns:
      • getAccessChecksForNewApp

        public static Collection<? extends AccessRequired.AccessCheck> getAccessChecksForNewApp​(Domain domain,
                                                                                                Applications applications,
                                                                                                String target,
                                                                                                String action)
        Returns access checks for a new application (not already deployed) and for the corresponding app ref(s) given the specified target. This method does no target expansion in creating the access checks.
        Parameters:
        domain -
        applications -
        target -
        action -
        Returns:
      • getTargetResourceNameForNewApp

        public static String getTargetResourceNameForNewApp​(Domain d,
                                                            String target)
      • getTargetResourceNameForExistingApp

        public static String getTargetResourceNameForExistingApp​(Domain d,
                                                                 String target,
                                                                 String appName)
      • getTargetResourceNameForNewAppRef

        public static String getTargetResourceNameForNewAppRef​(Domain d,
                                                               String target)
      • getTargetResourceNameForNewAppRef

        public static String getTargetResourceNameForNewAppRef​(Domain d,
                                                               String target,
                                                               String appName)
      • getTargetResourceNameForExistingAppRef

        public static String getTargetResourceNameForExistingAppRef​(Domain d,
                                                                    String target,
                                                                    String appName)
      • getResourceNameForApps

        public static String getResourceNameForApps​(Domain d)
      • getResourceNameForNewApp

        public static String getResourceNameForNewApp​(Domain d,
                                                      String appName)
      • getResourceNameForExistingApp

        public static String getResourceNameForExistingApp​(Domain d,
                                                           String appName)