Package org.geoserver.gss

Examples of org.geoserver.gss.GetDiffResponseType


    }

    @Override
    public void write(Object value, OutputStream output, Operation operation) throws IOException,
            ServiceException {
        GetDiffResponseType response = (GetDiffResponseType) value;
        Encoder encoder = new Encoder(configuration, gss.getSchema());
        encoder.setIndenting(true);

        encoder.encode(response, GSS.GetDiffResponse, output);
    }
View Full Code Here


        return GetDiffResponseType.class;
    }

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

        return gdr;
    }
View Full Code Here

        return gdr;
    }

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

        if (name.getLocalPart().equals("typeName")) {
            return gdr.getTypeName();
        } else if (name.getLocalPart().equals("fromVersion")) {
            return gdr.getFromVersion();
        } else if (name.getLocalPart().equals("toVersion")) {
            return gdr.getToVersion();
        } else if (name.getLocalPart().equals("Changes")) {
            return gdr.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);

        GetDiffResponseType response = new GetDiffResponseType();
        response.setFromVersion(15);
        response.setToVersion(47);
        response.setTypeName(restricted);
        response.setTransaction(transaction);

        Document doc = encode(response, GSS.GetDiffResponse);
        // print(doc);

        assertXpathEvaluatesTo("15", "/gss:GetDiffResponse/@fromVersion", doc);
View Full Code Here

        assertXpathExists("/gss:GetDiffResponse/gss:Changes/wfs:Delete", doc);
    }

    public void testParse() throws Exception {
        document = dom("GetDiffResponse.xml");
        GetDiffResponseType gdr = (GetDiffResponseType) parse(GSS.GetDiffResponseType);

        assertEquals(15, gdr.getFromVersion());
        assertEquals(47, gdr.getToVersion());
        assertEquals(SF_NAMESPACE, gdr.getTypeName().getNamespaceURI());
        assertEquals("restricted", gdr.getTypeName().getLocalPart());
        assertNotNull(gdr.getTransaction());
        assertEquals(1, gdr.getTransaction().getDelete().size());
        assertEquals(1, gdr.getTransaction().getUpdate().size());
        assertEquals(1, gdr.getTransaction().getInsert().size());
    }
View Full Code Here

        TransactionType transaction = wfs.createTransactionType();
        transaction.getInsert().add(insert);
        transaction.getUpdate().add(update);
        transaction.getDelete().add(delete);

        GetDiffResponseType response = new GetDiffResponseType();
        response.setFromVersion(15);
        response.setToVersion(47);
        response.setTypeName(restricted);
        response.setTransaction(transaction);

        Document doc = encode(response, GSS.GetDiffResponse);
        // print(doc);

        assertXpathEvaluatesTo("15", "/gss:GetDiffResponse/@fromVersion", doc);
View Full Code Here

        assertXpathExists("/gss:GetDiffResponse/gss:Changes/wfs:Delete", doc);
    }

    public void testParse() throws Exception {
        document = dom("GetDiffResponse.xml");
        GetDiffResponseType gdr = (GetDiffResponseType) parse(GSS.GetDiffResponseType);

        assertEquals(15, gdr.getFromVersion());
        assertEquals(47, gdr.getToVersion());
        assertEquals(SF_NAMESPACE, gdr.getTypeName().getNamespaceURI());
        assertEquals("restricted", gdr.getTypeName().getLocalPart());
        assertNotNull(gdr.getTransaction());
        assertEquals(1, gdr.getTransaction().getDelete().size());
        assertEquals(1, gdr.getTransaction().getUpdate().size());
        assertEquals(1, gdr.getTransaction().getInsert().size());
    }
View Full Code Here

        return GetDiffResponseType.class;
    }

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

        return gdr;
    }
View Full Code Here

        return gdr;
    }

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

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

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

TOP

Related Classes of org.geoserver.gss.GetDiffResponseType

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.