com.atlassian.bamboo.migration
Enum BambooStAXListImportStrategy

java.lang.Object
  extended by java.lang.Enum<BambooStAXListImportStrategy>
      extended by com.atlassian.bamboo.migration.BambooStAXListImportStrategy
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<BambooStAXListImportStrategy>

public enum BambooStAXListImportStrategy
extends java.lang.Enum<BambooStAXListImportStrategy>

Enumeration of transaction handling strategies for importing lists of elements.


Enum Constant Summary
LIST_10000_ITEMS_TRANSACTION
          Import of each 10000 list elements is surrounded by a single additional transaction
LIST_ITEM_AND_CLEAR_SESSION_TRANSACTION
          Import of each list element is surrounded by a single additional transaction.
LIST_ITEM_TRANSACTION
          Import of each list element is surrounded by a single additional transaction
LIST_TRANSACTION
          Import of all list elements is surrounded by a single additional transaction
NO_TRANSACTION
          No additional transaction for importing element list
 
Field Summary
static long DEFAULT_DISPLAY_PROGRESS_STEP
           
 
Method Summary
protected abstract
<T> long
importListItems(net.sf.hibernate.Session session, org.codehaus.staxmate.in.SMInputCursor listItemCursor, com.atlassian.bamboo.migration.BambooStAXMappingListHelper<T> mappingHelper, java.util.List<T> itemList, java.lang.String displayNodeName)
           
<T> java.util.List<T>
importListXml(net.sf.hibernate.Session session, org.codehaus.staxmate.in.SMInputCursor inputCursor, com.atlassian.bamboo.migration.BambooStAXMappingListHelper<T> mappingHelper)
          Strategy entry point
static BambooStAXListImportStrategy valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static BambooStAXListImportStrategy[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

NO_TRANSACTION

public static final BambooStAXListImportStrategy NO_TRANSACTION
No additional transaction for importing element list


LIST_ITEM_TRANSACTION

public static final BambooStAXListImportStrategy LIST_ITEM_TRANSACTION
Import of each list element is surrounded by a single additional transaction


LIST_10000_ITEMS_TRANSACTION

public static final BambooStAXListImportStrategy LIST_10000_ITEMS_TRANSACTION
Import of each 10000 list elements is surrounded by a single additional transaction


LIST_TRANSACTION

public static final BambooStAXListImportStrategy LIST_TRANSACTION
Import of all list elements is surrounded by a single additional transaction


LIST_ITEM_AND_CLEAR_SESSION_TRANSACTION

public static final BambooStAXListImportStrategy LIST_ITEM_AND_CLEAR_SESSION_TRANSACTION
Import of each list element is surrounded by a single additional transaction. Additionally session is cleared after transaction commit.

Field Detail

DEFAULT_DISPLAY_PROGRESS_STEP

public static final long DEFAULT_DISPLAY_PROGRESS_STEP
See Also:
Constant Field Values
Method Detail

values

public static BambooStAXListImportStrategy[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (BambooStAXListImportStrategy c : BambooStAXListImportStrategy.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static BambooStAXListImportStrategy valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

importListItems

protected abstract <T> long importListItems(@NotNull
                                            net.sf.hibernate.Session session,
                                            @NotNull
                                            org.codehaus.staxmate.in.SMInputCursor listItemCursor,
                                            @NotNull
                                            com.atlassian.bamboo.migration.BambooStAXMappingListHelper<T> mappingHelper,
                                            @NotNull
                                            java.util.List<T> itemList,
                                            @NotNull
                                            java.lang.String displayNodeName)
                                 throws java.lang.Exception
Throws:
java.lang.Exception

importListXml

public <T> java.util.List<T> importListXml(@NotNull
                                           net.sf.hibernate.Session session,
                                           @NotNull
                                           org.codehaus.staxmate.in.SMInputCursor inputCursor,
                                           @NotNull
                                           com.atlassian.bamboo.migration.BambooStAXMappingListHelper<T> mappingHelper)
                                throws java.lang.Exception
Strategy entry point

Parameters:
session - DB session object
inputCursor - StAXMate's input cursor pointing to the begin-of-the-list XML node
mappingHelper - importer object
Returns:
list of imported elements - this list is managed by the imported and might be not used to store elements.
Throws:
java.lang.Exception - when something went wrong


Copyright © 2012 Atlassian. All Rights Reserved.