Package org.geoserver.gss

Examples of org.geoserver.gss.PostDiffType


        return PostDiffType.class;
    }

    @Override
    public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
        PostDiffType pd = new PostDiffType();
        if (node.hasAttribute("fromVersion")) {
            pd.setFromVersion(((Number) node.getAttributeValue("fromVersion")).longValue());
        }
        if (node.hasAttribute("toVersion")) {
            pd.setToVersion(((Number) node.getAttributeValue("toVersion")).longValue());
        }
        if (node.hasAttribute("typeName")) {
            pd.setTypeName((QName) node.getAttributeValue("typeName"));
        }
        if (node.hasChild("Changes")) {
            pd.setTransaction((TransactionType) node.getChildValue("Changes"));
        }
        setServiceVersion(node, pd);

        return pd;
    }
View Full Code Here


        return pd;
    }

    @Override
    public Object getProperty(Object object, QName name) throws Exception {
        PostDiffType pd = (PostDiffType) object;

        if (name.getLocalPart().equals("typeName")) {
            return pd.getTypeName();
        } else if (name.getLocalPart().equals("fromVersion")) {
            return pd.getFromVersion();
        } else if (name.getLocalPart().equals("toVersion")) {
            return pd.getToVersion();
        } else if (name.getLocalPart().equals("Changes")) {
            return pd.getTransaction();
        }

        return super.getProperty(object, name);
    }
View Full Code Here

        TransactionType transaction = wfs.createTransactionType();
        transaction.getInsert().add(insert);
        transaction.getUpdate().add(update);
        transaction.getDelete().add(delete);
       
        PostDiffType postDiff = new PostDiffType();
        postDiff.setFromVersion(15);
        postDiff.setToVersion(47);
        postDiff.setTypeName(restricted);
        postDiff.setTransaction(transaction);
       
        Document doc = encode(postDiff, GSS.PostDiff);
        // print(doc);
       
        assertXpathEvaluatesTo("15", "/gss:PostDiff/@fromVersion", doc);
View Full Code Here

        assertXpathExists("/gss:PostDiff/gss:Changes/wfs:Delete", doc);
    }
   
    public void testParse() throws Exception {
        document = dom("PostDiffRequest.xml");
        PostDiffType pd = (PostDiffType) parse(GSS.PostDiffType);
       
        assertEquals(15, pd.getFromVersion());
        assertEquals(47, pd.getToVersion());
        assertEquals(SF_NAMESPACE, pd.getTypeName().getNamespaceURI());
        assertEquals("restricted", pd.getTypeName().getLocalPart());
        assertNotNull(pd.getTransaction());
        assertEquals(1, pd.getTransaction().getDelete().size());
        assertEquals(1, pd.getTransaction().getUpdate().size());
        assertEquals(1, pd.getTransaction().getInsert().size());
       
        // print(encode(pd, GSS.PostDiff));
    }
View Full Code Here

        TransactionType transaction = wfs.createTransactionType();
        transaction.getInsert().add(insert);
        transaction.getUpdate().add(update);
        transaction.getDelete().add(delete);
       
        PostDiffType postDiff = new PostDiffType();
        postDiff.setFromVersion(15);
        postDiff.setToVersion(47);
        postDiff.setTypeName(restricted);
        postDiff.setTransaction(transaction);
       
        Document doc = encode(postDiff, GSS.PostDiff);
        // print(doc);
       
        assertXpathEvaluatesTo("15", "/gss:PostDiff/@fromVersion", doc);
View Full Code Here

        assertXpathExists("/gss:PostDiff/gss:Changes/wfs:Delete", doc);
    }
   
    public void testParse() throws Exception {
        document = dom("PostDiffRequest.xml");
        PostDiffType pd = (PostDiffType) parse(GSS.PostDiffType);
       
        assertEquals(15, pd.getFromVersion());
        assertEquals(47, pd.getToVersion());
        assertEquals(SF_NAMESPACE, pd.getTypeName().getNamespaceURI());
        assertEquals("restricted", pd.getTypeName().getLocalPart());
        assertNotNull(pd.getTransaction());
        assertEquals(1, pd.getTransaction().getDelete().size());
        assertEquals(1, pd.getTransaction().getUpdate().size());
        assertEquals(1, pd.getTransaction().getInsert().size());
       
        // print(encode(pd, GSS.PostDiff));
    }
View Full Code Here

        return PostDiffType.class;
    }

    @Override
    public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
        PostDiffType pd = new PostDiffType();
        if (node.hasAttribute("fromVersion")) {
            pd.setFromVersion(((Number) node.getAttributeValue("fromVersion")).longValue());
        }
        if (node.hasAttribute("toVersion")) {
            pd.setToVersion(((Number) node.getAttributeValue("toVersion")).longValue());
        }
        if (node.hasAttribute("typeName")) {
            pd.setTypeName((QName) node.getAttributeValue("typeName"));
        }
        if (node.hasChild("Changes")) {
            pd.setTransaction((TransactionType) node.getChildValue("Changes"));
        }
        setServiceVersion(node, pd);

        return pd;
    }
View Full Code Here

        return pd;
    }

    @Override
    public Object getProperty(Object object, QName name) throws Exception {
        PostDiffType pd = (PostDiffType) object;

        if (name.getLocalPart().equals("typeName")) {
            return pd.getTypeName();
        } else if (name.getLocalPart().equals("fromVersion")) {
            return pd.getFromVersion();
        } else if (name.getLocalPart().equals("toVersion")) {
            return pd.getToVersion();
        } else if (name.getLocalPart().equals("Changes")) {
            return pd.getTransaction();
        }

        return super.getProperty(object, name);
    }
View Full Code Here

TOP

Related Classes of org.geoserver.gss.PostDiffType

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.