Class Result
java.lang.Object
org.jpos.rc.Result
- All Implemented Interfaces:
Loggeable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents a single entry in a transaction result. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddump(PrintStream ps, String indent) Dumps a human-readable representation of this object to the print stream.entries()Returns the full list of all entries in this result.Adds a failure entry to this result.intFAIL()Helper method used to avoid adding an extra 'return' line in failing transaction participantsfailure()Returns the first failure entry, ornullif none exists.Returns a list of all failure entries.booleanhasFailure(IRC irc) Returnstrueif there is a failure entry with the given IRC code.booleanReturnstrueif this result contains at least one failure entry.booleanhasInfo()Returnstrueif this result contains at least one informational entry.booleanReturnstrueif there is an informational entry with the given IRC code.booleanReturnstrueif any entry has an IRC that is marked as inhibit.booleanReturnstrueif any entry carries the given IRC code.booleanhasWarning(IRC irc) Returnstrueif there is a warning entry with the given IRC code.booleanReturnstrueif this result contains at least one warning entry.Adds an informational entry to this result.infoList()Returns a list of all informational entries.booleanReturnstrueif this result has a success entry and no failure entries.success()Returns the first success entry if the result is successful, ornullotherwise.Adds a success entry to this result.Returns a list of all success entries.toString()Adds a warning entry to this result.Returns a list of all warning entries.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Loggeable
dumpModifier and TypeMethodDescriptiondefault voiddump(PrintStream p, String indent, LogRenderer.Type type) Dumps a representation of this object using the specified renderer type.
-
Constructor Details
-
Result
public Result()Default constructor.
-
-
Method Details
-
info
-
warn
-
success
Adds a success entry to this result.- Parameters:
irc- the success IRC code (must satisfyIRC.success())source- the source identifier of the entryformat- printf-style format stringargs- format arguments- Returns:
- this Result instance
- Throws:
IllegalArgumentException- if the IRC is not a success code
-
fail
-
FAIL
Helper method used to avoid adding an extra 'return' line in failing transaction participants- Returns:
- TransactionConstants.FAIL which is basically ABORT | READONLY | NO_JOIN;
-
hasInfo
Returnstrueif this result contains at least one informational entry.- Returns:
trueif an INFO entry is present
-
hasWarnings
Returnstrueif this result contains at least one warning entry.- Returns:
trueif a WARN entry is present
-
hasFailures
Returnstrueif this result contains at least one failure entry.- Returns:
trueif a FAIL entry is present
-
hasInhibit
Returnstrueif any entry has an IRC that is marked as inhibit.- Returns:
trueif an inhibit IRC is present
-
hasIRC
-
hasFailure
Returnstrueif there is a failure entry with the given IRC code.- Parameters:
irc- the failure IRC to look for- Returns:
trueif a failure entry with the given IRC is present
-
hasWarning
Returnstrueif there is a warning entry with the given IRC code.- Parameters:
irc- the warning IRC to look for- Returns:
trueif a warning entry with the given IRC is present
-
hasInfo
-
isSuccess
Returnstrueif this result has a success entry and no failure entries.- Returns:
trueif the overall result is a success
-
failure
Returns the first failure entry, ornullif none exists.- Returns:
- the first
Result.Entryof type FAIL, ornull
-
success
Returns the first success entry if the result is successful, ornullotherwise.- Returns:
- the first
Result.Entryof type SUCCESS if successful, ornull
-
entries
Returns the full list of all entries in this result.- Returns:
- list of all
Result.Entryobjects
-
infoList
Returns a list of all informational entries.- Returns:
- list of INFO
Result.Entryobjects
-
successList
Returns a list of all success entries.- Returns:
- list of SUCCESS
Result.Entryobjects
-
warningList
Returns a list of all warning entries.- Returns:
- list of WARN
Result.Entryobjects
-
failureList
Returns a list of all failure entries.- Returns:
- list of FAIL
Result.Entryobjects
-
dump
-
toString
-