org.cafesip.sipunit
Interface SipActionObject

All Known Implementing Classes:
SipCall, SipPhone, SipSession, Subscription

public interface SipActionObject

A SipActionObject represents any SipUnit object that performs SIP operations on behalf of a user program. This interface provides a uniform way of determining the result of an operation - success or failure, and in the case of failure, the reason for failure. This interface is primarily used by SipTestCase.


Method Summary
 java.lang.String format()
          The format() method can be used to obtain a human-readable string containing the result of the last operation - either a successful indication or all of the error information associated with the last operation performed.
 java.lang.String getErrorMessage()
          The getErrorMessage() method returns a descriptive, human-readable string indicating the cause of the problem encountered during the last operation performed.
 java.lang.Throwable getException()
          This method is used to get the Exception object generated during the last operation performed.
 int getReturnCode()
          This method returns the status code of the current or last operation performed.
 

Method Detail

getReturnCode

int getReturnCode()
This method returns the status code of the current or last operation performed. It returns either the SIP response code received from the network (defined in SipResponse, along with the corresponding textual equivalent) or a SipUnit internal status/return code (defined in SipSession, along with the corresponding textual equivalent). SipUnit internal codes are in a specially designated range (SipSession.SIPUNIT_INTERNAL_RETURNCODE_MIN and upward).

Returns:
The status code of the last operation performed, or the status code so far of the current ongoing operation.

getErrorMessage

java.lang.String getErrorMessage()
The getErrorMessage() method returns a descriptive, human-readable string indicating the cause of the problem encountered during the last operation performed. If an exception was involved, this string will contain the name of the Exception class and the exception message.

Returns:
A descriptive string describing the cause of the problem encountered during the last operation performed, or an empty string if no problem was encountered.

getException

java.lang.Throwable getException()
This method is used to get the Exception object generated during the last operation performed. It applies whenever the getReturnCode() method returns internal SipUnit return code EXCEPTION_ENCOUNTERED.

Returns:
The Throwable object generated during the last operation performed, or null if an Exception didn't occur.

format

java.lang.String format()
The format() method can be used to obtain a human-readable string containing the result of the last operation - either a successful indication or all of the error information associated with the last operation performed.

Returns:
A string fully describing the error information associated with the last operation performed, or a successful indication if no error occurred.


http://www.cafesip.org