/** * Returns the size of the memory monitor's cache for organizational units.<p> * * @return the size of the memory monitor's cache for organizational units */ public int getOrgUnitCacheSize() { if (m_orgUnitCacheSize < 0) { return getGroupCacheSize(); } return m_orgUnitCacheSize; }
/** * Sets the size of the memory monitor's cache for resources.<p> * * @param size the size of the memory monitor's cache for resources */ public void setResourceCacheSize(String size) { m_resourceCacheSize = getIntValue(size, 8192); }
/** * Returns the size of the memory monitor's cache for roles.<p> * * @return the size of the memory monitor's cache for roles */ public int getRolesCacheSize() { if (m_rolesCacheSize < 0) { return getPermissionCacheSize(); } return m_rolesCacheSize; }
cacheElement.addElement(N_KEYGENERATOR).setText(m_cacheSettings.getCacheKeyGenerator()); cacheElement.addElement(N_SIZE_USERS).setText(Integer.toString(m_cacheSettings.getUserCacheSize())); cacheElement.addElement(N_SIZE_GROUPS).setText(Integer.toString(m_cacheSettings.getGroupCacheSize())); if (m_cacheSettings.getConfiguredOrgUnitCacheSize() > -1) { cacheElement.addElement(N_SIZE_ORGUNITS).setText( Integer.toString(m_cacheSettings.getConfiguredOrgUnitCacheSize())); cacheElement.addElement(N_SIZE_USERGROUPS).setText(Integer.toString(m_cacheSettings.getUserGroupsCacheSize())); cacheElement.addElement(N_SIZE_PROJECTS).setText(Integer.toString(m_cacheSettings.getProjectCacheSize())); if (m_cacheSettings.getConfiguredProjectResourcesCacheSize() > -1) { cacheElement.addElement(N_SIZE_PROJECTRESOURCES).setText( Integer.toString(m_cacheSettings.getConfiguredProjectResourcesCacheSize())); cacheElement.addElement(N_SIZE_RESOURCES).setText(Integer.toString(m_cacheSettings.getResourceCacheSize())); if (m_cacheSettings.getConfiguredRolesCacheSize() > -1) { cacheElement.addElement(N_SIZE_ROLES).setText( Integer.toString(m_cacheSettings.getConfiguredRolesCacheSize())); Integer.toString(m_cacheSettings.getResourcelistCacheSize())); cacheElement.addElement(N_SIZE_PROPERTIES).setText(Integer.toString(m_cacheSettings.getPropertyCacheSize())); if (m_cacheSettings.getConfiguredPropertyListsCacheSize() > -1) { cacheElement.addElement(N_SIZE_PROPERTYLISTS).setText( Integer.toString(m_cacheSettings.getConfiguredPropertyListsCacheSize())); cacheElement.addElement(N_SIZE_ACLS).setText(Integer.toString(m_cacheSettings.getAclCacheSize())); cacheElement.addElement(N_SIZE_PERMISSIONS).setText(Integer.toString(m_cacheSettings.getPermissionCacheSize()));
LRUMap lruMap = new LRUMap(cacheSettings.getPermissionCacheSize()); m_cachePermission = Collections.synchronizedMap(lruMap); register(CmsSecurityManager.class.getName(), lruMap); lruMap = new LRUMap(cacheSettings.getUserCacheSize()); m_cacheUser = Collections.synchronizedMap(lruMap); register(CmsDriverManager.class.getName() + ".userCache", lruMap); lruMap = new LRUMap(cacheSettings.getGroupCacheSize()); m_cacheGroup = Collections.synchronizedMap(lruMap); register(CmsDriverManager.class.getName() + ".groupCache", lruMap); lruMap = new LRUMap(cacheSettings.getOrgUnitCacheSize()); m_cacheOrgUnit = Collections.synchronizedMap(lruMap); register(CmsDriverManager.class.getName() + ".orgUnitCache", lruMap); lruMap = new LRUMap(cacheSettings.getUserGroupsCacheSize()); m_cacheUserGroups = Collections.synchronizedMap(lruMap); register(CmsDriverManager.class.getName() + ".userGroupsCache", lruMap); lruMap = new LRUMap(cacheSettings.getProjectCacheSize()); m_cacheProject = Collections.synchronizedMap(lruMap); register(CmsDriverManager.class.getName() + ".projectCache", lruMap); lruMap = new LRUMap(cacheSettings.getProjectResourcesCacheSize()); m_cacheProjectResources = Collections.synchronizedMap(lruMap); register(CmsDriverManager.class.getName() + ".projectResourcesCache", lruMap); lruMap = new LRUMap(cacheSettings.getResourceCacheSize());
/** * @see org.opencms.security.I_CmsPermissionHandler#init(org.opencms.db.CmsDriverManager, CmsSystemConfiguration) */ public void init(CmsDriverManager driverManager, CmsSystemConfiguration systemConfiguration) { m_driverManager = driverManager; m_securityManager = driverManager.getSecurityManager(); CmsCacheSettings settings = systemConfiguration.getCacheSettings(); String className = settings.getCacheKeyGenerator(); try { // initialize the key generator m_keyGenerator = (I_CmsCacheKey)Class.forName(className).newInstance(); } catch (Exception e) { throw new CmsInitException( org.opencms.main.Messages.get().container( org.opencms.main.Messages.ERR_CRITICAL_CLASS_CREATION_1, className), e); } } }
cacheElement.addElement(N_KEYGENERATOR).setText(m_cacheSettings.getCacheKeyGenerator()); cacheElement.addElement(N_SIZE_USERS).setText(Integer.toString(m_cacheSettings.getUserCacheSize())); cacheElement.addElement(N_SIZE_GROUPS).setText(Integer.toString(m_cacheSettings.getGroupCacheSize())); if (m_cacheSettings.getConfiguredOrgUnitCacheSize() > -1) { cacheElement.addElement(N_SIZE_ORGUNITS).setText( Integer.toString(m_cacheSettings.getConfiguredOrgUnitCacheSize())); cacheElement.addElement(N_SIZE_USERGROUPS).setText(Integer.toString(m_cacheSettings.getUserGroupsCacheSize())); cacheElement.addElement(N_SIZE_PROJECTS).setText(Integer.toString(m_cacheSettings.getProjectCacheSize())); if (m_cacheSettings.getConfiguredProjectResourcesCacheSize() > -1) { cacheElement.addElement(N_SIZE_PROJECTRESOURCES).setText( Integer.toString(m_cacheSettings.getConfiguredProjectResourcesCacheSize())); cacheElement.addElement(N_SIZE_RESOURCES).setText(Integer.toString(m_cacheSettings.getResourceCacheSize())); if (m_cacheSettings.getConfiguredRolesCacheSize() > -1) { cacheElement.addElement(N_SIZE_ROLES).setText( Integer.toString(m_cacheSettings.getConfiguredRolesCacheSize())); Integer.toString(m_cacheSettings.getResourcelistCacheSize())); cacheElement.addElement(N_SIZE_PROPERTIES).setText(Integer.toString(m_cacheSettings.getPropertyCacheSize())); if (m_cacheSettings.getConfiguredPropertyListsCacheSize() > -1) { cacheElement.addElement(N_SIZE_PROPERTYLISTS).setText( Integer.toString(m_cacheSettings.getConfiguredPropertyListsCacheSize())); cacheElement.addElement(N_SIZE_ACLS).setText(Integer.toString(m_cacheSettings.getAclCacheSize())); cacheElement.addElement(N_SIZE_PERMISSIONS).setText(Integer.toString(m_cacheSettings.getPermissionCacheSize()));
m_cachePermission = createLRUCacheMap(cacheSettings.getPermissionCacheSize()); register(CmsSecurityManager.class.getName(), m_cachePermission); m_cacheUser = createLRUCacheMap(cacheSettings.getUserCacheSize()); register(CmsDriverManager.class.getName() + ".userCache", m_cacheUser); m_cacheUserList = createLRUCacheMap(cacheSettings.getUserCacheSize()); register(CmsDriverManager.class.getName() + ".userListCache", m_cacheUserList); m_cacheGroup = createLRUCacheMap(cacheSettings.getGroupCacheSize()); register(CmsDriverManager.class.getName() + ".groupCache", m_cacheGroup); m_cacheOrgUnit = createLRUCacheMap(cacheSettings.getOrgUnitCacheSize()); register(CmsDriverManager.class.getName() + ".orgUnitCache", m_cacheOrgUnit); m_cacheUserGroups = createLRUCacheMap(cacheSettings.getUserGroupsCacheSize()); register(CmsDriverManager.class.getName() + ".userGroupsCache", m_cacheUserGroups); m_cacheProject = createLRUCacheMap(cacheSettings.getProjectCacheSize()); register(CmsDriverManager.class.getName() + ".projectCache", m_cacheProject); m_cacheProjectResources = createLRUCacheMap(cacheSettings.getProjectResourcesCacheSize()); register(CmsDriverManager.class.getName() + ".projectResourcesCache", m_cacheProjectResources); m_cacheResource = createLRUCacheMap(cacheSettings.getResourceCacheSize()); register(CmsDriverManager.class.getName() + ".resourceCache", m_cacheResource); m_cacheHasRoles = createLRUCacheMap(cacheSettings.getRolesCacheSize()); register(CmsDriverManager.class.getName() + ".rolesCache", m_cacheHasRoles);
/** * @see org.opencms.security.I_CmsPermissionHandler#init(org.opencms.db.CmsDriverManager, CmsSystemConfiguration) */ public void init(CmsDriverManager driverManager, CmsSystemConfiguration systemConfiguration) { m_driverManager = driverManager; m_securityManager = driverManager.getSecurityManager(); CmsCacheSettings settings = systemConfiguration.getCacheSettings(); String className = settings.getCacheKeyGenerator(); try { // initialize the key generator m_keyGenerator = (I_CmsCacheKey)Class.forName(className).newInstance(); } catch (Exception e) { throw new CmsInitException(org.opencms.main.Messages.get().container( org.opencms.main.Messages.ERR_CRITICAL_CLASS_CREATION_1, className), e); } } }
/** * Sets the size of the driver manager's cache for projects.<p> * * @param size the size of the driver manager's cache for projects */ public void setProjectCacheSize(String size) { m_projectCacheSize = getIntValue(size, 32); }
m_keyGenerator = (I_CmsCacheKey)Class.forName(settings.getCacheKeyGenerator()).newInstance();
/** * Returns the size of the driver manager's cache for roles.<p> * * @return the size of the driver manager's cache for roles */ public int getRolesCacheSize() { if (m_rolesCacheSize < 0) { return getPermissionCacheSize(); } return m_rolesCacheSize; }
/** * Returns the size of the driver manager's cache for organizational units.<p> * * @return the size of the driver manager's cache for organizational units */ public int getOrgUnitCacheSize() { if (m_orgUnitCacheSize < 0) { return getGroupCacheSize(); } return m_orgUnitCacheSize; }
/** * Sets the size of the memory monitor's cache for project resources.<p> * * @param size the size of the memory monitor's cache for project resources */ public void setProjectResourcesCacheSize(String size) { m_projectResourcesCacheSize = getIntValue(size, -1); }
m_keyGenerator = (I_CmsCacheKey)Class.forName(settings.getCacheKeyGenerator()).newInstance();
/** * Sets the size of the memory monitor's cache for ACLs.<p> * * @param size the size of the memory monitor's cache for ACLs */ public void setAclCacheSize(String size) { m_aclCacheSize = getIntValue(size, 1024); }
/** * Sets the size of the memory monitor's cache for permission checks.<p> * * @param size the size of the memory monitor's cache for permission checks */ public void setPermissionCacheSize(String size) { m_permissionCacheSize = getIntValue(size, 1024); }
/** * Sets the size of the memory monitor's cache for properties.<p> * * @param size the size of the memory monitor's cache for properties */ public void setPropertyCacheSize(String size) { m_propertyCacheSize = getIntValue(size, 128); }
/** * Sets the size of the memory monitor's cache for property lists.<p> * * @param size the size of the memory monitor's cache for property lists */ public void setPropertyListsCacheSize(String size) { m_propertyListsCacheSize = getIntValue(size, -1); }
/** * Sets the size of the security manager's cache for permission checks.<p> * * @param size the size of the security manager's cache for permission checks */ public void setPermissionCacheSize(String size) { m_permissionCacheSize = getIntValue(size, 1024); }