static ResourceInfo unwrap(ResourceInfo info) { if (info instanceof SecuredFeatureTypeInfo) return ((SecuredFeatureTypeInfo) info).unwrap(ResourceInfo.class); if (info instanceof SecuredCoverageInfo) return ((SecuredCoverageInfo) info).unwrap(ResourceInfo.class); if (info instanceof SecuredWMSLayerInfo) return ((SecuredWMSLayerInfo) info).unwrap(ResourceInfo.class); if (info instanceof SecuredWMTSLayerInfo) return ((SecuredWMTSLayerInfo) info).unwrap(ResourceInfo.class); return info; }
static StoreInfo unwrap(StoreInfo info) { if (info instanceof SecuredDataStoreInfo) return ((SecuredDataStoreInfo) info).unwrap(StoreInfo.class); if (info instanceof SecuredCoverageStoreInfo) return ((SecuredCoverageStoreInfo) info).unwrap(StoreInfo.class); if (info instanceof SecuredWMSStoreInfo) return ((SecuredWMSStoreInfo) info).unwrap(StoreInfo.class); if (info instanceof SecuredWMTSStoreInfo) return ((SecuredWMTSStoreInfo) info).unwrap(StoreInfo.class); return info; }
@Override public FeatureSource<T, F> getFeatureSource(Name typeName) throws IOException { final FeatureSource<T, F> fs = super.getFeatureSource(typeName); if (fs == null) return null; return (FeatureSource) SecuredObjects.secure(fs, policy); }
@Override public WebMapServer getWebMapServer(ProgressListener listener) throws IOException { WebMapServer wms = super.getWebMapServer(null); if (wms == null) return null; else if (policy.level == AccessLevel.METADATA) throw SecureCatalogImpl.unauthorizedAccess(this.getName()); else return (WebMapServer) SecuredObjects.secure(wms, policy); } }
@Override public WebMapTileServer getWebMapTileServer(ProgressListener listener) throws IOException { WebMapTileServer wms = super.getWebMapTileServer(null); if (wms == null) return null; else if (policy.level == AccessLevel.METADATA) throw SecureCatalogImpl.unauthorizedAccess(this.getName()); else return (WebMapTileServer) SecuredObjects.secure(wms, policy); } }
@Override public DataAccess<? extends FeatureType, ? extends Feature> getDataStore( ProgressListener listener) throws IOException { final DataAccess<? extends FeatureType, ? extends Feature> ds = super.getDataStore(listener); if (ds == null) return null; else if (policy.level == AccessLevel.METADATA) throw SecureCatalogImpl.unauthorizedAccess(this.getName()); else return (DataAccess<? extends FeatureType, ? extends Feature>) SecuredObjects.secure(ds, policy); } }
@SuppressWarnings("unchecked") SimpleFeatureSource wrapFeatureSource(final SimpleFeatureSource fs) { if (fs == null) return null; WrapperPolicy childPolicy = buildPolicyForFeatureSource(); return DataUtilities.simple((FeatureSource) SecuredObjects.secure(fs, childPolicy)); }
public FeatureCollection<T, F> getFeatures() throws IOException { final FeatureCollection<T, F> fc = delegate.getFeatures(getReadQuery()); if (fc == null) return null; else return (FeatureCollection) SecuredObjects.secure(fc, policy); }
@Override public Layer getWMSLayer(ProgressListener listener) throws IOException { Layer layer = super.getWMSLayer(listener); if (layer == null) { return layer; } else { return new SecuredWMSLayer(layer, policy); } }
static LayerGroupInfo unwrap(LayerGroupInfo layerGroup) { if (layerGroup instanceof SecuredLayerGroupInfo) return ((SecuredLayerGroupInfo) layerGroup).unwrap(LayerGroupInfo.class); return layerGroup; }
@Override public Layer getWMTSLayer(ProgressListener listener) throws IOException { Layer layer = super.getWMTSLayer(listener); if (layer == null) { return layer; } else { return new SecuredWMTSLayer(layer, policy); } }
public void accepts( org.opengis.feature.FeatureVisitor visitor, org.opengis.util.ProgressListener progress) throws IOException { if (canDelegate(visitor)) { delegate.accepts(visitor, progress); } else { super.accepts(visitor, progress); } }
@Override public FeatureWriter<SimpleFeatureType, SimpleFeature> getFeatureWriter( String typeName, Transaction transaction) throws IOException { throw notifyUnsupportedOperation(); }
@Override protected PublishedInfo unwrap(PublishedInfo element) { return SecuredLayerGroupInfo.unwrap(element); } };
static LayerInfo unwrap(LayerInfo layer) { if (layer instanceof SecuredLayerInfo) return ((SecuredLayerInfo) layer).unwrap(LayerInfo.class); return layer; }
@Override public void removeSchema(Name typeName) throws IOException { throw notifyUnsupportedOperation(); } /**
public void modifyFeatures(String name, Object attributeValue, Filter filter) throws IOException { modifyFeatures(new String[] {name}, new Object[] {attributeValue}, filter); }
@Override public FeatureWriter<SimpleFeatureType, SimpleFeature> getFeatureWriterAppend( String typeName, Transaction transaction) throws IOException { throw notifyUnsupportedOperation(); }
@Override public FeatureWriter<SimpleFeatureType, SimpleFeature> getFeatureWriter( String typeName, Filter filter, Transaction transaction) throws IOException { throw notifyUnsupportedOperation(); }