org.figure8.join.businessobjects.artifact
Class Assembly

java.lang.Object
  extended by org.figure8.join.core.EntityObject
      extended by org.figure8.join.businessobjects.artifact.Assembly
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Artifact

public class Assembly
extends EntityObject
implements Artifact

An assembly if a composite artifact build from deliverables. It represents a subset of the future software system you are building.
During the construction phase of Assembly, software components are discovered and thus bound to this entity.
Assemblies are meant for being deployed on test environments.

Version:
$Revision: 1.4 $
Author:
Laurent Broudoux
See Also:
Serialized Form

Field Summary
static java.lang.String DEFAULT_KEY_TEMPLATE
          Constant for the default assemblies key generation template (in case we are not in managed environment)
static java.lang.String KEY_TEMPLATE
          Constant denoting the applicative property defining the template for assemblies key
 
Constructor Summary
Assembly()
          Creates a new instance of Assembly
Assembly(java.lang.String versionInfo, java.lang.String comments, java.lang.String composerId, Release release)
          Creates a new instance of Assembly with mandatory attributes.
 
Method Summary
 void addComponent(Component component)
          Convenient method for adding a components to an assembly.
 void addDeliverable(Deliverable deliverable)
          Convenient method for adding a deliverable to an assembly.
protected static java.lang.String generateAssemblyKey(Assembly assembly)
          Generate a unique key for an assembly.
 java.lang.String getCategoryInfo()
          Return the category information on this artifact (or null is this artifact implementation is not typed).
 java.lang.String getComments()
           
 Component getComponent(ComponentType type)
          Convenient method for retrieving only one component contained assembly
 java.util.Map getComponents()
           
 java.lang.String getComposerId()
           
 java.util.Date getCreationDate()
           
 Deliverable getDeliverable(DeliverableType type)
          Convenient method for retrieving only one deliverable composing assembly
 java.util.Map getDeliverables()
           
 java.util.List getDeployments()
           
 java.lang.String getKey()
           
 Release getRelease()
          Retrieve the release that has cause this version creation
 Status getStatus()
           
 java.lang.String getUniqueId()
          Retrieve the unique identifier of this artifact.
 java.lang.String getVersionInfo()
          Retrieve the version information on this Assembly.
 void setComments(java.lang.String comments)
           
 void setComponents(java.util.Map components)
           
 void setComposerId(java.lang.String composerId)
           
 void setCreationDate(java.util.Date creationDate)
           
 void setDeliverables(java.util.Map deliverables)
           
 void setDeployments(java.util.List deployments)
           
 void setKey(java.lang.String key)
           
 void setRelease(Release release)
           
 void setStatus(Status status)
           
 void setVersionInfo(java.lang.String versionInfo)
           
 
Methods inherited from class org.figure8.join.core.EntityObject
clone, equals, getId, hashCode, isTransient
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY_TEMPLATE

public static final java.lang.String KEY_TEMPLATE
Constant denoting the applicative property defining the template for assemblies key

See Also:
Constant Field Values

DEFAULT_KEY_TEMPLATE

public static final java.lang.String DEFAULT_KEY_TEMPLATE
Constant for the default assemblies key generation template (in case we are not in managed environment)

See Also:
Constant Field Values
Constructor Detail

Assembly

public Assembly()
Creates a new instance of Assembly


Assembly

public Assembly(java.lang.String versionInfo,
                java.lang.String comments,
                java.lang.String composerId,
                Release release)
Creates a new instance of Assembly with mandatory attributes.

Parameters:
versionInfo - Information of this assembly version
comments - Comments onto assembly
composerId - The identifier of user that has compoed assembly
release - The release for which assembly is created
Method Detail

getKey

public java.lang.String getKey()
Returns:
This assembly unique key

setKey

public void setKey(java.lang.String key)
Parameters:
key - This assembly unique key

getComments

public java.lang.String getComments()
Returns:
The comments on this Assembly

setComments

public void setComments(java.lang.String comments)
Parameters:
comments - The comments on this assembly

setVersionInfo

public void setVersionInfo(java.lang.String versionInfo)
Parameters:
versionInfo - Information on this assembly version within release

getCreationDate

public java.util.Date getCreationDate()
Returns:
Creation date of this version

setCreationDate

public void setCreationDate(java.util.Date creationDate)
Parameters:
creationDate - The creation date of this assembly

getComposerId

public java.lang.String getComposerId()
Returns:
The id of user that composes assembly

setComposerId

public void setComposerId(java.lang.String composerId)
Parameters:
composerId - The id of user that has composed this assembly

getStatus

public Status getStatus()
Returns:
The current status of this Assembly

setStatus

public void setStatus(Status status)
Parameters:
status - The current status of this assembly

setRelease

public void setRelease(Release release)
Parameters:
release - Release this assembly has been done for

getComponents

public java.util.Map getComponents()
Returns:
A map of components contained in assembly, keys are component types.

setComponents

public void setComponents(java.util.Map components)
Parameters:
components - A map of components contained in assembly

addComponent

public void addComponent(Component component)
Convenient method for adding a components to an assembly. This method manages the 2 sides of the association.

Parameters:
component - The component to add to assembly

getComponent

public Component getComponent(ComponentType type)
Convenient method for retrieving only one component contained assembly

Parameters:
type - The ComponentType of component to return
Returns:
The corresponding Component

getDeliverables

public java.util.Map getDeliverables()
Returns:
A map of deliverables contained in assembly, keys are deliverable types.

setDeliverables

public void setDeliverables(java.util.Map deliverables)
Parameters:
deliverables - A map of deliverables contained in assembly, keys are deliverable types

addDeliverable

public void addDeliverable(Deliverable deliverable)
Convenient method for adding a deliverable to an assembly. This method manages the 2 sides of the association.

Parameters:
deliverable - The deliverable to add to assembly

getDeliverable

public Deliverable getDeliverable(DeliverableType type)
Convenient method for retrieving only one deliverable composing assembly

Parameters:
type - The DeliverableType of deliverable to return
Returns:
The corresponding Deliverable

getDeployments

public java.util.List getDeployments()
Returns:
A set of Deployments made with this assembly

setDeployments

public void setDeployments(java.util.List deployments)
Parameters:
deployments - The set of deployments made with this assembly

getUniqueId

public java.lang.String getUniqueId()
Retrieve the unique identifier of this artifact. (ie : it's key)

Specified by:
getUniqueId in interface Artifact
Returns:
The unique identifier of this version

getVersionInfo

public java.lang.String getVersionInfo()
Retrieve the version information on this Assembly.

Specified by:
getVersionInfo in interface Artifact
Returns:
Version information as character string

getCategoryInfo

public java.lang.String getCategoryInfo()
Return the category information on this artifact (or null is this artifact implementation is not typed).

Specified by:
getCategoryInfo in interface Artifact
Returns:
The category information as character string

getRelease

public Release getRelease()
Retrieve the release that has cause this version creation

Specified by:
getRelease in interface Artifact
Returns:
The release this version has been realized for

generateAssemblyKey

protected static java.lang.String generateAssemblyKey(Assembly assembly)
Generate a unique key for an assembly. Such a key has to be unique as specified by the Artifact. So this implementation is using a java.text.MessageFormat using 2 arguments that are the assembly release name (unique for a relase) and the assembly version infos (unique for an assembly within a release).
The template used as MessageFormat can be specified using the assembly.key.template property of ApplicationConfig object present into runtime environment. If this property or ApplicationConfig are not present ito environment, then the default key template is used.

Parameters:
assembly - Assembly for whom a key should be generated
Returns:
A unique key corresponding to this assembly. The key is not assigned to assembly.
See Also:
MessageFormat, Artifact


Copyright © 2005-2008 Join. All Rights Reserved.