public LockFeatureResponseType lockFeature(LockFeatureType request) throws WFSException { LockFeature lockFeature = new LockFeature(getServiceInfo(), getCatalog(), filterFactory); LockFeatureRequest.WFS20 requestWrapper = new LockFeatureRequest.WFS20(request); if (request.getLockId() != null) { lockFeature.refresh(request.getLockId(), true); LockFeatureResponse response = requestWrapper.createResponse(); response.setLockId(request.getLockId()); return (LockFeatureResponseType) response.getAdaptee(); } else { // Need to perform some of the same Stored Query handling as GetFeature // ... expand eventual stored queries boolean getFeatureById = GetFeature.expandStoredQueries( requestWrapper, request.getAbstractQueryExpression(), getStoredQueryProvider()); // ... expand the typenames from feature id filters (the wrappers will modify the // underlying object List<Query> queries = GetFeatureRequest.WFS20.getQueries(request.getAbstractQueryExpression()); GetFeature.expandTypeNames(requestWrapper, queries, getFeatureById, getCatalog()); // ... lock cannot handle queries with multiple target typenames, need to expand them // into separate queries fixQueriesForLock(request.getAbstractQueryExpression()); // run the lock return (LockFeatureResponseType) lockFeature.lockFeature(requestWrapper).getAdaptee(); } }
@Override public LockFeatureRequest createLockRequest() { return new LockFeatureRequest.WFS20( ((Wfs20Factory) getFactory()).createLockFeatureType()); }
public static LockFeatureRequest adapt(Object request) { if (request instanceof LockFeatureType) { return new WFS11((EObject) request); } else if (request instanceof net.opengis.wfs20.LockFeatureType) { return new WFS20((EObject) request); } return null; }