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) SessionContext
ctx
private static org.slf4j.Logger
logger
(package private) SecurePingRemote
securePingServer
-
Constructor Summary
Constructors Constructor Description SecurePingClientEJB()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private String
getInfo(String prefix)
Return what this EJB's container thinks about the caller.void
init()
boolean
isCallerInRole(String role)
Return info from this bean and the securePingServer after performing a run-as.String
pingAdmin()
Return info from this bean and the securePingServer after performing a run-as.String
pingAll()
Return info from this bean and the securePingServer after performing a run-as.String
pingExcluded()
Return info from this bean and the securePingServer after performing a run-as.String
pingUser()
Return info from this bean and the securePingServer after performing a run-as.String
whoAmI()
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:
pingAll
in interfaceSecurePingClient
-
pingUser
public String pingUser()
Return info from this bean and the securePingServer after performing a run-as.- Specified by:
pingUser
in interfaceSecurePingClient
-
pingAdmin
public String pingAdmin()
Return info from this bean and the securePingServer after performing a run-as.- Specified by:
pingAdmin
in interfaceSecurePingClient
-
pingExcluded
public String pingExcluded()
Return info from this bean and the securePingServer after performing a run-as.- Specified by:
pingExcluded
in interfaceSecurePingClient
-
whoAmI
public String whoAmI()
Return the identify of this caller within the context of this EJB invocation.- Specified by:
whoAmI
in 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:
isCallerInRole
in interfaceSecurePingClient
-
-