Package org.jitterbit.util.persist

Examples of org.jitterbit.util.persist.Persistor


        return null;
    }

    private Persistor getStorage() {
        EntitySettings settings = project.getEntityResources().getSettings();
        Persistor p = settings.getClassSettings(EntityType.Project);
        return p;
    }
View Full Code Here


        }
    }

    private void restoreObjects(Persistor p) {
        objects = Maps.newHashMap();
        Persistor root = p.getFirstChild("Objects");
        DatabaseObjectPersistor op = new DatabaseObjectPersistor();
        for (Persistor item : root.getChildren("Item")) {
            objects.put(op.restoreFrom(item.getFirstChild("Object")), item.getInteger("value"));
        }
    }
View Full Code Here

            p.putString("targetId", targetId.toString());
        }
    }

    private void writeObjects(Persistor p) {
        Persistor root = p.createChild("Objects");
        DatabaseObjectPersistor op = new DatabaseObjectPersistor();
        for (DatabaseObject o : objects.keySet()) {
            if (o == null) {
                // When upgrading from certain pre-release 2.0 versions we may end up in the
                // situation where objects contains null-keys. If that happens we must erase
                // all restored objects information and pretend it was never there in the first
                // place, otherwise we risk ending up in an inconsistent state.
                return;
            }
        }
        for (Map.Entry<DatabaseObject, Integer> e : objects.entrySet()) {
            Persistor item = root.createChild("Item");
            op.save(e.getKey(), item.createChild("Object"));
            item.putInteger("value", e.getValue());
        }
    }
View Full Code Here

    private static final String ENTITY_NAME = "EntityName";

    private static final String ENTITY_ID = "EntityId";

    void persist(DeployedEntityDescriptor descriptor, Persistor p) {
        Persistor p2 = p.createChild(DESCRIPTOR);
        IntegrationEntityId id = descriptor.getId();
        p2.putString(ENTITY_TYPE, id.getEntityType().name());
        p2.putString(ENTITY_ID, id.toString());
        p2.putString(ENTITY_NAME, descriptor.getName());
        for (DeployedEntityDescriptor child : descriptor.getChildren()) {
            persist(child, p2);
        }
    }
View Full Code Here

            persist(child, p2);
        }
    }

    DeployedEntityDescriptor restore(Persistor p) {
        Persistor p2 = p.getFirstChild(DESCRIPTOR);
        if (p2 == null) {
            throw new IllegalArgumentException("Invalid persistor");
        }
        DescriptorImpl root = new DescriptorImpl(p2);
        restoreChildren(root, p2);
View Full Code Here

            }
            return new ServerInfo(new ServerGuid(id), name, version);
        }
       
        protected final DeployedEntityDescriptor restoreDataRoot(Persistor p) {
            Persistor p2 = p.getFirstChild(DATA_ROOT);
            checkArgument(p2 != null, "Invalid persistor");
            return new DeployedEntityDescriptorPersistor().restore(p2);
        }
View Full Code Here

    }
   
    private void writeAttributes(LdapStructureEntry entry, Persistor root) {
        String[] attrs = entry.getAttributeNames();
        if (attrs != null) {
            Persistor p = root.createChild(ATTRIBUTES);
            for (String a : attrs) {
                Persistor p1 = p.createChild(ATTRIBUTE);
                p1.putString(VALUE, a);
            }
        }
    }
View Full Code Here

    private void writeExtendedAttributes(LdapStructureEntry entry, Persistor root) {
        Set<LdapStructureAttribute> extAttrs = entry.getExtendedAttributes();
        if (extAttrs.isEmpty()) {
            return;
        }
        Persistor p = root.createChild(EXT_OBJECT);
        for (LdapStructureAttribute a : extAttrs) {
            LdapStructureAttributePersistor.write(a, p);
        }
    }
View Full Code Here

        }
        return new NumericOid(oid);
    }
   
    private String[] readAttributes(Persistor media) {
        Persistor root = media.getFirstChild(ATTRIBUTES);
        if (root == null) {
            return null;
        }
        List<String> attrs = Lists.newArrayList();
        for (Persistor p : root.getChildren(ATTRIBUTE)) {
            attrs.add(p.getString(VALUE));
        }
        return attrs.toArray(new String[attrs.size()]);
    }
View Full Code Here

        }
        pipelineMemento.writeTo(p.createChild("Pipeline"));
    }

    private void writeSiblingIds(Persistor p) {
        Persistor root = p.createChild("Siblings");
        for (OperationId id : siblings) {
            root.createChild("Sibling").putString("opId", id.toString());
        }
    }
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.