Package org.geoserver.security

Examples of org.geoserver.security.PropertyFileWatcher$LinkedProperties


   * If no user information is found, a default user will be created.
   */
  public EditableUserDAO(){
    myDetailStorage = new HashMap<String,UserDetails>();
    try {
      myWatcher = new PropertyFileWatcher(getUserFile());
    } catch (Exception e){
      // TODO:log error someplace
      createDefaultUser();
    }

View Full Code Here


     * @param typeName
     * @return the mapping
     */
    public CatalogStoreMapping getMapping(String typeName) {
       
        PropertyFileWatcher watcher = watchers.get(typeName);
       
        if (watcher!=null && watcher.isModified()  ) {
            try {
                addMapping (typeName, CatalogStoreMapping.parse(new HashMap<String, String>((Map) watcher.getProperties())));
            } catch (IOException e) {
                LOGGER.log(Level.WARNING, e.toString());
            }
        }
       
View Full Code Here

        File dir = loader.findOrCreateDirectory("csw");
        for (Name name : descriptorByType.keySet()) {
            String typeName = name.getLocalPart();
            File f = new File(dir, typeName + ".properties");

            PropertyFileWatcher watcher = new PropertyFileWatcher(f);
            watchers.put(typeName, watcher);
           
            if (!f.exists()) {          
                IOUtils.copy(getClass().getResourceAsStream(typeName + ".default.properties"),f);
            }
           
            addMapping (typeName, CatalogStoreMapping.parse(new HashMap<String, String>((Map) watcher.getProperties())));
        }
    }      
View Full Code Here

                   
                    if (!layers.exists()) {
                        this.rules = new TreeSet<R>();
                    } else {
                        // ok, something is there, let's load it
                        watcher = new PropertyFileWatcher(layers);
                        loadRules(watcher.getProperties());
                    }
                }
                lastModified = System.currentTimeMillis();
            } else if (isModified()) {   
View Full Code Here

        if (f == null) {
            f = loader.createFile("monitoring", "monitor.properties");
            loader.copyFromClassPath("monitor.properties", f, MonitorConfig.class);
        }
       
        fw = new PropertyFileWatcher(f);
    }
View Full Code Here

        File temp = File.createTempFile("sectest", "", new File("target"));
        temp.delete();
        temp.mkdir();
        File propFile = new File(temp, "users.properties");
        try {
            dao.userDefinitionsFile = new PropertyFileWatcher(propFile);
            dao.storeUsers();
            dao.userMap.clear();
            dao.loadUserMap();
        } finally {
            temp.delete();
View Full Code Here

    {
        try{
            GeoServerResourceLoader loader = GeoServerExtensions.bean(GeoServerResourceLoader.class);
            Resource configFile = loader.get( "proxy/proxy.xml" );
           
            configWatcher = new PropertyFileWatcher(configFile);
            watcherWorks = true;
            LOGGER.log(Level.INFO, "Proxy init'd pretty much ok.");
        }
        catch(Exception e){
            LOGGER.log(Level.WARNING, "Proxy could not create configuration watcher.  Proxy will not be able to update its configuration when it is modified.  Exception:", e);
View Full Code Here

        if (LOGGER.isLoggable(Level.FINE)) {
            LOGGER.log(Level.FINE, "Loading configuration");
        }
        // Get the Property file as a Resource
        Resource downloadProperties = loader.get(PROPERTYFILENAME);
        init(new PropertyFileWatcher(downloadProperties));
    }
View Full Code Here

    void checkUserMap() throws DataAccessResourceFailureException {
        try {
            if ((userMap == null) || userDefinitionsFile == null || userDefinitionsFile.isStale()) {                       
                if (userDefinitionsFile == null) {
                    Resource propFile = findUserProperties();
                    userDefinitionsFile = new PropertyFileWatcher(propFile);
                }
                userMap = loadUsersFromProperties(userDefinitionsFile.getProperties());
            }   
        } catch (Exception e) {
            LOGGER.log(Level.SEVERE, "An error occurred loading user definitions", e);
View Full Code Here

TOP

Related Classes of org.geoserver.security.PropertyFileWatcher$LinkedProperties

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.