public abstract class AuthenticatingXmlaRequestCallback extends Object implements XmlaRequestCallback
XmlaRequestCallback
specialized in authenticating the requests coming in. Subclasses are
only required to implement authenticate(String, String, String)
.
Once implemented, you only need to register your class using the XMLA servlet config, within your web.xml descriptor.
XmlaRequestCallback.Helper
AUTHORIZATION, EXPECT, EXPECT_100_CONTINUE
Constructor and Description |
---|
AuthenticatingXmlaRequestCallback() |
Modifier and Type | Method and Description |
---|---|
abstract String |
authenticate(String username,
String password,
String sessionID)
This function is expected to do two things.
|
String |
generateSessionId(Map<String,Object> context)
The Callback is requested to generate a sequence id string.
|
void |
init(javax.servlet.ServletConfig servletConfig) |
void |
postAction(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
byte[][] responseSoapParts,
Map<String,Object> context)
This is called after all Mondrian processing (DISCOVER/EXECUTE) has
occurred.
|
void |
preAction(javax.servlet.http.HttpServletRequest request,
Element[] requestSoapParts,
Map<String,Object> context)
This is called after the headers have been process but before the
body (DISCOVER/EXECUTE) has been processed.
|
boolean |
processHttpHeader(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Map<String,Object> context)
Process the request header items.
|
protected void |
throwAuthenticationException(String reason)
Helper method to create and throw an authentication exception.
|
public String generateSessionId(Map<String,Object> context)
XmlaRequestCallback
null
if they do not want
to generate a custom session ID, in which case, the default algorithm
to generate session IDs will be used.generateSessionId
in interface XmlaRequestCallback
context
- The context of this query.null
.public void init(javax.servlet.ServletConfig servletConfig) throws javax.servlet.ServletException
init
in interface XmlaRequestCallback
javax.servlet.ServletException
public void postAction(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, byte[][] responseSoapParts, Map<String,Object> context) throws Exception
XmlaRequestCallback
postAction
in interface XmlaRequestCallback
Exception
public void preAction(javax.servlet.http.HttpServletRequest request, Element[] requestSoapParts, Map<String,Object> context) throws Exception
XmlaRequestCallback
preAction
in interface XmlaRequestCallback
Exception
public abstract String authenticate(String username, String password, String sessionID)
Should there be any problems with the credentials, subclasses
can invoke throwAuthenticationException(String)
to throw
an authentication exception back to the client.
username
- Username used for authentication, as specified
in the SOAP security header. Might be null.password
- Password used for authentication, as specified
in the SOAP security header. Might be null.sessionID
- A unique identifier for this client session.
Session IDs should remain the same between different queries from
a same client, although some clients do not implement the XMLA
Session header properly, resulting in a new session ID for each
request.null
for root access.protected void throwAuthenticationException(String reason)
reason
- A textual explanation of why the credentials are
rejected.public boolean processHttpHeader(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Map<String,Object> context) throws Exception
XmlaRequestCallback
Note that it is upto the XMLA client to determine whether or not there is an Expect header entry (ADOMD.NET seems to like to do this).
processHttpHeader
in interface XmlaRequestCallback
Exception
Copyright © 2019 Hitachi Vantara. All rights reserved.