1 23 24 package org.apache.slide.common; 25 26 import java.util.Enumeration ; 27 import java.util.List ; 28 import org.apache.slide.authenticate.CredentialsToken; 29 import org.apache.slide.store.ResourceId; 30 import org.apache.slide.structure.ActionNode; 31 import org.apache.slide.structure.ObjectNode; 32 import org.apache.slide.structure.SubjectNode; 33 34 41 public final class SlideTokenWrapper implements SlideToken{ 42 43 44 46 47 51 public SlideTokenWrapper(SlideToken token) { 52 this.wrappedToken = token; 53 this.forceStoreEnlistment = token.isForceStoreEnlistment(); 54 this.forceSecurity = token.isForceSecurity(); 55 this.forceLock = token.isForceLock(); 56 this.isExternalTransaction = token.isExternalTransaction(); 57 } 58 59 60 61 63 64 67 private SlideToken wrappedToken; 68 69 private boolean forceStoreEnlistment = false; 70 private boolean forceSecurity = true; 71 private boolean forceLock = true; 72 private boolean isExternalTransaction = false; 73 74 76 77 82 public CredentialsToken getCredentialsToken() { 83 return wrappedToken.getCredentialsToken(); 84 } 85 86 87 90 public void setCredentialsToken(CredentialsToken credentialsToken) { 91 wrappedToken.setCredentialsToken(credentialsToken); 92 } 93 94 95 100 public CacheInfoToken getCacheInfoToken() { 101 return wrappedToken.getCacheInfoToken(); 102 } 103 104 105 108 public void setCacheInfoToken(CacheInfoToken cacheInfoToken) { 109 wrappedToken.setCacheInfoToken(cacheInfoToken); 110 } 111 112 113 118 public boolean isEnforceLockTokens() { 119 return wrappedToken.isEnforceLockTokens(); 120 } 121 122 123 128 public void setEnforceLockTokens(boolean enforceLockTokens) { 129 wrappedToken.setEnforceLockTokens(enforceLockTokens); 130 } 131 132 133 140 public boolean isForceStoreEnlistment() { 141 return forceStoreEnlistment; 142 } 143 144 145 155 public void setForceStoreEnlistment(boolean forceStoreEnlistment) { 156 this.forceStoreEnlistment = forceStoreEnlistment; 157 } 158 159 160 165 public void addLockToken(String lockId) { 166 wrappedToken.addLockToken(lockId); 167 } 168 169 170 175 public void removeLockToken(String lockId) { 176 wrappedToken.removeLockToken(lockId); 177 } 178 179 180 183 public void clearLockTokens() { 184 wrappedToken.clearLockTokens(); 185 } 186 187 188 194 public boolean checkLockToken(String lockToken) { 195 return wrappedToken.checkLockToken(lockToken); 196 } 197 198 199 public List showLockTokens() { 200 return wrappedToken.showLockTokens(); 201 } 202 203 209 public void addParameter(String parameterName, Object parameterValue) { 210 wrappedToken.addParameter(parameterName, parameterValue); 211 } 212 213 214 219 public void removeParameter(String parameterName) { 220 wrappedToken.removeParameter(parameterName); 221 } 222 223 224 227 public void clearParameters() { 228 wrappedToken.clearParameters(); 229 } 230 231 234 public Object getParameter(String name) { 235 return wrappedToken.getParameter(name); 236 } 237 238 241 public Enumeration getParameterNames() { 242 return wrappedToken.getParameterNames(); 243 } 244 245 250 public void cachePermission(ObjectNode object, ActionNode action, boolean permission){ 251 wrappedToken.cachePermission(object, action, permission); 252 } 253 254 260 public Boolean checkPermissionCache(ObjectNode object, ActionNode action){ 261 return wrappedToken.checkPermissionCache(object, action); 262 } 263 264 270 public boolean isForceSecurity() { 271 return forceSecurity; 272 } 273 274 public void setForceSecurity(boolean forceSecurity) { 275 this.forceSecurity = forceSecurity; 276 } 277 278 284 public boolean isForceLock() { 285 return forceLock; 286 } 287 288 public void setForceLock(boolean forceLock) { 289 this.forceLock = forceLock; 290 } 291 292 295 public void cacheLock(ObjectNode object, ActionNode action, boolean lock) { 296 wrappedToken.cacheLock(object, action, lock); 297 } 298 299 305 public Boolean checkLockCache(ObjectNode object, ActionNode action) { 306 return wrappedToken.checkLockCache(object, action); 308 } 309 310 313 public void cacheResolve(Uri uri, ResourceId resourceId) { 314 wrappedToken.cacheResolve(uri, resourceId); 315 } 316 317 321 public ResourceId checkResolveCache(Uri uri) { 322 return wrappedToken.checkResolveCache(uri); 323 } 324 325 328 public void cacheMatchPrincipal(SubjectNode checkSubject, SubjectNode matchSubject, boolean match) { 329 wrappedToken.cacheMatchPrincipal(checkSubject, matchSubject, match); 330 } 331 332 336 public Boolean checkMatchPrincipalCache(SubjectNode checkSubject, SubjectNode matchSubject) { 337 return wrappedToken.checkMatchPrincipalCache(checkSubject, matchSubject); 338 } 339 340 343 public boolean isExternalTransaction() { 344 return isExternalTransaction; 345 } 346 347 350 public void setExternalTx() { 351 isExternalTransaction = true; 352 } 353 } 354 | Popular Tags |