org.figure8.join.businessfacades.artifact
Class DefaultArtifactManager

java.lang.Object
  extended by org.figure8.join.businessfacades.artifact.DefaultArtifactManager
All Implemented Interfaces:
ArtifactManager

public class DefaultArtifactManager
extends java.lang.Object
implements ArtifactManager

This is the default implementation of ArtifactManager.

Version:
$Revision: 1.3 $
Author:
Laurent Broudoux

Field Summary
protected  ComponentDao componentDao
          Component data access object
protected  ComponentTypeDao componentTypeDao
          Component type data access object
protected  DeliverableDao deliverableDao
          Deliverable data access object
protected  Repository deliverablesRepository
          The Repository implementation to use for storing deliverables
protected  DeliverableTypeDao deliverableTypeDao
          Deliverable type data access object
protected  EventPublicationManager publicationManager
          The event publication manager implementation for reporting events
 
Constructor Summary
DefaultArtifactManager()
          Creates a new instance of DefaultArtifactManager
 
Method Summary
 void bindComponent(Component component, Assembly assembly)
          Bind a component to an existing assembly.
 Component getComponent(java.lang.String key)
          Get a component having this specified key.
 java.util.List getComponents(ComponentType type, Release release)
          Retrieve a list of components corresponding to the specified type and created into release
 ComponentType getComponentType(java.lang.String key)
          Get a component category having the specified key.
 java.util.List getComponentTypes()
          Retrieve the component types (or category) of software.
 java.util.List getContainedComponents(ComponentType type, Release release)
          Retrieve a list of components of the specified type and contained into release
 Deliverable getDeliverable(java.lang.String key)
          Get a deliverable having this specified key.
 java.util.List getDeliverables(DeliverableType type, Release release)
          Retrieve a list of deliverables corresponding to the specified type for this release
 DeliverableType getDeliverableType(java.lang.String key)
          Get a deliverable category having the specified key.
 java.util.List getDeliverableTypes()
          Retrieve the deliverable types (or category) of software.
 java.util.List getLastDeliverables(DeliverableType type, int maxResult)
          Retrieve a list of deliverables corresponding to the specified type
 void registerDeliverable(Deliverable deliverable, java.io.InputStream content)
          Create a deliverable within datastore and register its content.
 void saveComponentType(ComponentType type)
          Save a component type within datastore
 void saveDeliverable(Deliverable deliverable)
          Save a deliverable within datastore.
 void saveDeliverableType(DeliverableType type)
          Save a deliverable type within datastore.
 void setComponentDao(ComponentDao dao)
           
 void setComponentTypeDao(ComponentTypeDao dao)
           
 void setDeliverableDao(DeliverableDao dao)
           
 void setDeliverablesRepository(Repository repository)
          Set the repository to use for storing deliverables.
 void setDeliverableTypeDao(DeliverableTypeDao dao)
           
 void setEventPublicationManager(EventPublicationManager manager)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

componentDao

protected ComponentDao componentDao
Component data access object


deliverableDao

protected DeliverableDao deliverableDao
Deliverable data access object


componentTypeDao

protected ComponentTypeDao componentTypeDao
Component type data access object


deliverableTypeDao

protected DeliverableTypeDao deliverableTypeDao
Deliverable type data access object


publicationManager

protected EventPublicationManager publicationManager
The event publication manager implementation for reporting events


deliverablesRepository

protected Repository deliverablesRepository
The Repository implementation to use for storing deliverables

Constructor Detail

DefaultArtifactManager

public DefaultArtifactManager()
Creates a new instance of DefaultArtifactManager

Method Detail

setComponentDao

public void setComponentDao(ComponentDao dao)
Parameters:
dao - A Component data access object

setDeliverableDao

public void setDeliverableDao(DeliverableDao dao)
Parameters:
dao - A Deliverable data access object

setComponentTypeDao

public void setComponentTypeDao(ComponentTypeDao dao)
Parameters:
dao - A Component type data access object

setDeliverableTypeDao

public void setDeliverableTypeDao(DeliverableTypeDao dao)
Parameters:
dao - A Deliverable type data access object

setEventPublicationManager

public void setEventPublicationManager(EventPublicationManager manager)
Parameters:
manager - A Event publication manager implementation instance

bindComponent

public void bindComponent(Component component,
                          Assembly assembly)
Bind a component to an existing assembly. If component is not already registered, create it. And update its reference assembly (the one that first contains the component)

Specified by:
bindComponent in interface ArtifactManager
Parameters:
component - The component to bind to assembly
assembly - The assembly that is containing component

getComponent

public Component getComponent(java.lang.String key)
Get a component having this specified key.

Specified by:
getComponent in interface ArtifactManager
Parameters:
key - Unique business identifier of component to retrieve
Returns:
The component having this business key

getComponents

public java.util.List getComponents(ComponentType type,
                                    Release release)
Retrieve a list of components corresponding to the specified type and created into release

Specified by:
getComponents in interface ArtifactManager
Parameters:
type - The component type of the components to retrieve
release - The release the components have been bound to
Returns:
A list of org.figure8.join.businessobjects.artifact.Components

getContainedComponents

public java.util.List getContainedComponents(ComponentType type,
                                             Release release)
Retrieve a list of components of the specified type and contained into release

Specified by:
getContainedComponents in interface ArtifactManager
Parameters:
type - The component type of the components to retrieve
release - The release the components have been bound to
Returns:
A list of org.figure8.join.businessobjects.artifact.Components

saveComponentType

public void saveComponentType(ComponentType type)
                       throws DuplicateEntityException
Save a component type within datastore

Specified by:
saveComponentType in interface ArtifactManager
Parameters:
type - Type to save (create or update)
Throws:
DuplicateEntityException - if another type with same key already exists

getComponentType

public ComponentType getComponentType(java.lang.String key)
Get a component category having the specified key.

Specified by:
getComponentType in interface ArtifactManager
Parameters:
key - Unique business identifier of the component type to retrieve
Returns:
ComponentType having this key

getComponentTypes

public java.util.List getComponentTypes()
Retrieve the component types (or category) of software.

Specified by:
getComponentTypes in interface ArtifactManager
Returns:
List of available org.figure8.join.businessobjects.artifact.ComponentType

registerDeliverable

public void registerDeliverable(Deliverable deliverable,
                                java.io.InputStream content)
                         throws InvalidParameterException,
                                DuplicateEntityException
Create a deliverable within datastore and register its content. The stream parameter may be null if deliverable content should be retrievied through a SCM extraction or some other mean ...

Specified by:
registerDeliverable in interface ArtifactManager
Parameters:
deliverable - The new deliverable to register within Join application
content - The stream containing deliverable content (if any)
Throws:
InvalidParameterException - if deliverable is already registered
DuplicateEntityException - if another deliverable with same key already exists

saveDeliverable

public void saveDeliverable(Deliverable deliverable)
                     throws InvalidParameterException
Save a deliverable within datastore. This method should be used only for updating existing deliverables. They must have been first created using the registerDeliverable() method.

Specified by:
saveDeliverable in interface ArtifactManager
Parameters:
deliverable - The deliverable to save (just an update)
Throws:
InvalidParameterException - if deliverable has not been registered before

getDeliverable

public Deliverable getDeliverable(java.lang.String key)
Get a deliverable having this specified key.

Specified by:
getDeliverable in interface ArtifactManager
Parameters:
key - Unique business identifier of deliverable to retrieve
Returns:
The deliverable having this business key

getLastDeliverables

public java.util.List getLastDeliverables(DeliverableType type,
                                          int maxResult)
Retrieve a list of deliverables corresponding to the specified type

Specified by:
getLastDeliverables in interface ArtifactManager
Parameters:
type - The deliverable type of the deliverables to retrieve
maxResult - An int to limit the size of list returned
Returns:
A list of org.figure8.join.businessobjects.artifact.Deliverables

getDeliverables

public java.util.List getDeliverables(DeliverableType type,
                                      Release release)
Retrieve a list of deliverables corresponding to the specified type for this release

Specified by:
getDeliverables in interface ArtifactManager
Parameters:
type - The deliverable type of the deliverables to retrieve
release - The release the deliverables have been bound to
Returns:
A list of org.figure8.join.businessobjects.artifact.Deliverables

setDeliverablesRepository

public void setDeliverablesRepository(Repository repository)
Set the repository to use for storing deliverables. This repository is necessary when registering a new Deliverables.

Specified by:
setDeliverablesRepository in interface ArtifactManager
Parameters:
repository - The repository for storing deliverables content

saveDeliverableType

public void saveDeliverableType(DeliverableType type)
                         throws DuplicateEntityException
Save a deliverable type within datastore. If type is a newly created type, its key should a non existing one. Otherwise, a DuplicateEntityException will thrown. If type is already existing, the key is an immutable field an a runtime exception exception will be thrown if it has changed.

Specified by:
saveDeliverableType in interface ArtifactManager
Parameters:
type - Type to save (create or update)
Throws:
DuplicateEntityException - if another type with same key already exists

getDeliverableType

public DeliverableType getDeliverableType(java.lang.String key)
Get a deliverable category having the specified key.

Specified by:
getDeliverableType in interface ArtifactManager
Parameters:
key - Unique business identifier of the deliverable type to retrieve
Returns:
DeliverableType having this key

getDeliverableTypes

public java.util.List getDeliverableTypes()
Retrieve the deliverable types (or category) of software.

Specified by:
getDeliverableTypes in interface ArtifactManager
Returns:
List of available org.figure8.join.businessobjects.artifact.DeliverableType


Copyright © 2005-2008 Join. All Rights Reserved.