org.figure8.join.businessobjects.artifact
Class DeliverableType

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

public class DeliverableType
extends SortableEntityObject

Entity object representing a deliverable type. Such a type helps categorizing work deliveries done and managed through Join application.
A deliverable type will help by knowing how to generate unique keys for deliverable artifacts. (see the generateDeliverableKey() method)
It is also a handler for all the connection informations to the underlying Versionning and Configuration System ; in the case such a system is used for retrieving deliverables. (see the getVCSAccessor() method)

Version:
$Revision: 1.3 $
Author:
Laurent Broudoux
See Also:
VCSAccessor, Serialized Form

Constructor Summary
DeliverableType()
          Creates a new instance of DeliverableType
DeliverableType(java.lang.String key, java.lang.String label, java.lang.String keyTemplate, boolean versionable, boolean mandatory)
          Creates a new instance of DeliverableType with mandatory attributes
 
Method Summary
 java.lang.String generateDeliverableKey(Deliverable deliverable)
          Generate a unique key for a deliverable.
 java.lang.String getKey()
           
 java.lang.String getKeyTemplate()
           
 java.lang.String getLabel()
           
 boolean getMandatory()
           
 java.lang.String getStringForComparison()
          Get the comparision criterion as a string.
 VCSAccessor getVCSAccessor()
          Get the VCSAccessor associated to this type (if any).
 java.lang.String getVcsAccessorClass()
           
 boolean getVcsDeliverable()
           
 java.lang.String getVcsModule()
           
 java.lang.String getVcsPassword()
           
 java.lang.String getVcsRoot()
           
 java.lang.String getVcsUser()
           
 boolean getVersionable()
           
protected  void instantiateVCSAccessor()
          Try to instantiate the VCSAccessor associated with this type (if any ...)
 void setKey(java.lang.String key)
           
 void setKeyTemplate(java.lang.String keyTemplate)
          The template used for deliverables key generation.
 void setLabel(java.lang.String label)
           
 void setMandatory(boolean mandatory)
           
 void setVcsAccessorClass(java.lang.String vcsAccessorClass)
          Assign a VCS implementation to this deliverable type. ie : an helper object that allows to connect to the version and configuration system used for retrieving deliverables of this type.
 void setVcsDeliverable(boolean vcsDeliverable)
           
 void setVcsModule(java.lang.String vcsModule)
           
 void setVcsPassword(java.lang.String vcsPassword)
           
 void setVcsRoot(java.lang.String vcsRoot)
           
 void setVcsUser(java.lang.String vcsUser)
           
 void setVersionable(boolean versionable)
           
 
Methods inherited from class org.figure8.join.core.SortableEntityObject
compareTo
 
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
 

Constructor Detail

DeliverableType

public DeliverableType()
Creates a new instance of DeliverableType


DeliverableType

public DeliverableType(java.lang.String key,
                       java.lang.String label,
                       java.lang.String keyTemplate,
                       boolean versionable,
                       boolean mandatory)
Creates a new instance of DeliverableType with mandatory attributes

Parameters:
key - The instance unique key
label - The type instance label
keyTemplate - The deliverable type template for key generation
versionable - Wether deliverables should appear in versions
mandatory - Wether deliverables are mandatory in version composition
See Also:
Assembly
Method Detail

getKey

public java.lang.String getKey()
Returns:
This deliverable type key

setKey

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

getLabel

public java.lang.String getLabel()
Returns:
This type label for display

setLabel

public void setLabel(java.lang.String label)
Parameters:
label - This deliverable type label

getKeyTemplate

public java.lang.String getKeyTemplate()
Returns:
The template used for generating deliverable keys

setKeyTemplate

public void setKeyTemplate(java.lang.String keyTemplate)
The template used for deliverables key generation. This template should be a string representing a MessageFormat with 2 arguments. (ex: myDeliverable_r{0}_v{1})

Parameters:
keyTemplate - MessageFormat template
See Also:
MessageFormat

getVersionable

public boolean getVersionable()
Returns:
true if deliverables of this type should be used for composing a Assembly
See Also:
Assembly

setVersionable

public void setVersionable(boolean versionable)
Parameters:
versionable - Wether deliverables are used for composing Versions

getMandatory

public boolean getMandatory()
Returns:
true if deliverables of this type are mandatory when used for composing a Assembly
See Also:
Assembly

setMandatory

public void setMandatory(boolean mandatory)
Parameters:
mandatory - Wether deliverables are mandatory whe composing Versions

getVcsDeliverable

public boolean getVcsDeliverable()
Returns:
true if deliverables of this type are retrieved using a version and configuration system (such as CVS, Subversion, ...)

setVcsDeliverable

public void setVcsDeliverable(boolean vcsDeliverable)
Parameters:
vcsDeliverable - Wether deliverables are retrieved using a version and configuration system

getVcsUser

public java.lang.String getVcsUser()
Returns:
The user for connecting to version and configuration system

setVcsUser

public void setVcsUser(java.lang.String vcsUser)
Parameters:
vcsUser - The user for connecting to VCS

getVcsPassword

public java.lang.String getVcsPassword()
Returns:
The password for connecting to version and configuration system

setVcsPassword

public void setVcsPassword(java.lang.String vcsPassword)
Parameters:
vcsPassword - The password for connection to VCS

getVcsRoot

public java.lang.String getVcsRoot()
Returns:
The root of version and configuration system used (might be a CVS root, a Subversion Url, etc ...)

setVcsRoot

public void setVcsRoot(java.lang.String vcsRoot)
Parameters:
vcsRoot - The root of VCS used (CVS root, SVN Url, ...)

getVcsModule

public java.lang.String getVcsModule()
Returns:
Name of module corresponding to deliverables in VCS (CVS module, "trunk" for Subversion, etc ..)

setVcsModule

public void setVcsModule(java.lang.String vcsModule)
Parameters:
vcsModule - Name of module corresponding to deliverables in VCS

getVcsAccessorClass

public java.lang.String getVcsAccessorClass()
Returns:
The FQN of the Java class used for connecting version and configuration system corresponding to this type

setVcsAccessorClass

public void setVcsAccessorClass(java.lang.String vcsAccessorClass)
                         throws InvalidParameterException
Assign a VCS implementation to this deliverable type. ie : an helper object that allows to connect to the version and configuration system used for retrieving deliverables of this type. This parameter must be the name of the Java class that implements org.figure8.join.services.vcs.VCSAccessor

Parameters:
vcsAccessorClass - FQN of Java class
Throws:
InvalidParameterException - if the vcsImplementationClass is not valid

getVCSAccessor

public VCSAccessor getVCSAccessor()
                           throws InvalidParameterException
Get the VCSAccessor associated to this type (if any). The returned accessor is "ready to use" : it has been initialized with corret properties.

Returns:
The accessor instance or null if no accessor is associated to this role
Throws:
InvalidParameterException - if the vcsAccessorClass inner field is not valid

generateDeliverableKey

public java.lang.String generateDeliverableKey(Deliverable deliverable)
Generate a unique key for a deliverable. Such a key has to be unique as specified by the Artifact. So this implementation is using the given keyTemplate as a java.text.MessageFormat using 2 arguments that are the deliverable release name (unique for a relase) and the deliverable version infos (unique for a deliverable within a release).

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

instantiateVCSAccessor

protected void instantiateVCSAccessor()
                               throws InvalidParameterException
Try to instantiate the VCSAccessor associated with this type (if any ...)

Throws:
InvalidParameterException - if the vcsAccessorClass inner field is not valid

getStringForComparison

public java.lang.String getStringForComparison()
Get the comparision criterion as a string. Display label here.

Specified by:
getStringForComparison in class SortableEntityObject
Returns:
The string representation of comparison and sort cirterion


Copyright © 2005-2008 Join. All Rights Reserved.