org.openorb.orb.csiv2
Class CSIContextError

java.lang.Object
  extended by org.openorb.orb.csiv2.CSIContextError

public final class CSIContextError
extends java.lang.Object

This is a convenience wrapper class around the ContextError class. It provides helper methods to retrieve all data from the ContextError class in an easy way.

Author:
Michael Rumpf

Method Summary
static CSIContextError create(org.omg.IOP.Codec codec, ContextError ctx)
          This method just wraps this class around the specified instance of type ContextError.
static CSIContextError create(org.omg.CORBA.ORB orb, org.omg.IOP.Codec codec, int major, int minor, int errorcode)
          This method creates a ContextError message.
 long getClientContextId()
          Returns the value of the member ContextError.client_context_id.
 byte[] getEncodedSASContextBody(org.omg.CORBA.ORB orb)
          Return the ContextError instance embedded into an instance of type SASContextBody and GIOP encoded as byte array.
 int getErrorCode()
          Returns the actual error code from ContextError.error_token.
 java.lang.String getErrorCodeString()
          Returns the error code from ContextError.error_token as string.
 ErrorToken getErrorToken()
          Returns the decoded value of the member ContextError.error_token as type of ErrorToken.
 ContextError getInternal()
          Return the internal member which this class wraps.
 int getMajor()
          Returns the value of the member ContextError.major_status.
 int getMinor()
          Returns the value of the member ContextError.minor_status.
 java.lang.String toString()
          Creates a stringified representation of the class ContextError.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

create

public static CSIContextError create(org.omg.IOP.Codec codec,
                                     ContextError ctx)
This method just wraps this class around the specified instance of type ContextError.

Parameters:
codec - The codec to be used for GIOP encoding and decoding.
ctx - The instance of type ContextError this class is a wrapper for.
Returns:
An instance of this convenience wrapper with a member of type ContextError.

create

public static CSIContextError create(org.omg.CORBA.ORB orb,
                                     org.omg.IOP.Codec codec,
                                     int major,
                                     int minor,
                                     int errorcode)
This method creates a ContextError message.

Parameters:
orb - The orb to get Any instances from.
codec - The codec used for GIOP encoding and decoding.
major - The major number of the error.
minor - The minor number of the error.
errorcode - The error code to be put into ErrorToken.error_code
Returns:
An instance of this convenience wrapper with a member of type ContextError.

getInternal

public ContextError getInternal()
Return the internal member which this class wraps.

Returns:
The internal member of type ContextError.

getEncodedSASContextBody

public byte[] getEncodedSASContextBody(org.omg.CORBA.ORB orb)
Return the ContextError instance embedded into an instance of type SASContextBody and GIOP encoded as byte array.

Returns:
A byte array containing an encoded instance of type SASContextBody or null in case the wrapped member has not been set.

getClientContextId

public long getClientContextId()
Returns the value of the member ContextError.client_context_id. This must be null for stateless contexts (for Level0 compliance).

Returns:
The value from ContextError.client_context_id or -1 in case the wrapped member has not been set.

getMajor

public int getMajor()
Returns the value of the member ContextError.major_status.

Returns:
The value from ContextError.major_status or -1 in case the wrapped member has not been set.

getMinor

public int getMinor()
Returns the value of the member ContextError.minor_status.

Returns:
The value from ContextError.minor_status or -1 in case the wrapped member has not been set.

getErrorToken

public ErrorToken getErrorToken()
Returns the decoded value of the member ContextError.error_token as type of ErrorToken.

Returns:
The decoded value from ContextError.error_token as type of ErrorToken or null in case the wrapped member has not been set.

getErrorCode

public int getErrorCode()
Returns the actual error code from ContextError.error_token.

Returns:
The error code from ContextError.error_token or -1 in case the wrapped member has not been set.

getErrorCodeString

public java.lang.String getErrorCodeString()
Returns the error code from ContextError.error_token as string.

Returns:
The error code from ContextError.error_token as string or null in case the wrapped member has not been set.

toString

public java.lang.String toString()
Creates a stringified representation of the class ContextError.

Overrides:
toString in class java.lang.Object
Returns:
A stringified representation of this instance or null in case the wrapped member has not been set.