com.atlassian.jira.bc.scheme.distiller
Interface SchemeDistillerService

All Known Implementing Classes:
DefaultSchemeDistillerService

public interface SchemeDistillerService

This is a service wrapper around the manager implementation. All validation will be carried out in the service.


Method Summary
 DistilledSchemeResults distillSchemes(com.atlassian.crowd.embedded.api.User user, Collection schemes, ErrorCollection errorCollection)
          This method does the work of analyzing and distilling, if possible, the passed in Scheme's.
 SchemeRelationships getSchemeRelationships(com.atlassian.crowd.embedded.api.User user, DistilledSchemeResults distilledSchemeResults, ErrorCollection errorCollection)
          This method will return a SchemeRelationships object for the internal collections of distilled scheme results.
 void isValidNewSchemeName(com.atlassian.crowd.embedded.api.User user, String fieldName, String newSchemeName, String schemeType, ErrorCollection errorCollection)
          This method checks if the new scheme name passed in already exists.
 Scheme persistNewSchemeMappings(com.atlassian.crowd.embedded.api.User user, DistilledSchemeResult distilledSchemeResult, ErrorCollection errorCollection)
          This method will persist the result of the 'distilling' operation.
 

Method Detail

distillSchemes

DistilledSchemeResults distillSchemes(com.atlassian.crowd.embedded.api.User user,
                                      Collection schemes,
                                      ErrorCollection errorCollection)
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(com.atlassian.crowd.embedded.api.User user,
                                DistilledSchemeResult distilledSchemeResult,
                                ErrorCollection errorCollection)
                                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(com.atlassian.crowd.embedded.api.User user,
                                           DistilledSchemeResults distilledSchemeResults,
                                           ErrorCollection errorCollection)
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.

isValidNewSchemeName

void isValidNewSchemeName(com.atlassian.crowd.embedded.api.User user,
                          String fieldName,
                          String newSchemeName,
                          String schemeType,
                          ErrorCollection errorCollection)
This method checks if the new scheme name passed in already exists. If the scheme name exists an error will be added to the error collection. The error will be added for the passed in fieldName if it is non-null.

Parameters:
newSchemeName -


Copyright © 2002-2014 Atlassian. All Rights Reserved.