1 31 32 package org.opencms.db; 33 34 43 public class CmsCacheSettings { 44 45 46 private int m_aclCacheSize; 47 48 49 private String m_cacheKeyGenerator; 50 51 52 private int m_groupCacheSize; 53 54 55 private int m_permissionCacheSize; 56 57 58 private int m_projectCacheSize; 59 60 61 private int m_propertyCacheSize; 62 63 64 private int m_resourceCacheSize; 65 66 67 private int m_resourcelistCacheSize; 68 69 70 private int m_userCacheSize; 71 72 73 private int m_userGroupsCacheSize; 74 75 78 public CmsCacheSettings() { 79 80 super(); 81 } 82 83 88 public int getAclCacheSize() { 89 90 return m_aclCacheSize; 91 } 92 93 98 public String getCacheKeyGenerator() { 99 100 return m_cacheKeyGenerator; 101 } 102 103 108 public int getGroupCacheSize() { 109 110 return m_groupCacheSize; 111 } 112 113 118 public int getPermissionCacheSize() { 119 120 return m_permissionCacheSize; 121 } 122 123 128 public int getProjectCacheSize() { 129 130 return m_projectCacheSize; 131 } 132 133 138 public int getPropertyCacheSize() { 139 140 return m_propertyCacheSize; 141 } 142 143 148 public int getResourceCacheSize() { 149 150 return m_resourceCacheSize; 151 } 152 153 158 public int getResourcelistCacheSize() { 159 160 return m_resourcelistCacheSize; 161 } 162 163 168 public int getUserCacheSize() { 169 170 return m_userCacheSize; 171 } 172 173 178 public int getUserGroupsCacheSize() { 179 180 return m_userGroupsCacheSize; 181 } 182 183 188 public void setAclCacheSize(String size) { 189 190 m_aclCacheSize = getIntValue(size, 1024); 191 } 192 193 198 public void setCacheKeyGenerator(String classname) { 199 200 m_cacheKeyGenerator = classname; 201 } 202 203 208 public void setGroupCacheSize(String size) { 209 210 m_groupCacheSize = getIntValue(size, 64); 211 } 212 213 218 public void setPermissionCacheSize(String size) { 219 220 m_permissionCacheSize = getIntValue(size, 1024); 221 } 222 223 228 public void setProjectCacheSize(String size) { 229 230 m_projectCacheSize = getIntValue(size, 32); 231 } 232 233 238 public void setPropertyCacheSize(String size) { 239 240 m_propertyCacheSize = getIntValue(size, 128); 241 } 242 243 248 public void setResourceCacheSize(String size) { 249 250 m_resourceCacheSize = getIntValue(size, 8192); 251 } 252 253 258 public void setResourcelistCacheSize(String size) { 259 260 m_resourcelistCacheSize = getIntValue(size, 256); 261 } 262 263 268 public void setUserCacheSize(String size) { 269 270 m_userCacheSize = getIntValue(size, 64); 271 } 272 273 278 public void setUserGroupsCacheSize(String size) { 279 280 m_userGroupsCacheSize = getIntValue(size, 256); 281 } 282 283 290 private int getIntValue(String str, int defaultValue) { 291 292 try { 293 int intValue = Integer.parseInt(str); 294 return (intValue > 0) ? intValue : defaultValue; 295 } catch (NumberFormatException e) { 296 } 298 299 return defaultValue; 300 } 301 302 } 303 | Popular Tags |