Package org.glassfish.deployment.admin
Class DeploymentCommandUtils
- java.lang.Object
-
- org.glassfish.deployment.admin.DeploymentCommandUtils
-
public class DeploymentCommandUtils extends Object
Utility methods useful from deployment-related commands.- Author:
- Tim Quinn
-
-
Field Summary
Fields Modifier and Type Field Description static String
APPLICATION_RESOURCE_NAME
-
Constructor Summary
Constructors Constructor Description DeploymentCommandUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description 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.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.static String
getLocalHostName()
static String
getResourceNameForApps(Domain d)
static String
getResourceNameForExistingApp(Domain d, String appName)
static String
getResourceNameForNewApp(Domain d, String appName)
static String
getTarget(ParameterMap parameters, OpsParams.Origin origin, Deployment deployment)
static String
getTargetResourceNameForExistingApp(Domain d, String target, String appName)
static String
getTargetResourceNameForExistingAppRef(Domain d, String target, String appName)
static String
getTargetResourceNameForNewApp(Domain d, String target)
static String
getTargetResourceNameForNewAppRef(Domain d, String target)
static String
getTargetResourceNameForNewAppRef(Domain d, String target, String appName)
static File
renameUploadedFileOrCopyInPlaceFile(File finalUploadDir, File fileParam, Logger logger, ServerEnvironment env)
static ActionReport.ExitCode
replicateEnableDisableToContainingCluster(String commandName, Domain domain, String target, String appName, org.glassfish.hk2.api.ServiceLocator habitat, AdminCommandContext context, AdminCommand command)
Replicates an enable or disable command to all instances in the cluster of which the target is a member.
-
-
-
Field Detail
-
APPLICATION_RESOURCE_NAME
public static final String APPLICATION_RESOURCE_NAME
- See Also:
- Constant Field Values
-
-
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 instancesdomain
- domain containing the relevant configurationtarget
- name of the target being enabled or disabledappName
- name of the application being enabled or disabledhabitat
- hk2 habitatcontext
- command context passed to the running enable or disable commandcommand
- command object- Returns:
- Throws:
IllegalArgumentException
IllegalAccessException
-
getLocalHostName
public static String getLocalHostName()
-
getTarget
public static String getTarget(ParameterMap parameters, OpsParams.Origin origin, Deployment deployment)
-
renameUploadedFileOrCopyInPlaceFile
public static File renameUploadedFileOrCopyInPlaceFile(File finalUploadDir, File fileParam, Logger logger, ServerEnvironment env) throws IOException
- Throws:
IOException
-
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)
-
-