|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.caplin.keymaster.servlet.StreamLinkFormatter
public class StreamLinkFormatter
This class formats the response passed into it so that the response will be compatible with StreamLink
(for Java/C++/Excel etc).
This class uses com.caplin.credentials.util.RemoteCredentialsEncoder
to return the response in the
appropriate format so that a StreamLink based application will be able to understand it.
Constructor Summary | |
---|---|
StreamLinkFormatter()
|
Method Summary | |
---|---|
String |
formatErrorResponse(javax.servlet.http.HttpServletRequest request,
String errorMessage)
This method calls com.caplin.credentials.util.RemoteCredentialsEncoder#encodeErrorResponse to format an
appropriate error response. |
String |
formatResponse(javax.servlet.http.HttpServletRequest request,
String token)
This method formats the response for the successful creation of a token. |
String |
formatResponse(javax.servlet.http.HttpServletRequest request,
String token,
UserCredentialsProvider provider)
This method formats the response for the successful creation of a token. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StreamLinkFormatter()
Method Detail |
---|
public String formatErrorResponse(javax.servlet.http.HttpServletRequest request, String errorMessage)
This method calls com.caplin.credentials.util.RemoteCredentialsEncoder#encodeErrorResponse
to format an
appropriate error response.
formatErrorResponse
in interface ResponseFormatter
errorMessage
- stating what the problem was.request
- This parameter should be used to retrieve any required information that may
be needed to format an error response. This parameter is always passed in
from the calling servlet.
public String formatResponse(javax.servlet.http.HttpServletRequest request, String token)
This method formats the response for the successful creation of a token. The method retrieves all the
required information from the
HttpServletRequest
object which should contain all the required parameters.
The token has been generated
by the calling class and represents the password the user should use to access a Liberator source.
The method calls com.caplin.credentials.util.RemoteCredentialsEncoder#encodeOkResponse
is called
in the RemoteCredentialsEncoder class.
This signals that the key was created successfully.
However this method may still return an error if some of the request parameters are missing.
formatResponse
in interface ResponseFormatter
request
- The request object that has been sent to the servlet calling class. This should contain all
the required parameters.token
- The token used to access a Liberator source.
public String formatResponse(javax.servlet.http.HttpServletRequest request, String token, UserCredentialsProvider provider)
This method formats the response for the successful creation of a token. The method retrieves all the
required information from the HttpServletRequest
object which
should contain all the required parameters. However, should the parameter "username" be missing
from the parameters and should the httpUserOverride parameter be equivalent to true then
this will not cause a problem provided that a call to HttpServletRequest.getRemoteUser()
doesn't return null. If this is the case then it will be the same as if the username
parameter were missing.
This method calls com.caplin.credentials.util.RemoteCredentialsEncoder#encodeOkResponse
in the RemoteCredentialsEncoder class.
This signals that the key was created successfully.
However this method may still return an error if some of the request parameters are missing.
formatResponse
in interface AdvancedResponseFormatter
request
- The request object that has been sent to the servlet calling class. This should contain all
the required parameters.token
- The token used to access a Liberator source.httpUserOverride
- allow the standard HTTP remote user to override any parameter username value.
Should the call to HttpServletRequest.getRemoteUser()
return null, then an error
response will be sent regardless of whether username has been specified as part of the URL
request parameters.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |