Package org.jitterbit.util.persist

Examples of org.jitterbit.util.persist.Persistor


        }
    }

    private void persistItemWarnings(Persistor p) {
        for (EntityWarning w : itemWarnings) {
            Persistor child = p.createChild(ITEM_WARNING);
            persistEntityId(w.getIntegrationEntityId(), child);
            child.putString(VALUE, w.getWarning());
        }
    }
View Full Code Here


        }
    }

    private void persistItemRenames(Persistor p) {
        for (RenamedEntity r : renamedItems) {
            Persistor child = p.createChild(ITEM_RENAME);
            persistEntityId(r.getIntegrationId(), child);
            child.putString(OLD_NAME, r.getOldName());
            child.putString(NEW_NAME, r.getNewName());
        }
    }
View Full Code Here

        }
    }

    @Override
    public void restoreFrom(Persistor p) {
        Persistor segRoot = p.getFirstChild("Segment");
        if (segRoot == null) {
            throw new IllegalArgumentException("Invalid persistor: the Segment field is missing");
        }
        synchronized (getDataLock()) {
            super.restoreFrom(p);
View Full Code Here

            ErrorLog.log(BackupLog.class, "Failed to update the project backup log file", ex);
        }
    }

    private void writeEntry(XmlPersistor xml, Entry e) {
        Persistor child = xml.createChild(ENTRY);
        child.putString(FOLDER, e.folder.getAbsolutePath());
        child.putLong(TIME, e.time);
        child.putString(TYPE, e.type.name());
    }
View Full Code Here

        textStructure.writeTo(p.createChild("Structure"));
    }

    @Override
    protected void restoreAdditionalData(Persistor p) {
        Persistor delim = p.getFirstChild("Delimiter");
        if (delim != null) {
            setDelimiter(FieldDelimiter.fromPersistor(delim));
        } else {
            // If saved in versions 2.0.0.5 - 2.0.0.7, the persistor was saved as part of
            // the key-value pairs.
View Full Code Here

    }

    private void saveFields(Segment seg, Persistor media) {
        Iterable<Field> fields = seg.getFieldList();
        if (fields != null) {
            Persistor fieldRoot = media.createChild(FIELDS);
            FieldPersistor fieldPersistor = new FieldPersistor();
            for (Field f : fields) {
                fieldPersistor.save(f, fieldRoot.createChild(FIELD));
            }
        }
    }
View Full Code Here

        }
        return seg;
    }

    private List<Field> restoreFields(Persistor media) {
        Persistor fieldRoot = media.getFirstChild(FIELDS);
        if (fieldRoot == null) {
            return null;
        }
        List<Field> list = Lists.newArrayList();
        FieldPersistor loader = new FieldPersistor();
        for (Persistor p : fieldRoot.getChildren(FIELD)) {
           list.add(loader.restoreFrom(p));
        }
        return list;
    }
View Full Code Here

        operations.writeTo(parent.createChild("Operations"));
    }
   
    private void restoreOperations(Persistor root) {
        operations = new TriggeredOperations();
        Persistor opRoot = root.getFirstChild("Operations");
        if (opRoot != null) {
            operations.restoreFrom(opRoot);
        }
    }
View Full Code Here

    public DeployOptionPreference(ManagedProject project) {
        this.project = project;
    }

    public void write(DeployOption option) {
        Persistor p = getStorage();
        p.putString(KEY, option.getId());
    }
View Full Code Here

        Persistor p = getStorage();
        p.putString(KEY, option.getId());
    }

    public DeployOption read(DeployOption[] candidates) {
        Persistor p = getStorage();
        if (p != null) {
            String id = p.getString(KEY);
            if (id != null) {
                return findCandidateWithId(candidates, id);
            }
        }
        return null;
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.