public abstract class BaseExtController
extends java.lang.Object
Example getting the API IServiceFactory using getServiceFactory(HttpServletRequest):
@RequestMapping(value = "hello", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
public String helloUser(Model model, HttpServletRequest request, HttpServletResponse response) throws Exception {
// sample way to get the API ServiceFactor
IServiceFactory factory = super.getServiceFactory(request);
ISecurityService ss = factory.createSecurityService();
IUser currentUser = ss.getCurrentUser();
return "Hello " + currentUser.getFirstName();
}
Example getting SDK OpenpagesSession from the GRC API Context using getContext(HttpServletRequest)
//sample way to get the SDK Session Context context = super.getContext(request); OpenpagesSession sdkSession = (OpenpagesSession) context.get(Context.SERVICE_SESSION);
| Constructor and Description |
|---|
BaseExtController() |
| Modifier and Type | Method and Description |
|---|---|
Context |
getContext(HttpServletRequest request)
Attempts to retrieve or initialize a new GRC API Context using the Http
Request object.
|
IServiceFactory |
getServiceFactory(HttpServletRequest request)
Attempts to retrieve or initialize a new GRC API IServiceFactory using
the Http Request object.
|
org.slf4j.Logger |
getSimpleLogger(java.lang.Class clazz)
Gets a SLF4J logger which can be used to log to aurora logging framework.
|
public Context getContext(HttpServletRequest request)
request - public IServiceFactory getServiceFactory(HttpServletRequest request)
request - public org.slf4j.Logger getSimpleLogger(java.lang.Class clazz)
clazz - - class for your RestController
Licensed Materials - Property of IBM
OpenPages with Watson (PID: 5725-D51)
© Copyright IBM Corporation 2013, 2020. All Rights Reserved.
US Government Users Restricted Rights -
Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.