public abstract class ALcdWFSTransactionHandler extends Object
ALcdWFSTransactionHandler
instance is created. Each action of
the request will result in a call to a method of that new instance. The order
of the calls will always match the order of actions in the request.
After all actions have been successfully handled, the commit(java.lang.String, com.luciad.ogc.wfs.TLcdWFSRequestContext)
method is called. When an error occurs before this call, the
rollback(com.luciad.ogc.wfs.TLcdWFSRequestContext)
method is called.ILcdWFSTransactionHandlerFactory
,
ILcdWFSServerModelEncoderFactory
Constructor and Description |
---|
ALcdWFSTransactionHandler() |
Modifier and Type | Method and Description |
---|---|
abstract void |
commit(String aHandle,
TLcdWFSRequestContext aContext)
Commits this transaction to the data store.
|
abstract int |
handleDeleteSFCT(ILcdWFSFeatureType aFeatureType,
List<Object> aDeletedFeaturesSFCT,
TLcdOGCFilter aFilter,
String aHandle,
TLcdWFSRequestContext aContext)
Handles a delete action of a transaction request.
|
abstract List<Object> |
handleInsert(ILcdWFSFeatureType aFeatureType,
List<Object> aNewFeatures,
String aHandle,
TLcdWFSRequestContext aContext)
Handles an insert action of a transaction request.
|
abstract int |
handleUpdateSFCT(ILcdWFSFeatureType aFeatureType,
List<TLcdWFSTransactionUpdateProperty> aUpdateProperties,
List<Object> aUpdatedFeatureTokensSFCT,
List<Object> aNewFeatureTokensSFCT,
TLcdOGCFilter aFilter,
String aHandle,
TLcdWFSRequestContext aContext)
Handles an update action of a transaction request.
|
abstract void |
rollback(TLcdWFSRequestContext aContext)
Rolls back a transaction which is in progress, this method is called
whenever an exception occurs before a transaction is committed.
|
public abstract List<Object> handleInsert(ILcdWFSFeatureType aFeatureType, List<Object> aNewFeatures, String aHandle, TLcdWFSRequestContext aContext) throws TLcdWFSServiceException
commit(java.lang.String, com.luciad.ogc.wfs.TLcdWFSRequestContext)
is
called.aFeatureType
- the feature type of the features in aNewFeatures
.aNewFeatures
- a List containing features of the same ILcdWFSFeatureType
in
the native format of the feature type.aHandle
- a handle that identifies this insert action in the request, or null if it is not
specified.aContext
- the request context.List
of inserted features. No assumptions are being made about the type
of objects in the List
. The objects can be used with the
ILcdOGCFeatureIdRetriever
to obtain the feature ids of the inserted
features. This List
does not have to contain the same objects as
aNewFeatures
, but the order should be respected.TLcdWFSServiceException
- in case the action could not be executed and the transaction
should be aborted.public abstract int handleUpdateSFCT(ILcdWFSFeatureType aFeatureType, List<TLcdWFSTransactionUpdateProperty> aUpdateProperties, List<Object> aUpdatedFeatureTokensSFCT, List<Object> aNewFeatureTokensSFCT, TLcdOGCFilter aFilter, String aHandle, TLcdWFSRequestContext aContext) throws TLcdWFSServiceException
commit(java.lang.String, com.luciad.ogc.wfs.TLcdWFSRequestContext)
is
called.
It is possible to remove a given property by setting the value corresponding to the name of
that property to null, however a WFS should throw an exception in case the update tries to
remove a required property.
The return value of this method is the number of updated features, but as a side effect it
should also fill in two List
s of feature 'tokens'. In this context, a feature
token is any Object which can be passed on to an ILcdOGCFeatureIdRetriever
to
retrieve feature id's or an ALcdWFSLock
to unlock features.
The first List, aUpdatedFeatureTokensSFCT
is used to unlock features that were
affected by this request in case the lockAction attribute was set to 'SOME'. Next to that, it
can also be used to retrieve the feature id's of the features affected by this update. This is
mostly important when the server supports versioning which causes the feature id's to change
after an update.
When this List is not filled in, the server will not be able to selectively unlock features
affected by this transaction. Only if the lockAction is set to 'ALL', the lock will be
released. The server will also assume that no updated feature id's should be returned to the
client.
The second List, aNewFeatureTokensSFCT
is used to determine the new feature id's
in case the update caused those to change. This is usually the case when the server supports
versioning. The length of this List should always match the length of
aUpdatedFeatureTokensSFCT
.aFeatureType
- the feature type of the features to be updated.aUpdateProperties
- a List containing the updates which should be applied.aUpdatedFeatureTokensSFCT
- an empty List which is to be filled with feature 'tokens'.
These 'tokens' can be used to retrieve the id's of features that are affected, and to
unlock those features.aNewFeatureTokensSFCT
- an empty List which can be used to store the feature 'tokens' that
are the result of updating the features in aUpdatedFeatureTokensSFCT
,
this List is only relevant if the server supports versioning.aFilter
- a filter which specifies the features that should be updated.aHandle
- a handle which identifies this update action in the request, or null if it is
not specified.aContext
- aContext the request context.TLcdWFSServiceException
- if the update request cannot be applied. This includes:
assigning null values to required properties or assigning values with a type
different from the type of the property (e.g., 'abc' to an integer property).public abstract int handleDeleteSFCT(ILcdWFSFeatureType aFeatureType, List<Object> aDeletedFeaturesSFCT, TLcdOGCFilter aFilter, String aHandle, TLcdWFSRequestContext aContext) throws TLcdWFSServiceException
commit(java.lang.String, com.luciad.ogc.wfs.TLcdWFSRequestContext)
is called.aFeatureType
- the feature type of the features to be deleted.aDeletedFeaturesSFCT
- a list which can optionally be used to store all features which
were deleted by this method. This list can then be used to unlock
deleted features. In case the list is not empty, its size should
match the returned integer.aFilter
- the filter that specifies the features to be deleted. A filter can
not be null, otherwise no features should be deleted.aHandle
- a handle which identifies this delete action in the request, or
null if it is not specified.aContext
- the request context.TLcdWFSServiceException
- In case the action could not be executed and the transaction
should be aborted.public abstract void commit(String aHandle, TLcdWFSRequestContext aContext) throws TLcdWFSServiceException
aHandle
- a handle which identifies this transaction.aContext
- the request context.TLcdWFSServiceException
- if the transaction could not be committed.public abstract void rollback(TLcdWFSRequestContext aContext)
aContext
- the request context.