org.figure8.join.businessobjects.artifact
Class Build

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

public class Build
extends EntityObject
implements Artifact

A build if a composite artifact build from components. It represents a version of the software system you are building.
Builds are meant for being deployed on production environnements.

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

Field Summary
static java.lang.String DEFAULT_KEY_TEMPLATE
          Constant for the default builds 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 build keys
 
Constructor Summary
Build()
          Creates a new instance of Build
Build(java.lang.String versionInfo, java.lang.String comments, java.lang.String composerId, Release release)
          Creates a new instance of Build with mandatory attributes
 
Method Summary
 void addComponent(Component component)
          Convenient method for adding a components to a build.
protected static java.lang.String generateBuildKey(Build build)
          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()
           
 java.util.Map getComponents()
           
 java.lang.String getComposerId()
           
 java.util.Date getCreationDate()
           
 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 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 build keys

See Also:
Constant Field Values

DEFAULT_KEY_TEMPLATE

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

See Also:
Constant Field Values
Constructor Detail

Build

public Build()
Creates a new instance of Build


Build

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

Parameters:
versionInfo - Information of this build 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 build unique key

setKey

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

getComments

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

setComments

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

setVersionInfo

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

getCreationDate

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

setCreationDate

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

getComposerId

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

setComposerId

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

getStatus

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

setStatus

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

setRelease

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

getComponents

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

setComponents

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

addComponent

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

Parameters:
component - The component to add to 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

generateBuildKey

protected static java.lang.String generateBuildKey(Build build)
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 build release name (unique for a relase) and the build version infos (unique for a build within a release).
The template used as MessageFormat can be specified using the build.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:
build - Build for whom a key should be generated
Returns:
A unique key corresponding to this build. The key is not assigned to build.
See Also:
MessageFormat, Artifact


Copyright © 2005-2008 Join. All Rights Reserved.