Package org.jitterbit.util.persist

Examples of org.jitterbit.util.persist.Persistor


        child.putBoolean(EntryPersistingConstants.READ_ONLY, attr.isReadOnly());
        saveSyntaxInfo(attr, child);
    }

    private static void saveSyntaxInfo(LdapStructureAttribute attr, Persistor p) {
        Persistor child = p.createChild(EntryPersistingConstants.SYNTAX_INFO);
        AttributeSyntaxInfo info = attr.getSyntaxInfo();
        child.putString(EntryPersistingConstants.OID, info.getOid());
        child.putString(EntryPersistingConstants.DESCRIPTION, info.getDescription());
        child.putString(EntryPersistingConstants.TYPE, info.getDataType().name());
    }
View Full Code Here


        attrBuilder.setReadOnly(p.getBoolean(EntryPersistingConstants.READ_ONLY));
        return attrBuilder.getAttribute();
    }

    private static AttributeSyntaxInfo loadAttributeSyntaxInfo(Persistor p) {
        Persistor infoStore = p.getFirstChild(EntryPersistingConstants.SYNTAX_INFO);
        final String oid = infoStore.getString(EntryPersistingConstants.OID);
        final String desc = infoStore.getString(EntryPersistingConstants.DESCRIPTION);
        final AttributeDataType type = getSyntaxInfoDataType(infoStore);
        return new AttributeSyntaxInfo() {

            @Override
            public AttributeDataType getDataType() {
View Full Code Here

            this.root = root;
        }

        public void write(Map<HttpVerb, Set<TriggeredOperation>> operations) {
            for (Map.Entry<HttpVerb, Set<TriggeredOperation>> e : operations.entrySet()) {
                Persistor verbPersistor = root.createChild(VERB);
                if (e.getKey() != null) {
                    verbPersistor.putString(VERB_NAME, e.getKey().name());
                }
                for (TriggeredOperation op : e.getValue()) {
                    Persistor opPersistor = verbPersistor.createChild(OPERATION);
                    opPersistor.putString(OPERATION_ID, op.getOperationId().toString());
                    opPersistor.putString(RUN_MODE, op.getRunMode().name());
                    if (op.isResponseGenerator()) {
                        opPersistor.putBoolean(RESPONSE_GENERATOR, true);
                    }
                    if (!op.isUsingRequestAsSource()) {
                        opPersistor.putBoolean(USE_REQUEST_AS_SOURCE, false);
                    }
                }
            }
        }
View Full Code Here

        StructurePersistor.saveInputStructure(this, inputStructure, p);
        StructurePersistor.saveOutputStructure(this, outputStructure, p);
    }

    private void writeMappings(Persistor p) {
        Persistor root = p.createChild("Mappings");
        for (String s : mappings) {
            root.createChild("Mapping").putText("expr", s);
        }
    }
View Full Code Here

            root.createChild("Mapping").putText("expr", s);
        }
    }

    private void writeInvalidMappings(Persistor p) {
        Persistor root = p.createChild("InvalidMappings");
        for (InvalidMapping inv : invalidMappings) {
            InvalidMappingPersistor.save(inv, root.createChild("Mapping"));
        }
    }
View Full Code Here

            InvalidMappingPersistor.save(inv, root.createChild("Mapping"));
        }
    }

    private void writeRenamedNodes(Persistor p) {
        Persistor root = p.createChild("RenamedNodes");
        for (Map.Entry<String, String> e : renamedNodes.entrySet()) {
            Persistor node = root.createChild("Node");
            node.putString("key", e.getKey());
            node.putString("value", e.getValue());
        }
    }
View Full Code Here

    private static final String WSCALL_ID = "wsCallId";

    public static void saveInputStructure(Transformation tf, DataStructure input, Persistor p) {
        if (isApplicable(input)) {
            DataStructureType type = input.getStructureType();
            Persistor root = p.createChild(INPUT);
            root.putString(TYPE, type.name());
            if (type.isTextBased()) {
                // Special case for TextStructures: We restore them directly from the TextDocument,
                // using the document ID
                root.putString(DOC_ID, tf.getSourceTextDocumentId().toString());
            } else if (type == DataStructureType.WebServiceRequest || type == DataStructureType.WebServiceResponse) {
                // Special case for WebServiceCalls: We restore them directly from the
                // WebServiceCall instance,
                // using its ID
                root.putString(WSCALL_ID, ((WebServiceStructure) input).getWebServiceCallId().toString());
            } else {
                input.writeTo(root);
            }
        }
    }
View Full Code Here

    }

    public static void saveOutputStructure(Transformation tf, DataStructure output, Persistor p) {
        if (isApplicable(output)) {
            DataStructureType type = output.getStructureType();
            Persistor root = p.createChild(OUTPUT);
            root.putString(TYPE, output.getStructureType().name());
            if (type.isTextBased()) {
                // Special case for TextStructures: We restore them directly from the TextDocument,
                // using the document ID
                root.putString(DOC_ID, tf.getTargetTextDocumentId().toString());
            } else if (type == DataStructureType.WebServiceRequest || type == DataStructureType.WebServiceResponse) {
                // Special case for WebServiceCalls: We restore them directly from the
                // WebServiceCall instance,
                // using its ID
                root.putString(WSCALL_ID, ((WebServiceStructure) output).getWebServiceCallId().toString());
            } else {
                output.writeTo(root);
            }
        }
    }
View Full Code Here

    /**
     * Restores the input structure for the given <code>Transformation</code>.
     */
    public static DataStructure restoreInputStructure(Transformation tf, Persistor p, IntegrationEntityLookup lookup) {
        Persistor root = p.getFirstChild(INPUT);
        if (root == null) {
            // See comment in isApplicable() for an explanation
            return null;
        }
        DataStructure struct = null;
        DataStructureType type = DataStructureType.valueOf(root.getString(TYPE));
        switch (type) {
        case ComplexText:
        case Text:
            // Special case for TextStructures: They have already been fully restored as part of
            // the TextDocument they belong to. We can return here.
View Full Code Here

    /**
     * Restores the output structure for the given <code>Transformation</code>.
     */
    public static DataStructure restoreOutputStructure(Transformation tf, Persistor p, IntegrationEntityLookup lookup) {
        Persistor root = p.getFirstChild(OUTPUT);
        if (root == null) {
            // See comment in isApplicable() for an explanation
            return null;
        }
        DataStructure struct = null;
        DataStructureType type = DataStructureType.valueOf(root.getString(TYPE));
        switch (type) {
        case ComplexText:
        case Text:
            // Special case for TextStructures: They have already been fully restored as part of
            // the TextDocument they belong to. We can return here.
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.