org.qedeq.kernel.bo.job
Class ServiceResultImpl

java.lang.Object
  extended by org.qedeq.kernel.bo.job.ServiceResultImpl
All Implemented Interfaces:
ModuleServiceResult

public class ServiceResultImpl
extends java.lang.Object
implements ModuleServiceResult

Execution result of a ModuleServiceCall.

Author:
Michael Meyling

Field Summary
static ModuleServiceResult INTERRUPTED
          A simple service result that has a user interrupt.
static ModuleServiceResult SUCCESSFUL
          A simple successful (=ok) service result.
 
Constructor Summary
ServiceResultImpl(boolean interrupted, boolean ok, boolean hasWarnings, boolean hasErrors, java.lang.String message, java.lang.Object result)
          Constructor.
ServiceResultImpl(java.lang.String errorMessage)
          Constructor for a failure call.
 
Method Summary
 void deleteExecutionResult()
          Remove execution result.
 java.lang.String getErrorMessage()
          Error (and perhaps warning) messages for service call.
 java.lang.Object getExecutionResult()
          Result of service execution.
 boolean hasErrors()
          Did the service call finish with errors?
 boolean hasWarnings()
          Did the service call finish with warnings?
 boolean isOk()
          Did the call finish without errors and warnings? (And was not interrupted by a user.)
 boolean wasInterrupted()
          Was the call interrupted by user interaction?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INTERRUPTED

public static final ModuleServiceResult INTERRUPTED
A simple service result that has a user interrupt.


SUCCESSFUL

public static final ModuleServiceResult SUCCESSFUL
A simple successful (=ok) service result.

Constructor Detail

ServiceResultImpl

public ServiceResultImpl(boolean interrupted,
                         boolean ok,
                         boolean hasWarnings,
                         boolean hasErrors,
                         java.lang.String message,
                         java.lang.Object result)
Constructor.

Parameters:
interrupted - Did a user interrupt occur and ended the service call?
ok - Was the call fully successful (finished ok without errors and warnings)?
hasWarnings - Did warnings occur?
hasErrors - Did errors occur?
message - Error message. Might be empty.
result - Result of service call. Might be null even for a successful call.

ServiceResultImpl

public ServiceResultImpl(java.lang.String errorMessage)
Constructor for a failure call.

Parameters:
errorMessage - Error message. Should not be empty.
Method Detail

wasInterrupted

public boolean wasInterrupted()
Description copied from interface: ModuleServiceResult
Was the call interrupted by user interaction?

Specified by:
wasInterrupted in interface ModuleServiceResult
Returns:
Call was interrupted by a user.

isOk

public boolean isOk()
Description copied from interface: ModuleServiceResult
Did the call finish without errors and warnings? (And was not interrupted by a user.)

Specified by:
isOk in interface ModuleServiceResult
Returns:
Call finished successfully.

hasWarnings

public boolean hasWarnings()
Description copied from interface: ModuleServiceResult
Did the service call finish with warnings?

Specified by:
hasWarnings in interface ModuleServiceResult
Returns:
Occurred warnings?

hasErrors

public boolean hasErrors()
Description copied from interface: ModuleServiceResult
Did the service call finish with errors?

Specified by:
hasErrors in interface ModuleServiceResult
Returns:
Occurred errors?

getErrorMessage

public java.lang.String getErrorMessage()
Description copied from interface: ModuleServiceResult
Error (and perhaps warning) messages for service call. Never null. Should be of zero length if call ModuleServiceResult.isOk().

Specified by:
getErrorMessage in interface ModuleServiceResult
Returns:
Error messages.

getExecutionResult

public java.lang.Object getExecutionResult()
Description copied from interface: ModuleServiceResult
Result of service execution.

Specified by:
getExecutionResult in interface ModuleServiceResult
Returns:
Result. Might be null.

deleteExecutionResult

public void deleteExecutionResult()
Remove execution result. This might be necessary because it is really big.



Copyright © 2014. All Rights Reserved.