Package com.atlassian.bamboo.migration
Enum BambooStAXListImportStrategy
- java.lang.Object
-
- java.lang.Enum<BambooStAXListImportStrategy>
-
- com.atlassian.bamboo.migration.BambooStAXListImportStrategy
-
- All Implemented Interfaces:
Serializable
,Comparable<BambooStAXListImportStrategy>
public enum BambooStAXListImportStrategy extends Enum<BambooStAXListImportStrategy>
Enumeration of transaction handling strategies for importing lists of elements.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description LIST_10000_ITEMS_TRANSACTION
Import of each 10000 list elements is surrounded by a single additional transactionLIST_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 transactionLIST_TRANSACTION
Import of all list elements is surrounded by a single additional transactionNO_TRANSACTION
No additional transaction for importing element list
-
Field Summary
Fields Modifier and Type Field Description static long
DEFAULT_DISPLAY_PROGRESS_STEP
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract <T,I extends T>
longimportListItems(@NotNull org.springframework.transaction.support.TransactionOperations transactionOperations, @NotNull org.hibernate.Session session, @NotNull org.codehaus.staxmate.in.SMInputCursor listItemCursor, @NotNull com.atlassian.bamboo.migration.BambooStAXMappingListHelper<T,I> mappingHelper, @NotNull List<I> itemList, @NotNull String displayNodeName)
<T,I extends T>
List<I>importListXml(org.springframework.transaction.support.TransactionOperations transactionOperations, @NotNull org.hibernate.Session session, @NotNull org.codehaus.staxmate.in.SMInputCursor inputCursor, @NotNull com.atlassian.bamboo.migration.BambooStAXMappingListHelper<T,I> mappingHelper)
Strategy entry pointstatic BambooStAXListImportStrategy
valueOf(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.
-
-
-
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.
-
-
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(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:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
importListItems
protected abstract <T,I extends T> long importListItems(@NotNull @NotNull org.springframework.transaction.support.TransactionOperations transactionOperations, @NotNull @NotNull org.hibernate.Session session, @NotNull @NotNull org.codehaus.staxmate.in.SMInputCursor listItemCursor, @NotNull @NotNull com.atlassian.bamboo.migration.BambooStAXMappingListHelper<T,I> mappingHelper, @NotNull @NotNull List<I> itemList, @NotNull @NotNull String displayNodeName) throws Exception
- Throws:
Exception
-
importListXml
public <T,I extends T> List<I> importListXml(org.springframework.transaction.support.TransactionOperations transactionOperations, @NotNull @NotNull org.hibernate.Session session, @NotNull @NotNull org.codehaus.staxmate.in.SMInputCursor inputCursor, @NotNull @NotNull com.atlassian.bamboo.migration.BambooStAXMappingListHelper<T,I> mappingHelper) throws Exception
Strategy entry point- Parameters:
transactionOperations
-session
- DB session objectinputCursor
- StAXMate's input cursor pointing to the begin-of-the-list XML nodemappingHelper
- importer object- Returns:
- list of imported elements - this list is managed by the imported and might be not used to store elements.
- Throws:
Exception
- when something went wrong
-
-