public interface ISessionOperationItemResult
result is a reference to an ISessionOperationItemResult:
switch (result.getResultType()) {
case START:
if (result.isReturn()) {
StartRateResult startResult = result.getStartRateResult();
....
} else {
try {
result.throwStartRateError();
} catch (StartRateException e) {
...
} catch (InvalidItemException e) {
...
} ... catch other exceptions thrown by the previous method
}
break;
case UPDATE:
if (result.isReturn()) {
UpdateRateResult updateResult = result.getUpdateRateResult();
....
} else {
try {
result.throwUpdateRateError();
} catch (UpdateRateException e) {
...
} catch (InvalidItemException e) {
...
} ... catch other exceptions thrown by the previous method
}
break;
case STOP:
if (result.isReturn()) {
StopRateResult stopResult = result.geStopRateResult();
....
} else {
try {
result.throwStopRateError();
} catch (StopRateException e) {
...
} catch (InvalidItemException e) {
...
} ... catch other exceptions thrown by the previous method
}
break;
}
| Modifier and Type | Interface and Description |
|---|---|
static class |
ISessionOperationItemResult.SessionOperationItemResultStatus
The result status.
|
static class |
ISessionOperationItemResult.SessionOperationItemResultType
The type of the
ISessionOperationItemResult. |
| Modifier and Type | Method and Description |
|---|---|
ISessionOperationItemResult.SessionOperationItemResultType |
getResultType()
Returns the type of this
result. |
StartRateResult |
getStartRateResult()
Returns the embedded
start rate result, if available. |
StopRateResult |
getStopRateResult()
Returns the embedded
stop rate result, if available. |
UpdateRateResult |
getUpdateRateResult()
Returns the embedded
update rate result, if available. |
boolean |
isError()
Indicates if this
result is an erroneous return. |
boolean |
isReturn()
Indicates if this
result is a successful return. |
void |
throwStartRateError()
Throws exception that must be caught when the result is erroneous and is of type
ISessionOperationItemResult.SessionOperationItemResultType.START. |
void |
throwStopRateError()
Throws exception that must be caught when the result is erroneous and is of type
ISessionOperationItemResult.SessionOperationItemResultType.STOP. |
void |
throwUpdateRateError()
Throws exception that must be caught when the result is erroneous and is of type
ISessionOperationItemResult.SessionOperationItemResultType.UPDATE. |
boolean isReturn()
result is a successful return.isError()boolean isError()
result is an erroneous return.isReturn()ISessionOperationItemResult.SessionOperationItemResultType getResultType()
result.ISessionOperationItemResult.SessionOperationItemResultTypeStartRateResult getStartRateResult()
start rate result, if available.StopRateResult getStopRateResult()
stop rate result, if available.
In case ISessionConfirmAndReserve.prepareConfirmAndReserve(String, ChargeableItem, ChargeableItem) has been called and is
an erroneous return, a StopRateResult is available in addition to the exception
to determine either confirmation or reservation has failed.UpdateRateResult getUpdateRateResult()
update rate result, if available.void throwStartRateError()
throws StartRateException,
InvalidItemException,
ForbiddenChargeException,
ServerFailureException,
TransactionClearingException,
CommunicationFailureException
ISessionOperationItemResult.SessionOperationItemResultType.START.StartRateException - thrown if the cause of this erroneous result is a start rate exceptionInvalidItemException - thrown if the cause of this erroneous result is an invalid item exceptionForbiddenChargeException - thrown if the cause of this erroneous result is a forbidden charge exceptionServerFailureException - thrown if the cause of this erroneous result is a server failure exceptionTransactionClearingException - thrown if the cause of this erroneous result is a transaction clearing exceptionCommunicationFailureException - thrown if the cause of this erroneous result is a communication failure exceptionvoid throwStopRateError()
throws StopRateException,
InvalidItemException,
ForbiddenChargeException,
ServerFailureException,
TransactionClearingException,
CommunicationFailureException
ISessionOperationItemResult.SessionOperationItemResultType.STOP.StopRateException - thrown if the cause of this erroneous result is a stop rate exceptionInvalidItemException - thrown if the cause of this erroneous result is an invalid item exceptionForbiddenChargeException - thrown if the cause of this erroneous result is a forbidden charge exceptionServerFailureException - thrown if the cause of this erroneous result is a server failure exceptionTransactionClearingException - thrown if the cause of this erroneous result is a transaction clearing exceptionCommunicationFailureException - thrown if the cause of this erroneous result is a communication failure exceptionvoid throwUpdateRateError()
throws UpdateRateException,
InvalidItemException,
ForbiddenChargeException,
ServerFailureException,
TransactionClearingException,
CommunicationFailureException
ISessionOperationItemResult.SessionOperationItemResultType.UPDATE.UpdateRateException - thrown if the cause of this erroneous result is a update rate exceptionInvalidItemException - thrown if the cause of this erroneous result is an invalid item exceptionForbiddenChargeException - thrown if the cause of this erroneous result is a forbidden charge exceptionServerFailureException - thrown if the cause of this erroneous result is a server failure exceptionTransactionClearingException - thrown if the cause of this erroneous result is a transaction clearing exceptionCommunicationFailureException - thrown if the cause of this erroneous result is a communication failure exception