Package com.luciad.ogc.wfs.client
Class TLcdWFSTransactionRequest
java.lang.Object
com.luciad.ogc.wfs.client.TLcdWFSTransactionRequest
- All Implemented Interfaces:
ILcdOWSRequest
A WFS
Transaction
request. Instances of this class can not be created directly. An
instance can be created using the TLcdWFSClient.createTransactionRequest()
method. This
method will ensure a request object is created that is compatible with the WFS version
implemented by the WFS server.
This class will preserve the order in which the methods are called, to determine the order of
transaction actions in the request. For update transactions, it is important to first invoke
updateFeatures(QName, TLcdOGCFilter, String)
for each action, followed
by invoking addPropertyToUpdate(...)
to specify which feature properties should be
updated.
This WFS transaction request does not support KVP encoding.- Since:
- 10.0
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
An enumeration that corresponds to the 'ReleaseAction' attribute of a 'Transaction' request. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPropertyToUpdate
(List<TLcdDataProperty> aProperties, Object aValue) Adds a property which should be changed by a previously initiated "Update" element.void
addPropertyToUpdate
(List<TLcdDataProperty> aProperties, List<Integer> aPredicates, Object aValue) Adds a property which should be changed by a previously initiated "Update" element.void
deleteFeatures
(QName aTypeName, TLcdOGCFilter aFilter, String aHandle) Specifies the features which should be deleted by the server.Transaction
requests do not support KVP encoding.Returns the model reference formatter of this transaction request.getRestEncoding
(URI aBaseURI) Returnsnull
, REST encoding is not supported.Returns an object representing data to be used by the transportation layer (seeILcdOWSTransport
) to perform this OGC Web Service request.Returns the XML encoding of this request.void
insertFeatures
(List<ILcdDataObject> aFeatures, String aHandle) Adds a list of GML features which should be inserted on the server.void
Sets the optional handle of this request.void
Sets a previously obtained lock id on this request.void
setModelReferenceFormatter
(ILcdModelReferenceFormatter aReferenceFormatter) Sets a reference formatter to format a model reference (i.e., an instance ofILcdModelReference
) to a String in the transaction request encoding.void
setReleaseAction
(TLcdWFSTransactionRequest.ReleaseAction aReleaseAction) Sets the release action attribute on this request.void
updateFeatures
(QName aTypeName, TLcdOGCFilter aFilter, String aHandle) Adds an "Update" element to the transaction.
-
Method Details
-
updateFeatures
Adds an "Update" element to the transaction. This method is used to specify the features that should be updated. The actual properties of the selected features should be specified using theaddPropertyToUpdate(java.util.List<com.luciad.datamodel.TLcdDataProperty>, java.lang.Object)
method. This update will be removed from the transaction if a call to this method is immediately followed by a method which adds another update, insert or delete part of the transaction. The order in which this method is called with respect to other insert, update or delete methods will be preserved.- Parameters:
aTypeName
- The name of the feature type which will be updated.aFilter
- A filter which selects the features that should be updated.aHandle
- A handle which will be used by the server in an exception report if present. Can be set to null.- See Also:
-
addPropertyToUpdate
public void addPropertyToUpdate(List<TLcdDataProperty> aProperties, Object aValue) throws IllegalStateException Adds a property which should be changed by a previously initiated "Update" element. A call to this method should be preceded by a call toupdateFeatures(javax.xml.namespace.QName, com.luciad.ogc.filter.model.TLcdOGCFilter, java.lang.String)
. Properties will be sent to the server in the order in which they are added to this request.- Parameters:
aProperties
- The List of properties which represents a path from the feature to the property to update which is represented by aValue, The List can not contain many-valued properties.aValue
- The new value of the specified property, can be null in case the property should be removed. This value should not be a collection, use predicates to update collections.- Throws:
IllegalStateException
- In case the previously added transaction element is not an "Update".- See Also:
-
addPropertyToUpdate
public void addPropertyToUpdate(List<TLcdDataProperty> aProperties, List<Integer> aPredicates, Object aValue) throws IllegalStateException Adds a property which should be changed by a previously initiated "Update" element. A call to this method should be preceded by a call toupdateFeatures(javax.xml.namespace.QName, com.luciad.ogc.filter.model.TLcdOGCFilter, java.lang.String)
. Properties will be sent to the server in the order in which they are added to this request. This method takes an extra list of 'predicates' that will be encoded in the xpath. A predicate is used with many-valued properties to point to a specific element in a list of values. Predicates are in general required for all many-valued properties but the last one in the list. Specify a predicate for the lastTLcdDataProperty
inaProperties
to replace or remove a specific element from a list of elements. Adding elements to lists of elements is not specified by the WFS 1.0/1.1 specification.- Parameters:
aProperties
- The List of properties which represents a path from the feature to the property to update which is represented by aValue, The List can not contain many-valued properties.aPredicates
- An optional list of predicates that matches aProperties.aValue
- The new value of the specified property, can be null in case the property should be removed.- Throws:
IllegalStateException
- In case the previously added transaction element is not an "Update".- See Also:
-
deleteFeatures
Specifies the features which should be deleted by the server. Each call of this method will add a new "delete" request to the transaction. The order in which this method is called with respect to other insert, update or delete methods will be preserved.- Parameters:
aTypeName
- The type of the features that should be deleted, this should correspond to a type which is available on the server.aFilter
- The filter which specifies the features of aTypeName that will be deleted. The server will return an exception in case the filter is not set.aHandle
- If set, the server will use this handle in an exception report if this part of the transaction fails.
-
insertFeatures
Adds a list of GML features which should be inserted on the server. The list can also contain a feature collection which will be sent to the server as is. The GML version of the features should either match the corresponding WFS version, or should be explicitly specified as a supported input format by the server. The order in which this method is called with respect to other insert, update or delete methods will be preserved.- Parameters:
aFeatures
- A list of features which should be added to the server.aHandle
- A String that identifies this operation. If present, it will be used in any exception reports that might be returned by the server. Set to null if no handle is required.
-
setReleaseAction
Sets the release action attribute on this request. The releaseAction attribute is used to control how a Web Feature service releases locks on feature instances after a Transaction request has been processed. Valid values are the constantsALL
orSOME
, as defined in this class. Setting this value to any other value results in undefined behaviour. A value of ALL means that the Web Feature Service shall release the locks of all feature instances locked with the specified lockId regardless or whether or not the features were actually modified. A value of SOME means that the Web Feature Service will only release the locks held on feature instances that were actually operated upon by the transaction. The lockId that the client application obtained shall remain valid and the other, unmodified, feature instances shall remain locked. The default release action is ALL.- Parameters:
aReleaseAction
- The release action which should be equal to ALL or SOME.- See Also:
-
setLockId
Sets a previously obtained lock id on this request. A lock id can be obtained with a lockFeature or getFeatureWithLock request. The given id should match a valid lock which locks at least all features which are operated upon by this request. You do not need a lock id in case the features are not locked or the server does not support locking.- Parameters:
aLockId
- A valid lock id obtained from the server, or null if no lock id should be used.
-
setHandle
Sets the optional handle of this request. A handle will be used in exception reports to identify the failed request.- Parameters:
aHandle
- A String which can be used to identify this request, or null if no handle should be used.
-
setModelReferenceFormatter
Sets a reference formatter to format a model reference (i.e., an instance ofILcdModelReference
) to a String in the transaction request encoding. This can be used to support servers that use custom reference names. If none is set, a model reference will by default be encoded to an EPSG code; if there is no EPSG code available for the reference, the encoding of the request will fail.- Parameters:
aReferenceFormatter
- A valid model reference formatter.- Since:
- 2012.1
-
getModelReferenceFormatter
Returns the model reference formatter of this transaction request. By default, no explicit model reference formatter is set andnull
is returned; in this case, model references are formatted as EPSG codes.- Returns:
- A model reference formatter or
null
. - Since:
- 2012.1
- See Also:
-
getKVPEncoding
Transaction
requests do not support KVP encoding.- Specified by:
getKVPEncoding
in interfaceILcdOWSRequest
- Returns:
null
, indicating that KVP encoding is not supported forTransaction
requests.
-
getTransportData
Returns an object representing data to be used by the transportation layer (seeILcdOWSTransport
) to perform this OGC Web Service request. The type of object and the data contained in it depends on theILcdOWSTransport
object used to perform this request. An example in the case of a HTTP transport connection is a map of request properties (seeURLConnection.getRequestProperties()
) to be used for the request.- Specified by:
getTransportData
in interfaceILcdOWSRequest
- Returns:
- an object representing data to be used by the transportation layer to perform this OGC Web Service request.
-
getXMLEncoding
Returns the XML encoding of this request. If no XML encoding is supported for this request,null
should be returned.- Specified by:
getXMLEncoding
in interfaceILcdOWSRequest
- Returns:
- the XML representation of this request.
-
getRestEncoding
Returnsnull
, REST encoding is not supported.- Specified by:
getRestEncoding
in interfaceILcdOWSRequest
- Parameters:
aBaseURI
-- Returns:
null
- Since:
- 2013.0
-