public PublishedInfo getLayer() { if (layerGroupId != null) { return GeoServerApplication.get().getCatalog().getLayerGroup(layerGroupId); } else if (layerId != null) { return GeoServerApplication.get().getCatalog().getLayer(layerId); } else { return null; } }
@Override protected SettingsInfo load() { GeoServer gs = GeoServerApplication.get().getGeoServer(); return gs.getSettings(wsModel.getObject()); } }
static HazelcastInstance getHazelcast() { return GeoServerApplication.get().getBeanOfType(HzCluster.class).getHz(); } }
/** * accessors for security manager */ public GeoServerSecurityManager getSecurityManager() { return GeoServerApplication.get().getSecurityManager(); }
@Override protected List<String> load() { List<StyleHandler> handlers = GeoServerApplication.get().getBeansOfType(StyleHandler.class); return Lists.transform( handlers, new Function<StyleHandler, String>() { @Nullable @Override public String apply(@Nullable StyleHandler styleHandler) { return styleHandler.getFormat(); } }); } }
/** * Convenience method for pages to get access to the geoserver * configuration. */ protected GeoServer getGeoServer() { return getGeoServerApplication().getGeoServer(); }
/** * Provides catalog access for the provider (cannot be stored as a field, this class is going to * be serialized) */ protected Catalog getCatalog() { return getApplication().getCatalog(); }
/** * Returns the security manager. */ public GeoServerSecurityManager getSecurityManager() { return getBeanOfType(GeoServerSecurityManager.class); }
public RequestCycle(GeoServerApplication app, WebRequest req, WebResponse resp) { super(app, req, resp); callbacks = app.getBeansOfType(WicketCallback.class); }
/** * Loads a bean from the spring application context of a specific type. * <p> * If there are multiple beans of the specfied type in the context an exception is thrown. * </p> * * @param type The class of the bean to return. */ public <T> T getBeanOfType(Class<T> type) { return GeoServerExtensions.bean(type, getApplicationContext()); }
public ImporterPageManager getPageManager() { return (ImporterPageManager) this.getGeoServerApplication().getBean("importerPages"); } }
@Override protected SecurityManagerConfig load() { return GeoServerApplication.get().getSecurityManager().getSecurityConfig(); } }
@Override public boolean isAccessAllowed(Class componentClass, Authentication authentication) { // if not admin just say no if (!super.isAccessAllowed(componentClass, authentication)) { return false; } // hide the page if there is demo around GeoServerApplication app = GeoServerApplication.get(); for (Class linkClass : linkClasses) { if(app.getBeansOfType(linkClass).size() > 0) { return true; } } return false; }
@Override protected GeoServer getGeoServer() { return super.getGeoServerApplication().getGeoServer(); }
/** * Convenience method for pages to get access to the catalog. */ protected Catalog getCatalog() { return getGeoServerApplication().getCatalog(); }
/** * Returns the geoserver resource loader. */ public GeoServerResourceLoader getResourceLoader() { return getBeanOfType(GeoServerResourceLoader.class); }
public CallbackRequestCycleListener(GeoServerApplication app) { callbacks = app.getBeansOfType(WicketCallback.class); }
/** * Loads beans from the spring application context of a specific type. * * @param type The type of beans to return. * * @return A list of objects of the specified type, possibly empty. * @see {@link GeoServerExtensions#extensions(Class, ApplicationContext)} */ public <T> List<T> getBeansOfType(Class<T> type) { return GeoServerExtensions.extensions(type, getApplicationContext()); }