Package org.glassfish.deployment.client
Class DFDeploymentStatus
- java.lang.Object
-
- org.glassfish.deployment.client.DFDeploymentStatus
-
public class DFDeploymentStatus extends Object
This class encapsulates all status related to backend deployment Backend deployement can consist of several stages. Those stages are organized in a parent/children relationship where the children are the sub stages of a parent stage. For instance, deployment stage consist of j2eec stage and application loading stage. For a stage to be sucessful, its status and all its children's status must be warning or success- Author:
- Jerome Dochez
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DFDeploymentStatus.Status
Possible status for a stage or overall deployment status
-
Field Summary
Fields Modifier and Type Field Description static String
CONTEXT_ROOT
static String
COUNT
static String
KEY_SEPARATOR
static String
MODULE_ID
static String
MODULE_TYPE
static String
SUBMODULE_COUNT
static String
WSDL_DIRECTORY
static String
WSDL_FILE_ENTRIES
static String
WSDL_LOCATION
static String
WSDL_PUBLISH_URL
-
Constructor Summary
Constructors Constructor Description DFDeploymentStatus()
Creates a new uninitialized DFDeploymentStatus instanceDFDeploymentStatus(DFDeploymentStatus parent)
Creates a new uninitialized DFDeploymentStatus instance as a sub stage deployment status of the passed DFDeploymentStatus
-
Method Summary
-
-
-
Field Detail
-
CONTEXT_ROOT
public static final String CONTEXT_ROOT
- See Also:
- Constant Field Values
-
KEY_SEPARATOR
public static final String KEY_SEPARATOR
- See Also:
- Constant Field Values
-
MODULE_ID
public static final String MODULE_ID
- See Also:
- Constant Field Values
-
MODULE_TYPE
public static final String MODULE_TYPE
- See Also:
- Constant Field Values
-
SUBMODULE_COUNT
public static final String SUBMODULE_COUNT
- See Also:
- Constant Field Values
-
WSDL_PUBLISH_URL
public static final String WSDL_PUBLISH_URL
- See Also:
- Constant Field Values
-
WSDL_LOCATION
public static final String WSDL_LOCATION
- See Also:
- Constant Field Values
-
WSDL_DIRECTORY
public static final String WSDL_DIRECTORY
- See Also:
- Constant Field Values
-
WSDL_FILE_ENTRIES
public static final String WSDL_FILE_ENTRIES
- See Also:
- Constant Field Values
-
COUNT
public static final String COUNT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DFDeploymentStatus
public DFDeploymentStatus()
Creates a new uninitialized DFDeploymentStatus instance
-
DFDeploymentStatus
public DFDeploymentStatus(DFDeploymentStatus parent)
Creates a new uninitialized DFDeploymentStatus instance as a sub stage deployment status of the passed DFDeploymentStatus- Parameters:
parent
- DFDeploymentStatus
-
-
Method Detail
-
getStatus
public DFDeploymentStatus.Status getStatus()
- Returns:
- the combined status for the stage and its children, it will return the lowest status as defined in the constants
-
addSubStage
public void addSubStage(DFDeploymentStatus subStage)
Add a sub stage to this deployment status- Parameters:
subStage
- the sub stage deployment status
-
getSubStages
public Iterator<DFDeploymentStatus> getSubStages()
Get the list of sub stages for this deployment status- Returns:
- an Iterator for the sub stages
-
setStageStatus
public void setStageStatus(DFDeploymentStatus.Status status)
Set the status for this stage- Parameters:
status
- the status as defined in the constants
-
getStageStatus
public DFDeploymentStatus.Status getStageStatus()
- Returns:
- the status for this stage (ignoring sub stages status)
-
getStageException
public Throwable getStageException()
- Returns:
- the exception if an exception was thrown during the execution of the stage
-
getStageIdentifier
public String getStageIdentifier()
- Returns:
- a meaningful i18ned stage description
-
getStageDescription
public String getStageDescription()
- Returns:
- a meaningful i18ned stage description
-
getStageStatusMessage
public String getStageStatusMessage()
- Returns:
- a meaningful i18ned reason for failure or warning
-
setStageException
public void setStageException(Throwable throwable)
When the stage throws an exception, it should store it here in the assiciated deployment status- Parameters:
throwable
-
-
setStageDescription
public void setStageDescription(String string)
- Parameters:
string
- for a meaningful i18ned stage description
-
setStageStatusMessage
public void setStageStatusMessage(String string)
- Parameters:
string
- for a meaningful i18ned reason for stage warning or failure
-
getStageStatusForLevel
public DFDeploymentStatus getStageStatusForLevel(DFDeploymentStatus.Status level)
- Returns:
- the current deployment status or one of the sub stage deployment status with a status equal to the provided level.
-
getParent
public DFDeploymentStatus getParent()
- Returns:
- the parent status for this status if any
-
setParent
public void setParent(DFDeploymentStatus parent)
Setthe parent status for this status
-
getMainStatus
public DFDeploymentStatus getMainStatus()
- Returns:
- the main status for this deployment operation, which is the parent of all status in this hierarchy
-
addProperty
public void addProperty(String propertyName, String propertyValue)
Add a new property to this status object
-
getAdditionalStatus
public Map getAdditionalStatus()
- Returns:
- the additional status map
-
getAllStageMessages
public String getAllStageMessages()
-
getAllStageMessages
public static void getAllStageMessages(DFDeploymentStatus status, StringBuilder sb)
-
setAdditionalStatus
public void setAdditionalStatus(Map additionalStatus)
Set the additional status for this status
-
toString
public String toString()
-
getAllStageStatusForLevel
public static Iterator<DFDeploymentStatus> getAllStageStatusForLevel(DFDeploymentStatus status, DFDeploymentStatus.Status level)
Get all stages with this deployment status level- Parameters:
status
- parent status it needs to iterate throughlevel
- status level it's looking for- Returns:
- an iterator for the stages with the level
-
parseDeploymentStatus
public static void parseDeploymentStatus(DFDeploymentStatus status, PrintWriter pw)
Traverse through the DeploymenStatus hierarchy and write failure/warning msgs to the print writer
-
-