Package org.jitterbit.util.persist

Examples of org.jitterbit.util.persist.Persistor


        this.settings = settings;
    }

    @Override
    public LoadSourcePluginIdentifier[] load() {
        Persistor root = settings.getEntitySettings(transformation).getFirstChild(ROOT);
        if (root == null) {
            return new LoadSourcePluginIdentifier[0];
        }
        return loadImpl(root);
    }
View Full Code Here


        return plugins.toArray(new LoadSourcePluginIdentifier[plugins.size()]);
    }
   
    @Override
    public void store(PipelinePosition[] plugins) {
        Persistor p = settings.getEntitySettings(transformation);
        Persistor root = p.getFirstChild(ROOT);
        if (root == null) {
            root = p.createChild(ROOT);
        }
        root.removeChildren(ENTRY);
        for (PipelinePosition pos : plugins) {
            Persistor entry = root.createChild(ENTRY);
            entry.putString(NAME, pos.getPluginId().getName());
            entry.putString(VERSION, pos.getPluginId().getVersion().toString());
            entry.putString(POSITION, pos.getRelativePosition().name());
        }
        settings.persist();
    }
View Full Code Here

    /**
     * Restores the data of this <code>IntegationData</code> instance by reading it from a
     * <code>Persistor</code>.
     */
    public void restoreFrom(Persistor p) {
        Persistor root = p.getFirstChild("Properties");
        if (root == null) {
            throw new IllegalArgumentException("Invalid persistor: no Properties root found");
        }
        synchronized (getDataLock()) {
            properties = StringKeyValuePairsPersistor.restoreFrom(root);
View Full Code Here

    }

    private void restore() {
        sourceValue = defaultValue;
        targetValue = defaultValue;
        Persistor p = settings.getFirstChild(name);
        if (p != null) {
            Boolean b = p.getBoolean("source");
            if (b != null) {
                sourceValue = b;
            }
            b = p.getBoolean("target");
            if (b != null) {
                targetValue = b;
            }
        }
    }
View Full Code Here

    }

    public void save(boolean sourceValue, boolean targetValue) {
        settings.removeChildren(name);
        if (sourceValue != defaultValue || targetValue != defaultValue) {
            Persistor p = settings.createChild(name);
            if (sourceValue != defaultValue) {
                p.putBoolean("source", sourceValue);
            }
            if (targetValue != defaultValue) {
                p.putBoolean("target", targetValue);
            }
        }
        this.sourceValue = sourceValue;
        this.targetValue = targetValue;
    }
View Full Code Here

     *            the <code>Persistor</code> in which the expansion state has been persisted
     * @throws Exception
     */
    public NodeExpansionMemento(TreeMapper tm, Persistor p) throws Exception { // TODO: Use a dedicated exception
        treeMapper = tm;
        Persistor child = p.getFirstChild(PERSISTOR);
        expandedSourceNodes = readExpansionFromPersistor(child, SOURCE);
        expandedTargetNodes = readExpansionFromPersistor(child, TARGET);
    }
View Full Code Here

     * @param p
     *            the <code>Persistor</code> in which to store the expansion state
     */
    public void persist(Persistor p) {
        p.removeChildren(PERSISTOR);
        Persistor child = p.createChild(PERSISTOR);
        child.putText(SOURCE, serializeToBase64String(expandedSourceNodes));
        child.putText(TARGET, serializeToBase64String(expandedTargetNodes));
    }
View Full Code Here

        return (cache != null) ? cache.get(pipeline) : null;
    }
   
    public void writeTo(Persistor p) {
        for (Map.Entry<OperationId, OperationTypeCache> e : operationCaches.entrySet()) {
            Persistor cachedOp = p.createChild(CACHED_OP);
            cachedOp.putString(OP_ID, e.getKey().toString());
            e.getValue().writeTo(cachedOp);
        }
    }
View Full Code Here

        }
    }

    private void persistEmailNodeLayouts(Persistor p) {
        for (Map.Entry<EmailWrapperNode, Rectangle> e : emailNodeBounds) {
            Persistor email = p.createChild("Email");
            email.putString("emailId", e.getKey().getDataObject().getActivity().getID().toString());
            PersistUtils.writeBounds(email, e.getValue());
        }
    }
View Full Code Here

            PersistUtils.writeBounds(email, e.getValue());
        }
    }

    private void persistCachedLayouts(Persistor p) {
        Persistor root = p.createChild("Cache");
        opLayoutCache.writeTo(root);
        emailLayoutCache.writeTo(root);
    }
View Full Code Here

TOP

Related Classes of org.jitterbit.util.persist.Persistor

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.