com.atlassian.jira.bc.scheme.distiller
Class DefaultSchemeDistillerService

java.lang.Object
  extended by com.atlassian.jira.bc.scheme.distiller.DefaultSchemeDistillerService
All Implemented Interfaces:
SchemeDistillerService

public class DefaultSchemeDistillerService
extends Object
implements SchemeDistillerService


Constructor Summary
DefaultSchemeDistillerService(SchemeDistiller schemeDistiller, SchemeManagerFactory schemeManagerFactory, PermissionManager permissionManager, JiraAuthenticationContext jiraAuthenticationContext, SchemeFactory schemeFactory)
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultSchemeDistillerService

public DefaultSchemeDistillerService(SchemeDistiller schemeDistiller,
                                     SchemeManagerFactory schemeManagerFactory,
                                     PermissionManager permissionManager,
                                     JiraAuthenticationContext jiraAuthenticationContext,
                                     SchemeFactory schemeFactory)
Method Detail

distillSchemes

public DistilledSchemeResults distillSchemes(com.atlassian.crowd.embedded.api.User user,
                                             Collection schemes,
                                             ErrorCollection errorCollection)
Description copied from interface: SchemeDistillerService
This method does the work of analyzing and distilling, if possible, the passed in Scheme's.

Specified by:
distillSchemes in interface SchemeDistillerService
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

public Scheme persistNewSchemeMappings(com.atlassian.crowd.embedded.api.User user,
                                       DistilledSchemeResult distilledSchemeResult,
                                       ErrorCollection errorCollection)
                                throws DataAccessException
Description copied from interface: SchemeDistillerService
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.

Specified by:
persistNewSchemeMappings in interface SchemeDistillerService
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

public SchemeRelationships getSchemeRelationships(com.atlassian.crowd.embedded.api.User user,
                                                  DistilledSchemeResults distilledSchemeResults,
                                                  ErrorCollection errorCollection)
Description copied from interface: SchemeDistillerService
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.

Specified by:
getSchemeRelationships in interface SchemeDistillerService
Returns:
a collection of SchemeRelationships objects.

isValidNewSchemeName

public void isValidNewSchemeName(com.atlassian.crowd.embedded.api.User user,
                                 String fieldName,
                                 String newSchemeName,
                                 String schemeType,
                                 ErrorCollection errorCollection)
Description copied from interface: SchemeDistillerService
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.

Specified by:
isValidNewSchemeName in interface SchemeDistillerService


Copyright © 2002-2013 Atlassian. All Rights Reserved.