private synchronized void initialize() { if (allowedUsers!=null) return; StringConfigMap properties = mgmt.getConfig(); allowedUsers = new LinkedHashSet<String>(); String users = properties.getConfig(BrooklynWebConfig.SECURITY_PROVIDER_EXPLICIT__USERS); if (users==null) { LOG.info("Web console allowing default user (admin)"); allowDefaultUsers = true; } else if ("*".equals(users)) { LOG.info("Web console allowing any users"); allowAnyUserWithValidPass = true; } else { LOG.info("Web console allowing users "+users); StringTokenizer t = new StringTokenizer(users, ","); while (t.hasMoreElements()) { allowedUsers.add((""+t.nextElement()).trim()); } } if (properties.getFirst(BrooklynServiceAttributes.BROOKLYN_AUTOLOGIN_USERNAME)!=null) { LOG.warn("Use of legacy AUTOLOGIN; replace with setting BrooklynSystemProperties.SECURITY_PROVIDER to "+AnyoneSecurityProvider.class.getCanonicalName()); allowAnyUser = true; } }
public String getInstallDir() { // Cache it; evaluate lazily (and late) to ensure managementContext.config is accessible and completed its setup // Caching has the benefit that the driver is usable, even if the entity is unmanaged (useful in some tests!) if (installDir == null) { String installBasedir = ((EntityInternal)entity).getManagementContext().getConfig().getFirst("brooklyn.dirs.install"); if (installBasedir == null) installBasedir = DEFAULT_INSTALL_BASEDIR; if (installBasedir.endsWith(File.separator)) installBasedir.substring(0, installBasedir.length()-1); installDir = elvis(entity.getConfig(SoftwareProcess.SUGGESTED_INSTALL_DIR), installBasedir+"/"+getEntityVersionLabel("/")); } return installDir; }
public String getRunDir() { if (runDir == null) { String runBasedir = ((EntityInternal)entity).getManagementContext().getConfig().getFirst("brooklyn.dirs.run"); if (runBasedir == null) runBasedir = DEFAULT_RUN_BASEDIR; if (runBasedir.endsWith(File.separator)) runBasedir.substring(0, runBasedir.length()-1); runDir = elvis(entity.getConfig(SoftwareProcess.SUGGESTED_RUN_DIR), runBasedir+"/"+entity.getApplication().getId()+"/"+"entities"+"/"+ getEntityVersionLabel()+"_"+entity.getId()); } return runDir; }