|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--org.objectweb.jac.core.Wrapper
|
+--org.objectweb.jac.aspects.authentication.AuthenticationWrapper
This wrapper uses an authenticator and a controller to ensure that the current interaction is authenticated and allowed.
AuthenticationAC,
Authenticator,
Serialized Form| Field Summary |
| Fields inherited from class org.objectweb.jac.core.Wrapper |
ac, cr |
| Constructor Summary | |
AuthenticationWrapper(AspectComponent ac,
Authenticator authenticator,
MethodItem controller)
Constructs a new authentication wrapper. |
|
| Method Summary | |
Object |
authenticateAndControl(Interaction interaction)
This wrapping method authenticates a call on the wrapped method and controls that the authentcated user owns the rights to call it. |
void |
catchAccessDenied(AccessDeniedException e)
This exception handler reacts when the access is denied. |
Object |
construct(ConstructorInvocation invocation)
|
static boolean |
dummyController(String username,
Object wrappee,
MethodItem method)
Always return true. |
Object |
invoke(MethodInvocation invocation)
|
boolean |
isTrustedUser(String username)
Returns true if the user is in the trusted users list. |
void |
setAccessDeniedMessage(String message)
Sets the message to show when the access is denied. |
void |
setAuthenticator(Authenticator authenticator)
|
void |
setController(MethodItem controller)
Sets the access rights controller. |
| Methods inherited from class org.objectweb.jac.core.Wrapper |
attr, attrdef, defines, getAspectComponent, getAspectComponentName, getExceptionHandlers, proceed, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public AuthenticationWrapper(AspectComponent ac,
Authenticator authenticator,
MethodItem controller)
ac - the aspect component that owns this wrapperauthenticator - the object that authenticatescontroller - the method that grants the rights or not| Method Detail |
public Object invoke(MethodInvocation invocation)
throws Throwable
invoke in interface MethodInterceptorinvoke in class WrapperThrowable
public Object construct(ConstructorInvocation invocation)
throws Throwable
construct in interface ConstructorInterceptorconstruct in class WrapperThrowablepublic void setController(MethodItem controller)
controller - a static method of the prototype boolean
controller(String username,Object wrappee,MethodItem method)UserAC.userController(String,Object,MethodItem),
dummyController(String,Object,MethodItem)public void setAuthenticator(Authenticator authenticator)
public Object authenticateAndControl(Interaction interaction)
throws AuthenticationFailedException,
AccessDeniedException,
Throwable
AuthenticationFailedException
AccessDeniedException
Throwablepublic boolean isTrustedUser(String username)
username - the name of the user to check
public void setAccessDeniedMessage(String message)
message - the messagepublic void catchAccessDenied(AccessDeniedException e)
e - the acces denied exception
public static boolean dummyController(String username,
Object wrappee,
MethodItem method)
username - the user's namewrappee - the authenticated methodmethod - the authenticated method
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||