public class TLcdWFSTransactionRequest extends Object implements ILcdOWSRequest
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.Modifier and Type | Class and Description |
---|---|
static class |
TLcdWFSTransactionRequest.ReleaseAction
An enumeration that corresponds to the 'ReleaseAction' attribute of a 'Transaction' request.
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyToUpdate(List<TLcdDataProperty> aProperties,
List<Integer> aPredicates,
Object aValue)
Adds a property which should be changed by a previously initiated "Update" element.
|
void |
addPropertyToUpdate(List<TLcdDataProperty> aProperties,
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.
|
Map |
getKVPEncoding()
Transaction requests do not support KVP encoding. |
ILcdModelReferenceFormatter |
getModelReferenceFormatter()
Returns the model reference formatter of this transaction request.
|
URI |
getRestEncoding(URI aBaseURI)
Returns
null , REST encoding is not supported. |
Object |
getTransportData()
Returns an object representing data to be used by the transportation layer (see
ILcdOWSTransport )
to perform this OGC Web Service request. |
InputStream |
getXMLEncoding()
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 |
setHandle(String aHandle)
Sets the optional handle of this request.
|
void |
setLockId(String aLockId)
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 of
ILcdModelReference ) 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.
|
public void updateFeatures(QName aTypeName, TLcdOGCFilter aFilter, String aHandle)
addPropertyToUpdate(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.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.addPropertyToUpdate(java.util.List, Object)
public void addPropertyToUpdate(List<TLcdDataProperty> aProperties, Object aValue) throws IllegalStateException
updateFeatures(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.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.IllegalStateException
- In case the previously added transaction element is not an
"Update".updateFeatures(javax.xml.namespace.QName, com.luciad.ogc.filter.model.TLcdOGCFilter,
String)
,
addPropertyToUpdate(List, List, Object)
public void addPropertyToUpdate(List<TLcdDataProperty> aProperties, List<Integer> aPredicates, Object aValue) throws IllegalStateException
updateFeatures(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 last TLcdDataProperty
in aProperties
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.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.IllegalStateException
- In case the previously added transaction element is not an
"Update".updateFeatures(javax.xml.namespace.QName, com.luciad.ogc.filter.model.TLcdOGCFilter,
String)
public void deleteFeatures(QName aTypeName, TLcdOGCFilter aFilter, String aHandle)
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.public void insertFeatures(List<ILcdDataObject> aFeatures, String aHandle)
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.public void setReleaseAction(TLcdWFSTransactionRequest.ReleaseAction aReleaseAction)
ALL
or SOME
, 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.aReleaseAction
- The release action which should be equal to ALL or SOME.TLcdWFSTransactionRequest.ReleaseAction.ALL
,
TLcdWFSTransactionRequest.ReleaseAction.SOME
public void setLockId(String aLockId)
aLockId
- A valid lock id obtained from the server, or null if no lock id should be used.public void setHandle(String aHandle)
aHandle
- A String which can be used to identify this request, or null if no handle should be used.public void setModelReferenceFormatter(ILcdModelReferenceFormatter aReferenceFormatter)
ILcdModelReference
) 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.aReferenceFormatter
- A valid model reference formatter.public ILcdModelReferenceFormatter getModelReferenceFormatter()
null
is returned;
in this case, model references are formatted as EPSG codes.null
.setModelReferenceFormatter(ILcdModelReferenceFormatter)
public Map getKVPEncoding()
Transaction
requests do not support KVP encoding.getKVPEncoding
in interface ILcdOWSRequest
null
, indicating that KVP encoding is not supported for Transaction
requests.public Object getTransportData()
ILcdOWSTransport
)
to perform this OGC Web Service request. The type of object and the data contained in it depends on
the ILcdOWSTransport
object used to perform this request.
An example in the case of a HTTP transport connection is a map of request properties
(see URLConnection.getRequestProperties()
) to be used
for the request.getTransportData
in interface ILcdOWSRequest
public InputStream getXMLEncoding()
null
should be returned.getXMLEncoding
in interface ILcdOWSRequest
public URI getRestEncoding(URI aBaseURI)
null
, REST encoding is not supported.getRestEncoding
in interface ILcdOWSRequest
aBaseURI
- null