org.figure8.join.businessfacades.environment
Class DefaultEnvironmentManager

java.lang.Object
  extended by org.figure8.join.businessfacades.environment.DefaultEnvironmentManager
All Implemented Interfaces:
EnvironmentManager

public class DefaultEnvironmentManager
extends java.lang.Object
implements EnvironmentManager

This is the default implementation of EnvironmentManager.

Version:
$Revision: 1.6 $
Author:
Laurent Broudoux

Constructor Summary
DefaultEnvironmentManager()
          Creates a new instance of DefaultEnvironmentManager.
 
Method Summary
 void cancelDeployment(Deployment deployment, java.lang.String comments)
          Cancel a deployment process whether it is in preparation phase or in realization phase.
 void closeEnvironmentMapping(EnvironmentMapping mapping)
          Closes the specified EnvironmentMapping.
 void createDeployment(Deployment deployment)
          Create a Deployment informations : this is the beginning step of a Deployment lifecycle.
 void endDeployment(Deployment deployment, java.lang.String comments)
          End a deployment process : this is the final step into this process.
 Deployment getDeployment(long id)
          Retrieve a Deployment using its unique identifier
 java.util.List getDeployments(LogicalEnvironment environment)
          Retrieve all the deployments realized for a logical environment
 java.util.List getDeployments(PhysicalEnvironment environment)
          Retrieve all the deployments realized onto a physical environment
 EnvironmentMapping getEnvironmentMapping(long id)
          Retrieve an EnvironmentMapping using its unique identifier
 EnvironmentMapping getEnvironmentMappingAtDate(LogicalEnvironment environment, java.util.Date configDate)
          Retrieve EnvironmentMapping that was active for an environment at specified date
 java.util.List getEnvironmentMappings(LogicalEnvironment environment)
          Retrieve all the environment mappings for a LogicalEnvironment through time
 java.util.List getEnvironmentMappings(PhysicalEnvironment environment)
          Retrieve all the environment mappings for a PhysicalEnvironment through time
 EnvironmentView getEnvironmentView(LogicalEnvironment environment)
          Build an EnvironmentView object from a Logical environment instance.
 LogicalEnvironment getLogicalEnvironment(long id)
          Retrieve a logical environment using its entity identifier
 LogicalEnvironment getLogicalEnvironment(java.lang.String key)
          Retrieve a logical environment using its key
 java.util.List getLogicalEnvironments()
          Retrieve all the defained logical environments.
 PhysicalEnvironment getPhysicalEnvironment(long id)
          Retrieve a physical enviornment using its entity identifier
 PhysicalEnvironment getPhysicalEnvironment(java.lang.String key)
          Retrieve a physical environment using its key
 PhysicalEnvironment getPhysicalEnvironmentAtDate(java.lang.String key, java.util.Date configDate)
          Get a view representing physical environment configuration at a specified date
 java.util.List getPhysicalEnvironments()
          Retrieve all the defined physical environments.
 PhysicalEnvironmentTrackingView getPhysicalEnvironmentTrackingView(java.lang.String key, java.util.Date startDate, java.util.Date endDate)
          Get a configuration changes traking view for a specified physical environment on a specified time period (between start date and end date included).
 java.util.List getPreparingDeployments()
          Get all the deployments being in preparation stage at that time
 java.util.List getRealizingDeployments()
          Get all the deployments being in realization stage at that time
 void mapEnvironments(LogicalEnvironment logicalEnv, PhysicalEnvironment physicalEnv)
          Create a new mapping of a logical environment onto a physical one.
 void prepareDeployment(Deployment deployment)
          Start preparation process of a Deployment : this is the second step of deployment lifecycle.
 void realizeDeployment(Deployment deployment)
          Start the realization process of a Deployment : this is a step that must follow the "prepared" state of deployment.
 void saveDeployment(Deployment deployment)
          Save a Deployment informations within datastore (create or update)
 void saveLogicalEnvironment(LogicalEnvironment environment)
          Save a LogicalEnvironment within datastore (create or update)
 void savePhysicalEnvironment(PhysicalEnvironment environment)
          Save a PhysicalEnvironment within datastore (create or update)
 void setDeploymentDao(DeploymentDao deploymentDao)
           
 void setDeploymentRuleSet(DeploymentRuleSet rules)
           
 void setEnvMappingDao(EnvironmentMappingDao envMappingDao)
           
 void setEventPublicationManager(EventPublicationManager publicationManager)
           
 void setIntegrationProcessManager(IntegrationProcessManager processManager)
           
 void setLogicalEnvDao(LogicalEnvironmentDao logicalEnvDao)
           
 void setPhysicalEnvDao(PhysicalEnvironmentDao physicalEnvDao)
           
 void setResourceManager(ResourceManager resourceManager)
           
 void setResourceMappingDao(ResourceMappingDao resourceMappingDao)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultEnvironmentManager

public DefaultEnvironmentManager()
Creates a new instance of DefaultEnvironmentManager.

Method Detail

setDeploymentDao

public void setDeploymentDao(DeploymentDao deploymentDao)
Parameters:
deploymentDao - The DeploymentDao implementation to use

setEnvMappingDao

public void setEnvMappingDao(EnvironmentMappingDao envMappingDao)
Parameters:
envMappingDao - The EnvironmentMappingdao implementation to use

setLogicalEnvDao

public void setLogicalEnvDao(LogicalEnvironmentDao logicalEnvDao)
Parameters:
logicalEnvDao - The LogicalEnvironemntDao implementation to use

setPhysicalEnvDao

public void setPhysicalEnvDao(PhysicalEnvironmentDao physicalEnvDao)
Parameters:
physicalEnvDao - The PhysicalEnvironmentDao implementation to use

setResourceMappingDao

public void setResourceMappingDao(ResourceMappingDao resourceMappingDao)
Parameters:
resourceMappingDao - The ResourceMappingDao implementation to use

setResourceManager

public void setResourceManager(ResourceManager resourceManager)
Parameters:
resourceManager - The ResourceManager implementation to use

setIntegrationProcessManager

public void setIntegrationProcessManager(IntegrationProcessManager processManager)
Parameters:
processManager - The IntegrationProcessManager implementation to use

setEventPublicationManager

public void setEventPublicationManager(EventPublicationManager publicationManager)
Parameters:
publicationManager - The EventPublicationManager implementation to use

setDeploymentRuleSet

public void setDeploymentRuleSet(DeploymentRuleSet rules)
Parameters:
rules - The ruleset managing deployment process workflow

saveLogicalEnvironment

public void saveLogicalEnvironment(LogicalEnvironment environment)
                            throws DuplicateEntityException
Save a LogicalEnvironment within datastore (create or update)

Specified by:
saveLogicalEnvironment in interface EnvironmentManager
Parameters:
environment - The logical environment to save
Throws:
DuplicateEntityException - if an environment with same key already exists

getLogicalEnvironments

public java.util.List getLogicalEnvironments()
Retrieve all the defained logical environments.

Specified by:
getLogicalEnvironments in interface EnvironmentManager
Returns:
A list of org.figure8.join.businessobjects.environment.LogicalEnvironment objects

getLogicalEnvironment

public LogicalEnvironment getLogicalEnvironment(long id)
Retrieve a logical environment using its entity identifier

Specified by:
getLogicalEnvironment in interface EnvironmentManager
Parameters:
id - The unique identifier of environment to retrieve
Returns:
The specified environment or null if not found

getLogicalEnvironment

public LogicalEnvironment getLogicalEnvironment(java.lang.String key)
Retrieve a logical environment using its key

Specified by:
getLogicalEnvironment in interface EnvironmentManager
Parameters:
key - The key of environment to retrieve
Returns:
The specified environment or null if not found

getEnvironmentView

public EnvironmentView getEnvironmentView(LogicalEnvironment environment)
Build an EnvironmentView object from a Logical environment instance. A view is a consolidated object aroung logical environmnet allowing to embbed related infos.

Specified by:
getEnvironmentView in interface EnvironmentManager
Parameters:
environment - The logical environemnt to get a view for
Returns:
The view object representing a logical environment and its consolidated informations.

getEnvironmentMapping

public EnvironmentMapping getEnvironmentMapping(long id)
Retrieve an EnvironmentMapping using its unique identifier

Specified by:
getEnvironmentMapping in interface EnvironmentManager
Parameters:
id - The unique identifier of mapping to retrieve
Returns:
The EnvironmentMapping corresponding to this id or null if no one matches

getEnvironmentMappings

public java.util.List getEnvironmentMappings(LogicalEnvironment environment)
Retrieve all the environment mappings for a LogicalEnvironment through time

Specified by:
getEnvironmentMappings in interface EnvironmentManager
Parameters:
environment - The logical environment to retrieve mappings for
Returns:
A List of EnvironmentMapping objects for this logical environmnet

getEnvironmentMappings

public java.util.List getEnvironmentMappings(PhysicalEnvironment environment)
Retrieve all the environment mappings for a PhysicalEnvironment through time

Specified by:
getEnvironmentMappings in interface EnvironmentManager
Parameters:
environment - The physical environment to retrieve mappings for
Returns:
A list of EnvironmentMapping objects for this physical environment

getEnvironmentMappingAtDate

public EnvironmentMapping getEnvironmentMappingAtDate(LogicalEnvironment environment,
                                                      java.util.Date configDate)
Retrieve EnvironmentMapping that was active for an environment at specified date

Specified by:
getEnvironmentMappingAtDate in interface EnvironmentManager
Parameters:
environment - The LogicalEnvironment to retrieve mapping for
configDate - The date to retrieve active mapping
Returns:
The active EnvironmentMapping at date or null if no one was active

mapEnvironments

public void mapEnvironments(LogicalEnvironment logicalEnv,
                            PhysicalEnvironment physicalEnv)
Create a new mapping of a logical environment onto a physical one. This closes all the other current active environment mappings for this 2 environments.

Specified by:
mapEnvironments in interface EnvironmentManager
Parameters:
logicalEnv - The logical environment to map onto physical
physicalEnv - The physical environment to be mapped with logical

closeEnvironmentMapping

public void closeEnvironmentMapping(EnvironmentMapping mapping)
Closes the specified EnvironmentMapping. This involves deactivating it and removing it from active mapping list within its related logical and physical environments.

Specified by:
closeEnvironmentMapping in interface EnvironmentManager
Parameters:
mapping - The EnvironmentMapping to close

savePhysicalEnvironment

public void savePhysicalEnvironment(PhysicalEnvironment environment)
                             throws DuplicateEntityException
Save a PhysicalEnvironment within datastore (create or update)

Specified by:
savePhysicalEnvironment in interface EnvironmentManager
Parameters:
environment - The physical environment to save
Throws:
DuplicateEntityException - if an environment with same key already exists

getPhysicalEnvironments

public java.util.List getPhysicalEnvironments()
Retrieve all the defined physical environments.

Specified by:
getPhysicalEnvironments in interface EnvironmentManager
Returns:
A list of org.figure8.join.businessobjects.environment.PhysicalEnvironment objects

getPhysicalEnvironment

public PhysicalEnvironment getPhysicalEnvironment(long id)
Retrieve a physical enviornment using its entity identifier

Specified by:
getPhysicalEnvironment in interface EnvironmentManager
Parameters:
id - The unique identifier of environment to retrieve
Returns:
The specified environment or null if not found

getPhysicalEnvironment

public PhysicalEnvironment getPhysicalEnvironment(java.lang.String key)
Retrieve a physical environment using its key

Specified by:
getPhysicalEnvironment in interface EnvironmentManager
Parameters:
key - The key of environment to retrieve
Returns:
The specified environment or null if not found

getPhysicalEnvironmentAtDate

public PhysicalEnvironment getPhysicalEnvironmentAtDate(java.lang.String key,
                                                        java.util.Date configDate)
Get a view representing physical environment configuration at a specified date

Specified by:
getPhysicalEnvironmentAtDate in interface EnvironmentManager
Parameters:
key - The key of environment to retrieve a configuration view for
configDate - The date to get environment configuration
Returns:
A PhysicalEnvironment for requested date

getPhysicalEnvironmentTrackingView

public PhysicalEnvironmentTrackingView getPhysicalEnvironmentTrackingView(java.lang.String key,
                                                                          java.util.Date startDate,
                                                                          java.util.Date endDate)
Get a configuration changes traking view for a specified physical environment on a specified time period (between start date and end date included).

Specified by:
getPhysicalEnvironmentTrackingView in interface EnvironmentManager
Parameters:
key - The key of environment to retrieve a tracking view for
startDate - The date to start the configuration changes tracking
endDate - The date to and the configuration changes tracking
Returns:
A PhysicalEnvrionmentTrakingView for requested tracking period

saveDeployment

public void saveDeployment(Deployment deployment)
Save a Deployment informations within datastore (create or update)

Specified by:
saveDeployment in interface EnvironmentManager
Parameters:
deployment - The deployment information to save

createDeployment

public void createDeployment(Deployment deployment)
                      throws OperationNotAllowedException
Create a Deployment informations : this is the beginning step of a Deployment lifecycle. Following steps may be chained automically or not depending on transitions policy.

Specified by:
createDeployment in interface EnvironmentManager
Parameters:
deployment - The deployment information to create
Throws:
OperationNotAllowedException - if deployment cannot be done depending on workflow rules

prepareDeployment

public void prepareDeployment(Deployment deployment)
Start preparation process of a Deployment : this is the second step of deployment lifecycle.

Specified by:
prepareDeployment in interface EnvironmentManager
Parameters:
deployment - The deployment to start preparation process for

realizeDeployment

public void realizeDeployment(Deployment deployment)
                       throws OperationNotAllowedException
Start the realization process of a Deployment : this is a step that must follow the "prepared" state of deployment.

Specified by:
realizeDeployment in interface EnvironmentManager
Parameters:
deployment - The deployment to start realization process for
Throws:
OperationNotAllowedException - if deployment cannot be realized depending on workflow rules

cancelDeployment

public void cancelDeployment(Deployment deployment,
                             java.lang.String comments)
Cancel a deployment process whether it is in preparation phase or in realization phase.

Specified by:
cancelDeployment in interface EnvironmentManager
Parameters:
deployment - The informations on deployment process to cancel
comments - Comments on deployment cancelling

endDeployment

public void endDeployment(Deployment deployment,
                          java.lang.String comments)
                   throws OperationNotAllowedException
End a deployment process : this is the final step into this process. Deployment will be then into a "done" state.

Specified by:
endDeployment in interface EnvironmentManager
Parameters:
deployment - The informations on deployment process to end
comments - Comments on deployment end
Throws:
OperationNotAllowedException - if deployment cannot be ended depending on workflow rules

getPreparingDeployments

public java.util.List getPreparingDeployments()
Get all the deployments being in preparation stage at that time

Specified by:
getPreparingDeployments in interface EnvironmentManager
Returns:
A list of Deployments having a status corresponding to preparation process

getRealizingDeployments

public java.util.List getRealizingDeployments()
Get all the deployments being in realization stage at that time

Specified by:
getRealizingDeployments in interface EnvironmentManager
Returns:
A list of Deployments having a status corresponding to realization process

getDeployments

public java.util.List getDeployments(LogicalEnvironment environment)
Retrieve all the deployments realized for a logical environment

Specified by:
getDeployments in interface EnvironmentManager
Parameters:
environment - The LogicalEnvironment we wants deployments for
Returns:
A list of Deployments done for the specified logical environment

getDeployments

public java.util.List getDeployments(PhysicalEnvironment environment)
Retrieve all the deployments realized onto a physical environment

Specified by:
getDeployments in interface EnvironmentManager
Parameters:
environment - The PhysicalEnvironment we want deployments for
Returns:
A list of Deployments done onto the specified physical environment

getDeployment

public Deployment getDeployment(long id)
Retrieve a Deployment using its unique identifier

Specified by:
getDeployment in interface EnvironmentManager
Parameters:
id - The identifier of deployment to retrieve
Returns:
The corresponding deployment or null if no deployment has this identifier


Copyright © 2005-2008 Join. All Rights Reserved.