com.atlassian.crowd.migration.legacy
Class PartialXmlMapper

java.lang.Object
  extended by com.atlassian.crowd.migration.GenericMapper
      extended by com.atlassian.crowd.migration.legacy.XmlMapper
          extended by com.atlassian.crowd.migration.legacy.PartialXmlMapper
Direct Known Subclasses:
GroupMapper, MembershipMapper, UserMapper

public class PartialXmlMapper
extends XmlMapper

Specialises XmlMapper for mappers that take into account just a subset of the directory types. Subclasses may override getFullBackupDirectoryTypes to specify which directory types participate in the backup, otherwise a default Set is used containing internal and delegating directory types.


Field Summary
 
Fields inherited from class com.atlassian.crowd.migration.legacy.XmlMapper
GENERIC_XML_ACTIVE, GENERIC_XML_ATTRIBUTE, GENERIC_XML_ATTRIBUTE_NAME, GENERIC_XML_ATTRIBUTE_VALUE, GENERIC_XML_ATTRIBUTES, GENERIC_XML_CREATED_DATE, GENERIC_XML_ID, GENERIC_XML_NAME, GENERIC_XML_UPDATED_DATE, LEGACY_GENERIC_XML_ATTRIBUTE_ID, LEGACY_GENERIC_XML_ATTRIBUTE_KEY, LEGACY_GENERIC_XML_ATTRIBUTE_VALUE, LEGACY_GENERIC_XML_ATTRIBUTE_VALUES, LEGACY_GENERIC_XML_CONCEPTION, LEGACY_GENERIC_XML_LASTMODIFIED
 
Fields inherited from class com.atlassian.crowd.migration.GenericMapper
DATABASE_DATE_FORMAT, logger, PLUGIN_KEY_PREFIX, XML_DATE_FORMAT
 
Constructor Summary
PartialXmlMapper(org.hibernate.SessionFactory sessionFactory, BatchProcessor batchProcessor, DirectoryManager directoryManager, Set<DirectoryType> includedDirectoryTypes)
           
 
Method Summary
protected  List<Directory> findAllExportableDirectories()
          Finds all directories that have user/group/membership data that need to be exported (ie.
protected  boolean isExportOfNonLocalGroupsRequired(DirectoryType directoryType)
          Determines whether the backup for a directory type includes all groups (both local and non-local), or just local groups, excluding non-local (remote) groups.
protected  boolean isImportableDirectory(Directory directory)
           
 
Methods inherited from class com.atlassian.crowd.migration.legacy.XmlMapper
exportInternalEntity, exportSingleValuedAttributes, getInternalEntityTemplateFromXml, getSingleValuedAttributesMapFromXml
 
Methods inherited from class com.atlassian.crowd.migration.GenericMapper
addEntities, addEntity, addEntityViaMerge, addEntityViaSave, getAttributeValue, getDateAsFormattedString, getDateFromDatabase, getDateFromXml, getDirectoryTypeFromLegacyCode, getNameFromLegacyCode, getOperationTypeFromLegacyPermissionName, getSessionFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PartialXmlMapper

public PartialXmlMapper(org.hibernate.SessionFactory sessionFactory,
                        BatchProcessor batchProcessor,
                        DirectoryManager directoryManager,
                        Set<DirectoryType> includedDirectoryTypes)
Method Detail

isImportableDirectory

protected boolean isImportableDirectory(Directory directory)
Parameters:
directory - the directory to be imported
Returns:
true if the directory data is importable

findAllExportableDirectories

protected List<Directory> findAllExportableDirectories()
Finds all directories that have user/group/membership data that need to be exported (ie. Internal + Delegating).

Returns:
list of directories that require exporting internal data.

isExportOfNonLocalGroupsRequired

protected boolean isExportOfNonLocalGroupsRequired(DirectoryType directoryType)
Determines whether the backup for a directory type includes all groups (both local and non-local), or just local groups, excluding non-local (remote) groups.

Parameters:
directoryType - a directory type
Returns:
false if backups must be limited to just local groups for this directory type, or true if backups must include all groups, local and non-local as well.


Copyright © 2013 Atlassian. All Rights Reserved.