Package org.jitterbit.integration.data.entity.transformation

Examples of org.jitterbit.integration.data.entity.transformation.SourceBatchParams


   
    public SourceBatchChange edit(String path) {
        checkArgument(StringUtils.isNotBlank(path), "path may not be null or empty");
        Integer batchSize = askForBatchSize(path);
        if (batchSize != null) {
            SourceBatchParams newParams = createNewParams(path, batchSize);
            if (!newParams.equals(currentParams)) {
                SourceBatchChange saveJob = createChangeObject(currentParams, newParams);
                currentParams = newParams;
                return saveJob;
            }
        }
View Full Code Here


    private Integer askForBatchSize(String path) {
        return sizeInput.getBatchSize(path, currentParams.getBatchSize());
    }

    private SourceBatchParams createNewParams(String path, int batchSize) {
        return batchSize > 0 ? new SourceBatchParams(path, batchSize) : SourceBatchParams.NONE;
    }
View Full Code Here

        refreshBatchNode();
        super.init();
    }

    public void refreshBatchNode(){
        SourceBatchParams params = getTreeMapper().getTransformation().getSourceBatchParams();
        refreshBatchNode(params);
    }
View Full Code Here

        tf = new Transformation("Test");
    }
   
    @Test
    public void testSourceBatchParams() {
        SourceBatchParams params = new SourceBatchParams("", 0);
        assertEquals(params, tf.getSourceBatchParams());
        tf.setSourceBatchParams(null);
        assertEquals(params.clone(), tf.getSourceBatchParams());
        tf.setSourceBatchParams(params);
        assertEquals(params.clone(), tf.getSourceBatchParams());
        params = new SourceBatchParams("a.b.c", 200);
        tf.setSourceBatchParams(params);
        assertEquals(params.clone(), tf.getSourceBatchParams());
    }
View Full Code Here

     */
    public void setSourceBatchParams(SourceBatchParams params) {
        if (params == null) {
            params = SourceBatchParams.NONE;
        }
        SourceBatchParams old;
        synchronized (getDataLock()) {
            old = getSourceBatchParams();
            setProperty(SOURCE_BATCH_NODE_PATH, params.getNodePath());
            setProperty(SOURCE_BATCH_SIZE, params.getBatchSize());
        }
View Full Code Here

            String path = getProperty(SOURCE_BATCH_NODE_PATH);
            int size = getIntProperty(SOURCE_BATCH_SIZE, 0);
            if (StringUtils.isBlank(path) || size <= 0) {
                return SourceBatchParams.NONE;
            }
            return new SourceBatchParams(path, size);
        }
    }
View Full Code Here

    private SourceBatchParams currentParams;
   
    @Before
    public void setUp() {
        tf = new Transformation("Test");
        originalParams = new SourceBatchParams(ORIGINAL_PATH, ORIGINAL_SIZE);
        tf.setSourceBatchParams(originalParams);
    }
View Full Code Here

    public void testSizeChange() {
        int newSize = ORIGINAL_SIZE + 1;
        SourceBatchEditor editor = new SourceBatchEditor(tf, new FixedSizeInput(newSize));
        SourceBatchChange change = editor.edit(ORIGINAL_PATH);
        assertNotNull(change);
        assertEquals(change.getNewParams(), new SourceBatchParams(ORIGINAL_PATH, newSize));
    }
View Full Code Here

    public void testPathChange() {
        String newPath = "x.y.z";
        SourceBatchEditor editor = new SourceBatchEditor(tf, new FixedSizeInput(ORIGINAL_SIZE));
        SourceBatchChange change = editor.edit(newPath);
        assertNotNull(change);
        assertEquals(change.getNewParams(), new SourceBatchParams(newPath, ORIGINAL_SIZE));
    }
View Full Code Here

TOP

Related Classes of org.jitterbit.integration.data.entity.transformation.SourceBatchParams

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.