/** * * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { throw new WFSException("Circle is not supported", "InvalidParameterValue"); } }
void checkTimeout() { if (!cancelled && System.currentTimeMillis() > timeoutTime) { this.thrown = true; throw new WFSException(request, "Timeout exceeded", TIMEOUT_EXCEPTION_CODE); } }
FeatureTypeInfo featureTypeInfo(QName name) throws WFSException, IOException { FeatureTypeInfo meta = catalog.getFeatureTypeInfo(name.getLocalPart(), name.getNamespaceURI()); if (meta == null) { String msg = "Could not locate " + name + " in catalog."; throw new WFSException(msg); } return meta; } }
private void checkValidJoinFilter(Filter filter) { Set<String> prefixes = getFilterPrefixes(filter); if (prefixes.size() > 2) { throw new WFSException( "Not subfilter joins against more than one table " + prefixes + ", this kind of filter is not supported: " + filter); } }
FeatureTypeInfo featureTypeInfo(QName name) throws WFSException, IOException { FeatureTypeInfo meta = catalog.getFeatureTypeInfo(name.getLocalPart(), name.getNamespaceURI()); if (meta == null) { String msg = "Could not locate " + name + " in catalog."; throw new WFSException(msg); } return meta; } }
public void checkValidity(TransactionElement element, Map featureTypeInfos) throws WFSTransactionException { if (!getInfo().getServiceLevel().getOps().contains(WFSInfo.Operation.TRANSACTION_REPLACE)) { throw new WFSException(element, "Transaction REPLACE support is not enabled"); } if (featureTypeInfos.size() != 1) { throw new WFSException( element, "Transaction REPLACE must only specify features from a" + " single feature type"); } }
FeatureTypeInfo featureTypeInfo(QName name, GetFeatureRequest request) throws WFSException, IOException { FeatureTypeInfo meta = catalog.getFeatureTypeByName(name.getNamespaceURI(), name.getLocalPart()); if (meta == null) { String msg = "Could not locate " + name + " in catalog."; throw new WFSException(request, msg, "InvalidParameterValue").locator("typeName"); } return meta; }
@Override public Object read(Object request, Map kvp, Map rawKvp) throws Exception { // special cite compliance check to ensure the client specified typeNames rather than just // typeName (but typename is a parameter in a StoredQuery in CITE tests!!) if (!kvp.containsKey("typenames") && kvp.containsKey("typename") && getWFS().isCiteCompliant() && !kvp.containsKey("STOREDQUERY_ID")) { throw new WFSException("WFS 2.0 requires typeNames, not typeName"); } return super.read(request, kvp, rawKvp); } }
private void checkNonSpatial(PropertyName pn) { AttributeDescriptor ad = (AttributeDescriptor) pn.evaluate(featureType); if (ad instanceof GeometryDescriptor || isGmlBoundedBy(pn)) { throw new WFSException( request, "Cannot use a spatial property in a alphanumeric binary " + "comparison"); } } };
public Object visit(PropertyName name, Object data) { // case of multiple geometries being returned if (name.evaluate(featureType) == null) { // we want to throw wfs exception, but cant throw new WFSException("Illegal property name: " + name.getPropertyName(), "InvalidParameterValue"); } return name; } ;
@Override public String getMimeType(Object value, Operation operation) throws ServiceException { try { TransformInfo info = locateTransformation((FeatureCollectionResponse) value, operation); return info.mimeType(); } catch(IOException e) { throw new WFSException("Failed to load the required transformation", e); } }
public Object visit(PropertyName name, Object data) { // case of multiple geometries being returned if (name.evaluate(featureType) == null) { // we want to throw wfs exception, but cant throw new WFSException("Illegal property name: " + name.getPropertyName(), "InvalidParameterValue"); } return name; } ;
public void checkValidity( TransactionElement element, Map<QName, FeatureTypeInfo> featureTypeInfos) throws WFSTransactionException { if (!getInfo().getServiceLevel().getOps().contains(WFSInfo.Operation.TRANSACTION_INSERT)) { throw new WFSException(element, "Transaction INSERT support is not enabled"); } }
protected FeatureCollection getFeatures(GetFeatureType request, FeatureSource source, Query gtQuery) throws IOException { if(!(source instanceof VersioningFeatureSource)) throw new WFSException(source.getSchema().getTypeName() + " is not versioned, cannot " + "execute a GetVersionedFeature on it"); return ((VersioningFeatureSource) source).getVersionedFeatures(gtQuery); }
public void checkValidity(TransactionElement delete, Map featureTypeInfos) throws WFSTransactionException { if (!getInfo().getServiceLevel().getOps().contains(WFSInfo.Operation.TRANSACTION_DELETE)) { throw new WFSException(delete, "Transaction Delete support is not enabled"); } Filter f = delete.getFilter(); if ((f == null) || Filter.INCLUDE.equals(f)) { throw new WFSTransactionException( "Must specify filter for delete", "MissingParameterValue"); } }
private Operation buildSourceOperation(Operation operation, TransformInfo info) { try { EObject originalParam = (EObject) operation.getParameters()[0]; EObject copy = EcoreUtil.copy(originalParam); BeanUtils.setProperty(copy, "outputFormat", info.getSourceFormat()); final Operation sourceOperation = new Operation(operation.getId(), operation.getService(), operation.getMethod(), new Object[] { copy }); return sourceOperation; } catch (Exception e) { throw new WFSException( "Failed to create the source operation for XSLT, this is unexpected", e); } }
/** * Test {@link WFSException#init(Object)} for Exception with a WFS20 {@link Delete}-Action. * * @see "https://osgeo-org.atlassian.net/browse/GEOS-5857" */ @Test public void testWFS20Delete() { WFSException tmpEx = new WFSException(new Delete.WFS20(deleteType2), "test"); Assert.assertEquals("Delete", tmpEx.getLocator()); }
/** * Test {@link WFSException#init(Object)} for Exception with a WFS11 {@link Delete}-Action. * * @see "https://osgeo-org.atlassian.net/browse/GEOS-5857" */ @Test public void testWFS11Delete() { WFSException tmpEx = new WFSException(new Delete.WFS11(deleteElementType1), "test"); // WFS 1.x: no locator Assert.assertNull(tmpEx.getLocator()); }
/** * Test {@link WFSException#init(Object)} for Exception with a WFS20 {@link * GetFeatureRequest}-Action. * * @see "https://osgeo-org.atlassian.net/browse/GEOS-5857" */ @Test public void testWFS20GetFeatureType() { WFSException tmpEx = new WFSException(new GetFeatureRequest.WFS20(getFeatureType2), "test"); Assert.assertEquals("GetFeature", tmpEx.getLocator()); } }
/** * Test {@link WFSException#init(Object)} for Exception with a WFS11 {@link * GetFeatureRequest}-Action. * * @see "https://osgeo-org.atlassian.net/browse/GEOS-5857" */ @Test public void testWFS11GetFeatureType() { WFSException tmpEx = new WFSException(new GetFeatureRequest.WFS11(getFeatureType1), "test"); // WFS 1.x: no locator, GetFeature type is a top-level request and provides a default // version (1.1.0) Assert.assertNull(tmpEx.getLocator()); }