public interface ICommandCallback
The intention of the server series of methods is to notify the consumer that P4Java has issued a Perforce server command or received a result back from the server. The format of the results passed to the callback method are generally intended to mimic what would have been seen from a p4 command line command, but they may not always be identical.
NOTE: you must ensure that there are no threading or reentrancy issues with your implementation of this interface, and that calling any of the methods here will not cause the caller (P4Java) to block or spend too much time processing the callback.
Modifier and Type | Method and Description |
---|---|
void |
completedServerCommand(int key,
long millisecsTaken)
Report the completion of a Perforce server command, and, as a bonus,
report how long in milliseconds it took from start to finish.
|
void |
issuingServerCommand(int key,
java.lang.String commandString)
Report that P4Java is about to issue a Perforce server command.
|
void |
receivedServerErrorLine(int key,
java.lang.String errorLine)
Report receiving an error message result from the Perforce server.
|
void |
receivedServerInfoLine(int key,
java.lang.String infoLine)
Report receiving an info result message from the Perforce server.
|
void |
receivedServerMessage(int key,
int genericCode,
int severityCode,
java.lang.String message)
Report receiving a server message, which may be an error, an info message,
a warning, etc., but will not typically be an actual result.
|
void issuingServerCommand(int key, java.lang.String commandString)
The int return value is intended to be an opaque key for associated completedServerCommand, receivedServerInfoLine, and receivedServerErrorLine calls, allowing the consumer to correlate subsequent calls with the original command issuance. The key will also be the same value as used for any associated progress callbacks (see IProgressCallback) for the same command. In any case, this key will be unique across all calls (simultaneous or otherwise) to a given IServer, but is not guaranteed to be unique across an entire P4Java instance.
key
- -- opaque integer key for correlation with subsidiary calls.commandString
- non-null "normalised" p4 command string.void completedServerCommand(int key, long millisecsTaken)
key
- -- opaque integer key as returned from the associated
issuingServerCommand call.millisecsTaken
- -- rough measure of the milliseconds elapsed
since the original issuing of this command to its completion.void receivedServerInfoLine(int key, java.lang.String infoLine)
key
- -- opaque integer key as returned from the associated
issuingServerCommand call.infoLine
- non-null info message. May contain newlines.void receivedServerErrorLine(int key, java.lang.String errorLine)
key
- -- opaque integer key as returned from the associated
issuingServerCommand call.errorLine
- non-null error message. May contain newlines.void receivedServerMessage(int key, int genericCode, int severityCode, java.lang.String message)
key
- opaque integer key as returned from the associated
issuingServerCommand call.genericCode
- Perforce generic code, as documented in MessageGenericCode.severityCode
- Perforce severity code, as documented in MessageSeverityCode.message
- non-null message. May contain newlines.