public Catalog getCatalog() { // have to look this up dynamically on demand on avoid circular dependency on application // context startup return (Catalog) GeoServerExtensions.bean("catalog"); }
/** * Builds a new dao * * @param rawCatalog */ public ServiceAccessRuleDAO() throws IOException { super(GeoServerExtensions.bean(GeoServerDataDirectory.class), SERVICES); }
protected AbstractAccessRuleDAO(Resource securityDirectory, String propertyFileName) { this.securityDir = securityDirectory; this.propertyFileName = propertyFileName; this.dd = GeoServerExtensions.bean(GeoServerDataDirectory.class); // this.dd = org.vfny.geoserver.global.GeoserverDataDirectory.accessor(); }
public Catalog getCatalog() { // JD: this class gets called during catalog initialization when reading store instances // that // potentially have encrypted parameters, so we have to be careful about how we access the // catalog, raw catalog directly to avoid triggering the initialization of the secure // catalog as we are reading the raw catalog contents (this could for instance cause a rule // to be ignored since a workspace has not been read) return (Catalog) GeoServerExtensions.bean("rawCatalog"); }
/** * Constructs the template loader. * * @param caller The "calling" class, used to look up templates based with {@link * Class#getResource(String)}, may be <code>null</code> * @deprecated Use {@link #GeoServerTemplateLoader(Class, GeoServerResourceLoader)} * @throws IOException */ public GeoServerTemplateLoader(Class caller) throws IOException { this(caller, GeoServerExtensions.bean(GeoServerResourceLoader.class)); }
/** Accessor for the GeoServer catalog. */ public Catalog getCatalog() { if (catalog != null) { return catalog; } catalog = GeoServerExtensions.bean(Catalog.class); if (catalog == null) { LOGGER.severe("Could not locate geoserver catalog"); } return catalog; } }
private EntityResolver getEntityResolver() { // would be best injected, but apparently most of the code is // actually creating a GeoServerDataDirectory object programmatically and/or on the fly, so // we have to resort to a dynamic spring context lookup instead EntityResolver resolver = null; EntityResolverProvider provider = GeoServerExtensions.bean(EntityResolverProvider.class); if (provider != null) { resolver = provider.getEntityResolver(); } return resolver; }
/** * Checks if the current user is authenticated and is the administrator. Protected to allow * overriding in tests. */ protected boolean isAdmin(Authentication authentication) { return GeoServerExtensions.bean(GeoServerSecurityManager.class) .checkAuthenticationForAdminRole(authentication); }
ServiceStrategy findOutputStrategy(HttpServletResponse response) { OutputStrategyFactory factory = null; try { factory = (OutputStrategyFactory) GeoServerExtensions.bean("serviceStrategyFactory"); } catch (NoSuchBeanDefinitionException e) { return null; } return factory.createOutputStrategy(response); }
protected GeoServerLoader lookupGeoServerLoader(ApplicationContext appContext) { GeoServerLoader loader = GeoServerExtensions.bean(GeoServerLoader.class, appContext); if (loader == null) { loader = new DefaultGeoServerLoader(resourceLoader); } return loader; }
@Override public void initializeFromConfig(SecurityNamedServiceConfig config) throws IOException { super.initializeFromConfig(config); RoleFilterConfig roleConfig = (RoleFilterConfig) config; headerAttribute = roleConfig.getHttpResponseHeaderAttrForIncludedRoles(); // TODO, Justin, is this ok ? String converterName = roleConfig.getRoleConverterName(); if (converterName == null || converterName.length() == 0) converter = GeoServerExtensions.bean(GeoServerRoleConverter.class); else converter = (GeoServerRoleConverter) GeoServerExtensions.bean(converterName); }
public void setFacade(CatalogFacade facade) { final GeoServerConfigurationLock configurationLock = GeoServerExtensions.bean(GeoServerConfigurationLock.class); if (configurationLock != null) { facade = LockingCatalogFacade.create(facade, configurationLock); } this.facade = facade; facade.setCatalog(this); }
private Object readResolve() throws ObjectStreamException { EntityResolverProvider resolverProvider = GeoServerExtensions.bean(EntityResolverProvider.class); EntityResolver resolver = null; if (resolverProvider != null) { resolver = resolverProvider.getEntityResolver(); } return new SerializableEntityResolver(resolver); } }
@Override public String toString(Object obj) { String source = obj == null ? "" : (String) obj; GeoServerSecurityManager manager = GeoServerExtensions.bean(GeoServerSecurityManager.class); return manager.getConfigPasswordEncryptionHelper().encode(source); };
static DataAccessManager lookupDataAccessManager() throws Exception { DataAccessManager manager = GeoServerExtensions.bean(DataAccessManager.class); if (manager != null && manager instanceof DataAccessManagerWrapper) { ((DataAccessManagerWrapper) manager).setDelegate(buildDefaultResourceAccessManager()); } return manager; }
protected Object lookupBean(String name) throws NoSuchBeanDefinitionException { Object bean = GeoServerExtensions.bean(name, manager.getApplicationContext()); if (bean == null) { throw new NoSuchBeanDefinitionException(name); } return bean; }
public GeoServerTemplateLoader(Class caller, GeoServerDataDirectory dd) throws IOException { this.dd = dd; // create a file template loader to delegate to fileTemplateLoader = new FileTemplateLoader(dd.root()); // grab the catalog and store a reference catalog = (Catalog) GeoServerExtensions.bean("catalog"); // create a class template loader to delegate to if (caller != null) { classTemplateLoader = new ClassTemplateLoader(caller, ""); } }
KeyStoreProvider lookupKeyStoreProvider() { KeyStoreProvider ksp = GeoServerExtensions.bean(KeyStoreProvider.class); if (ksp == null) { // use default key store provider ksp = new KeyStoreProviderImpl(); } ksp.setSecurityManager(this); return new LockingKeyStoreProvider(ksp); }
private CatalogInfo replaceCatalogInfo(CatalogInfo ci) { String id = ci.getId(); Catalog catalog = (Catalog) GeoServerExtensions.bean("catalog"); FilterFactory ff = CommonFactoryFinder.getFilterFactory(); Class iface = getCatalogInfoInterface(ci.getClass()); CatalogInfo replacement = catalog.get(iface, ff.equal(ff.property("id"), ff.literal(id), true)); return replacement; }