public class SecurePingEJB extends Object implements SecurePingRemote, SecurePingLocal
Modifier and Type | Field and Description |
---|---|
(package private) SessionContext |
ctx |
private static org.slf4j.Logger |
logger |
Constructor and Description |
---|
SecurePingEJB() |
Modifier and Type | Method and Description |
---|---|
private String |
getInfo(String prefix)
This method creates a status string based on security information
obtained from the SessionContext.
|
String |
getPrincipal() |
void |
init() |
boolean |
isCallerInRole(String role)
This method allows the RMI Test to check whether the current subject
has a specific role.
|
String |
pingAdmin()
Callers of this method must have the "admin" role.
|
String |
pingAll()
This method is permitted to be called by anyone.
|
String |
pingExcluded()
No one should be allowed to call this method.
|
String |
pingUser()
Callers of this method must have the "user" role.
|
private static final org.slf4j.Logger logger
SessionContext ctx
@PostConstruct public void init()
private String getInfo(String prefix)
@PermitAll public String pingAll()
pingAll
in interface SecurePing
@RolesAllowed(value="user") public String pingUser()
pingUser
in interface SecurePing
@RolesAllowed(value="admin") public String pingAdmin()
pingAdmin
in interface SecurePing
@DenyAll public String pingExcluded()
pingExcluded
in interface SecurePing
@PermitAll public boolean isCallerInRole(String role)
isCallerInRole
in interface SecurePing
@PermitAll public String getPrincipal()
getPrincipal
in interface SecurePing
Copyright © 2015 John's Hopkins University, Engineering Programs for Professionals. All rights reserved.