|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.perforce.p4java.impl.mapbased.rpc.func.client.ClientUserInteraction
public class ClientUserInteraction
Class for Perforce client end-user interaction commands like prompting or password-setting ("end-user interaction" is being rather broadly-defined here...).
Note that in general we don't actually do any end-user interaction in P4Java -- it's all done before a call by the app that P4Java's been embedded in.
Field Summary | |
---|---|
protected static int |
RESP_LENGTH
|
static String |
TRACE_PREFIX
|
protected static int |
TRUNCATE_LENGTH
|
Constructor Summary | |
---|---|
protected |
ClientUserInteraction(Properties props,
RpcServer server)
|
Method Summary | |
---|---|
protected RpcPacketDispatcher.RpcPacketDispatcherResult |
clientAck(RpcConnection rpcConnection,
CommandEnv cmdEnv,
Map<String,Object> resultsMap)
Respond back to the server with what amounts to a yes / no response in the face of errors or success. |
protected RpcPacketDispatcher.RpcPacketDispatcherResult |
clientCrypto(RpcConnection rpcConnection,
CommandEnv cmdEnv,
Map<String,Object> resultsMap)
Process the client-Crypto command from the Perforce server. |
protected RpcPacketDispatcher.RpcPacketDispatcherResult |
clientInputData(RpcConnection rpcConnection,
CommandEnv cmdEnv,
Map<String,Object> resultsMap)
Get some requested data (typically something like a submit form) from somewhere (typically a map passed in from the upper levels of the API) and pass it back to the server, properly munged. |
protected RpcPacketDispatcher.RpcPacketDispatcherResult |
clientPrompt(RpcConnection rpcConnection,
CommandEnv cmdEnv,
Map<String,Object> resultsMap)
Prompt the end-user (i.e. |
protected RpcPacketDispatcher.RpcPacketDispatcherResult |
clientSetPassword(RpcConnection rpcConnection,
CommandEnv cmdEnv,
Map<String,Object> resultsMap)
Set the client-side password in response to a Perforce server command telling us to do just that, usually as a result of an earlier successful login attempt in the same session. |
protected RpcPacketDispatcher.RpcPacketDispatcherResult |
clientSingleSignon(RpcConnection rpcConnection,
CommandEnv cmdEnv,
Map<String,Object> resultsMap)
Implements the client-side of the Perforce single sign on (SSO) protocol. |
protected byte[] |
getStreamBytes(String cmdName,
InputStream inStream)
Get bytes from the stream passed in. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String TRACE_PREFIX
protected static final int RESP_LENGTH
protected static final int TRUNCATE_LENGTH
Constructor Detail |
---|
protected ClientUserInteraction(Properties props, RpcServer server)
Method Detail |
---|
protected RpcPacketDispatcher.RpcPacketDispatcherResult clientPrompt(RpcConnection rpcConnection, CommandEnv cmdEnv, Map<String,Object> resultsMap) throws ConnectionException
In the most common usage -- password extraction from the user -- we follow a fairly simple scheme where we first hash the password with an MD5 digest, then pass the results of that operation through a new MD5 cycle and hash it against the "digest" string passed in from the server. Everything else that's sent to us from the server is simply echoed for the server's own purposes (i.e. I still don't know what some of this stuff does...).
Note that we have to do what the C++ API does in the same circumstances; this means converting the hash hex string results into upper-case, etc., and several other mild quirks whose use or motivation aren't always obvious.
Note also that we're not currently implementing the full panoply of possible processing here, just the subset that's useful to us for P4WSAD and that presumes a 2003.2 or later server in not-too-strict mode.
ConnectionException
protected RpcPacketDispatcher.RpcPacketDispatcherResult clientSetPassword(RpcConnection rpcConnection, CommandEnv cmdEnv, Map<String,Object> resultsMap) throws ConnectionException
In this context setting the password really just means performing a few sanity and consistency checks, then returning a suitable ticket for use with the -P option in future commands. This can be an arbitrarily complex process...
ConnectionException
protected RpcPacketDispatcher.RpcPacketDispatcherResult clientSingleSignon(RpcConnection rpcConnection, CommandEnv cmdEnv, Map<String,Object> resultsMap) throws ConnectionException
ConnectionException
protected RpcPacketDispatcher.RpcPacketDispatcherResult clientAck(RpcConnection rpcConnection, CommandEnv cmdEnv, Map<String,Object> resultsMap) throws ConnectionException
ConnectionException
protected RpcPacketDispatcher.RpcPacketDispatcherResult clientCrypto(RpcConnection rpcConnection, CommandEnv cmdEnv, Map<String,Object> resultsMap) throws ConnectionException
In the P4Java context, this really means first MD5-hashing the incoming token, then hashing the previously-returned ticket, then returning the results to the server for inspection.
ConnectionException
protected RpcPacketDispatcher.RpcPacketDispatcherResult clientInputData(RpcConnection rpcConnection, CommandEnv cmdEnv, Map<String,Object> resultsMap) throws ConnectionException
ConnectionException
protected byte[] getStreamBytes(String cmdName, InputStream inStream)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |