| | |
| | | */ |
| | | public class ExportTask extends Task |
| | | { |
| | | |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | |
| | | /** Stores mapping between configuration attribute name and its label. */ |
| | | private static Map<String,LocalizableMessage> argDisplayMap = new HashMap<>(); |
| | | static { |
| | |
| | | |
| | | private LDIFExportConfig exportConfig; |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public LocalizableMessage getDisplayName() { |
| | | return INFO_TASK_EXPORT_NAME.get(); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public LocalizableMessage getAttributeDisplayName(String name) { |
| | | return argDisplayMap.get(name); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeTask() throws DirectoryException |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | Entry taskEntry = getTaskEntry(); |
| | | AttributeType typeWrapColumn = getAttributeType(ATTR_TASK_EXPORT_WRAP_COLUMN); |
| | | |
| | |
| | | return TaskUtils.getSingleValueString(attrs); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void interruptTask(TaskState interruptState, LocalizableMessage interruptReason) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isInterruptable() { |
| | | return true; |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected TaskState runTask() |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | ArrayList<DN> includeBranches; |
| | | if (!includeBranchStrings.isEmpty()) |
| | | { |
| | |
| | | includeBranches = defaultIncludeBranches; |
| | | } |
| | | |
| | | |
| | | // Create the LDIF export configuration to use when reading the LDIF. |
| | | ExistingFileBehavior existingBehavior; |
| | | if (appendToLDIF) |
| | |
| | | // FIXME -- Should this be conditional? |
| | | exportConfig.setInvokeExportPlugins(true); |
| | | |
| | | |
| | | // Get the set of base DNs for the backend as an array. |
| | | DN[] baseDNs = new DN[defaultIncludeBranches.size()]; |
| | | defaultIncludeBranches.toArray(baseDNs); |
| | | |
| | | |
| | | // From here we must make sure we close the export config. |
| | | try |
| | | { |
| | |
| | | return TaskState.STOPPED_BY_ERROR; |
| | | } |
| | | |
| | | |
| | | // From here we must make sure we release the shared backend lock. |
| | | try |
| | | { |