com.atlassian.jira.scheme.distiller
Interface SchemeDistiller

All Known Implementing Classes:
SchemeDistillerImpl

public interface SchemeDistiller

This defines a interface for an object that is able to take a collection of Scheme objects and determine if these objects are the same (i.e. - all the SchemeEntity's in the scheme are the same). This will then take all the same schemes and create a new 'distilled' scheme from these. This object will then be able to persist this new scheme and update all project associations from the original 'undistilled' schemes to the newly created 'distilled' scheme.


Method Summary
 DistilledSchemeResults distillSchemes(Collection schemes)
          This method does the work of analyzing and distilling, if possible, the passed in Scheme's.
 SchemeRelationships getSchemeRelationships(DistilledSchemeResults distilledSchemeResults)
          This method will return a SchemeRelationships object for the internal collections of distilled scheme results.
 Scheme persistNewSchemeMappings(DistilledSchemeResult distilledSchemeResult)
          This method will persist the result of the 'distilling' operation.
 

Method Detail

distillSchemes

DistilledSchemeResults distillSchemes(Collection schemes)
This method does the work of analyzing and distilling, if possible, the passed in Scheme's.

Parameters:
schemes - a collection of Scheme objects representing the schemes that you would like to try to 'distill'.
Returns:
a DistilledSchemeResults object which represent the result of the 'distilling' operation. There will be one DistilledSchemeResults for each successfully distilled set of schemes. You can access the 'undistilled' schemes via the object See the javadoc for DistilledSchemeResults for full details. The object will contain empty collections if null or an empty collection is passed in.

persistNewSchemeMappings

Scheme persistNewSchemeMappings(DistilledSchemeResult distilledSchemeResult)
                                throws DataAccessException
This method will persist the result of the 'distilling' operation. The newly created scheme will be saved to persistent store and the project associations will be updated to point to the new scheme.

Parameters:
distilledSchemeResult -
Returns:
the new Scheme that was created and assoicated. This will return a null scheme if the DistilledSchemeResult.getType() is not of a Notification or Permission type.
Throws:
DataAccessException - if something goes wrong at the db level.

getSchemeRelationships

SchemeRelationships getSchemeRelationships(DistilledSchemeResults distilledSchemeResults)
This method will return a SchemeRelationships object for the internal collections of distilled scheme results. These will show if each scheme entity type matches each other, or not at all.

Parameters:
distilledSchemeResults -
Returns:
a collection of SchemeRelationships objects.


Copyright © 2002-2008 Atlassian. All Rights Reserved.