Class SecurePingClientEJB
- java.lang.Object
-
- info.ejava.examples.secureping.ejb.SecurePingClientEJB
-
- All Implemented Interfaces:
SecurePingClient,SecurePingClientLocal,SecurePingClientRemote
@PermitAll @RunAs("admin") public class SecurePingClientEJB extends Object implements SecurePingClientRemote, SecurePingClientLocal
This session bean allows all methods to be invoked and then performs the matching operation on SecurePingEJB using a run-as with an admin role.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) SessionContextctxprivate static org.slf4j.Loggerlogger(package private) SecurePingRemotesecurePingServer
-
Constructor Summary
Constructors Constructor Description SecurePingClientEJB()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private StringgetInfo(String prefix)Return what this EJB's container thinks about the caller.voidinit()booleanisCallerInRole(String role)Return info from this bean and the securePingServer after performing a run-as.StringpingAdmin()Return info from this bean and the securePingServer after performing a run-as.StringpingAll()Return info from this bean and the securePingServer after performing a run-as.StringpingExcluded()Return info from this bean and the securePingServer after performing a run-as.StringpingUser()Return info from this bean and the securePingServer after performing a run-as.StringwhoAmI()Return the identify of this caller within the context of this EJB invocation.
-
-
-
Field Detail
-
logger
private static final org.slf4j.Logger logger
-
ctx
SessionContext ctx
-
securePingServer
SecurePingRemote securePingServer
-
-
Method Detail
-
init
@PostConstruct public void init()
-
getInfo
private String getInfo(String prefix)
Return what this EJB's container thinks about the caller.
-
pingAll
public String pingAll()
Return info from this bean and the securePingServer after performing a run-as.- Specified by:
pingAllin interfaceSecurePingClient
-
pingUser
public String pingUser()
Return info from this bean and the securePingServer after performing a run-as.- Specified by:
pingUserin interfaceSecurePingClient
-
pingAdmin
public String pingAdmin()
Return info from this bean and the securePingServer after performing a run-as.- Specified by:
pingAdminin interfaceSecurePingClient
-
pingExcluded
public String pingExcluded()
Return info from this bean and the securePingServer after performing a run-as.- Specified by:
pingExcludedin interfaceSecurePingClient
-
whoAmI
public String whoAmI()
Return the identify of this caller within the context of this EJB invocation.- Specified by:
whoAmIin interfaceSecurePingClient
-
isCallerInRole
public boolean isCallerInRole(String role)
Return info from this bean and the securePingServer after performing a run-as. Most of the details are written to the log since the return type here is a simple boolean.- Specified by:
isCallerInRolein interfaceSecurePingClient
-
-