/* * GeoTools - The Open Source Java GIS Toolkit * http://geotools.org * * (C) 2002-2008, Open Source Geospatial Foundation (OSGeo) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. */ package org.geotools.wfs.bindings; import java.math.BigInteger; import javax.xml.namespace.QName; import net.opengis.wfs.GetFeatureWithLockType; import net.opengis.wfs.QueryType; import net.opengis.wfs.WfsFactory; import org.geotools.wfs.WFS; import org.geotools.xml.AbstractComplexEMFBinding; import org.geotools.xml.ElementInstance; import org.geotools.xml.Node; /** * Binding object for the type http://www.opengis.net/wfs:GetFeatureWithLockType. * * <p> * <pre> * <code> * <xsd:complexType name="GetFeatureWithLockType"> * <xsd:annotation> * <xsd:documentation> * A GetFeatureWithLock request operates identically to a * GetFeature request expect that it attempts to lock the * feature instances in the result set and includes a lock * identifier in its response to a client. A lock identifier * is an identifier generated by a Web Feature Service that * a client application can use, in subsequent operations, * to reference the locked set of feature instances. * </xsd:documentation> * </xsd:annotation> * <xsd:complexContent> * <xsd:extension base="wfs:BaseRequestType"> * <xsd:sequence> * <xsd:element maxOccurs="unbounded" ref="wfs:Query"/> * </xsd:sequence> * <xsd:attribute default="5" name="expiry" * type="xsd:positiveInteger" use="optional"> * <xsd:annotation> * <xsd:documentation> * The expiry attribute is used to set the length * of time (expressed in minutes) that features will * remain locked as a result of a GetFeatureWithLock * request. After the expiry period elapses, the * locked resources must be released. If the * expiry attribute is not set, then the default * value of 5 minutes will be enforced. * </xsd:documentation> * </xsd:annotation> * </xsd:attribute> * <xsd:attribute default="results" name="resultType" * type="wfs:ResultTypeType" use="optional"> * <xsd:annotation> * <xsd:documentation> * See definition of wfs:GetFeatureType. * </xsd:documentation> * </xsd:annotation> * </xsd:attribute> * <xsd:attribute default="text/xml; subtype=gml/3.1.1" * name="outputFormat" type="xsd:string" use="optional"> * <xsd:annotation> * <xsd:documentation> * See definition of wfs:GetFeatureType. * </xsd:documentation> * </xsd:annotation> * </xsd:attribute> * <xsd:attribute name="maxFeatures" type="xsd:positiveInteger" use="optional"> * <xsd:annotation> * <xsd:documentation> * See definition of wfs:GetFeatureType. * </xsd:documentation> * </xsd:annotation> * </xsd:attribute> * <xsd:attribute name="traverseXlinkDepth" type="xsd:string" use="optional"> * <xsd:annotation> * <xsd:documentation> * See definition of wfs:GetFeatureType. * </xsd:documentation> * </xsd:annotation> * </xsd:attribute> * <xsd:attribute name="traverseXlinkExpiry" * type="xsd:positiveInteger" use="optional"> * <xsd:annotation> * <xsd:documentation> * See definition of wfs:GetFeatureType. * </xsd:documentation> * </xsd:annotation> * </xsd:attribute> * </xsd:extension> * </xsd:complexContent> * </xsd:complexType> * * </code> * </pre> * </p> * * @generated * * * * @source $URL$ */ public class GetFeatureWithLockTypeBinding extends AbstractComplexEMFBinding { WfsFactory wfsfactory; public GetFeatureWithLockTypeBinding(WfsFactory wfsfactory) { this.wfsfactory = wfsfactory; } /** * @generated */ public QName getTarget() { return WFS.GetFeatureWithLockType; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Class getType() { return GetFeatureWithLockType.class; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { GetFeatureWithLockType getFeatureWithLock = wfsfactory .createGetFeatureWithLockType(); WFSBindingUtils.service(getFeatureWithLock, node); WFSBindingUtils.version(getFeatureWithLock, node); WFSBindingUtils.outputFormat(getFeatureWithLock, node, "GML2"); if (node.getAttributeValue("handle") != null) { getFeatureWithLock.setHandle((String) node.getAttributeValue("handle")); } //get the max features BigInteger maxFeatures = WFSBindingUtils.asBigInteger((Number) node.getAttributeValue( "maxFeatures")); if (maxFeatures != null) { getFeatureWithLock.setMaxFeatures(maxFeatures); } //get the lock expiry BigInteger expiry = WFSBindingUtils.asBigInteger((Number) node.getAttributeValue("expiry")); if (expiry != null) { getFeatureWithLock.setExpiry(expiry); } //queries getFeatureWithLock.getQuery().addAll(node.getChildValues(QueryType.class)); return getFeatureWithLock; } }