org.openorb.orb.csiv2
Class CSIEstablishContext

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

public final class CSIEstablishContext
extends java.lang.Object

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

Author:
Michael Rumpf

Method Summary
static CSIEstablishContext create(org.omg.IOP.Codec codec, EstablishContext ctx)
          This method just wraps this class around the specified instance of type EstablishContext.
static CSIEstablishContext create(org.omg.CORBA.ORB orb, org.omg.IOP.Codec codec, java.lang.String username, char[] password, java.lang.String target, java.lang.String identity)
          This method creates an EstablishContext message with an client_authentication_token only and identity assertion disabled.
 long getClientContextId()
          Returns the EstablishContext.client_context_id of the associated EstablishContext message.
 byte[] getEncodedSASContextBody(org.omg.CORBA.ORB orb)
          Return the EstablishContext instance embedded into an instance of type SASContextBody and GIOP encoded as byte array.
 java.lang.String getIdentityPrincipalName()
          Return the principal name when the EstablishContext.identity_token is of type ITTPrincipalName.
 int getIdentityTokenType()
          Return the type of the supplied identity token.
 InitialContextToken getInitialContextToken()
          Return the initial context token that has been stored in EstablishContext.client_authentication_token.
 EstablishContext getInternal()
          Return the internal member which this class wraps.
 char[] getPassword()
          Return the user's password from the initial context token that has been stored in EstablishContext.client_authentication_token.
 java.lang.String getPasswordString()
          Return the user's password string from the initial context token that has been stored in EstablishContext.client_authentication_token.
 java.lang.String getTargetName()
          Return the target name from the initial context token that has been stored in EstablishContext.client_authentication_token.
 java.lang.String getUsername()
          Return the user's name from the initial context token that has been stored in EstablishContext.client_authentication_token.
 boolean hasAuthenticationToken()
          Return true when the EstablishContext.client_authentication_token is supplied in the EstablishContext message and false if not.
 boolean hasAuthorizationToken()
          Return true when the EstablishContext.authorization_token is supplied in the EstablishContext message and false if not.
 boolean hasIdentityToken()
          Return true when the EstablishContext.identity_token is supplied in the EstablishContext message and false if not.
 java.lang.String toString()
          This method creates a stringified representation of the EstablishContext class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

create

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

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

create

public static CSIEstablishContext create(org.omg.CORBA.ORB orb,
                                         org.omg.IOP.Codec codec,
                                         java.lang.String username,
                                         char[] password,
                                         java.lang.String target,
                                         java.lang.String identity)
This method creates an EstablishContext message with an client_authentication_token only and identity assertion disabled.

Parameters:
orb - The orb to get Any instances from.
codec - The codec used for GIOP encoding and decoding.
username - The user's name.
password - The user's password.
target - The name of the target the client is authenticating to.
identity - The identity name.
Returns:
An instance of this convenience wrapper with an inner member of type EstablishContext.

getInternal

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

Returns:
The internal member of type EstablishContext.

getEncodedSASContextBody

public byte[] getEncodedSASContextBody(org.omg.CORBA.ORB orb)
Return the EstablishContext 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 EstablishContext.client_context_id of the associated EstablishContext message. This must be null for stateless contexts (Level 0).

Returns:
The client context id or -1 when the internal member has not been initialized yet.

hasAuthenticationToken

public boolean hasAuthenticationToken()
Return true when the EstablishContext.client_authentication_token is supplied in the EstablishContext message and false if not.

Returns:
True when the EstablishContext member has a client authentication token attached or false when the internal member has not been initialized yet.

hasAuthorizationToken

public boolean hasAuthorizationToken()
Return true when the EstablishContext.authorization_token is supplied in the EstablishContext message and false if not.

Returns:
True when the EstablishContext member has an authorization token attached or false when the internal member has not been initialized yet.

hasIdentityToken

public boolean hasIdentityToken()
Return true when the EstablishContext.identity_token is supplied in the EstablishContext message and false if not.

Returns:
True when the EstablishContext member has an identity token attached, false if not or the internal member has not been initialized yet.

getInitialContextToken

public InitialContextToken getInitialContextToken()
Return the initial context token that has been stored in EstablishContext.client_authentication_token.

Returns:
An instance of type InitialContextToken.

getUsername

public java.lang.String getUsername()
Return the user's name from the initial context token that has been stored in EstablishContext.client_authentication_token.

Returns:
The user name from InitialContextToken.

getPassword

public char[] getPassword()
Return the user's password from the initial context token that has been stored in EstablishContext.client_authentication_token.

Returns:
The password from InitialContextToken.

getPasswordString

public java.lang.String getPasswordString()
Return the user's password string from the initial context token that has been stored in EstablishContext.client_authentication_token.

Returns:
The password string from InitialContextToken.

getTargetName

public java.lang.String getTargetName()
Return the target name from the initial context token that has been stored in EstablishContext.client_authentication_token.

Returns:
The target name from InitialContextToken.

getIdentityTokenType

public int getIdentityTokenType()
Return the type of the supplied identity token.

Returns:
The identity token type discriminator value for EstablishContext.identity_token or -1 when the internal member has not been set.

getIdentityPrincipalName

public java.lang.String getIdentityPrincipalName()
Return the principal name when the EstablishContext.identity_token is of type ITTPrincipalName.

Returns:
The principal name or null when the identity token type is either not ITTPrincipalName or the internal member has not been set.

toString

public java.lang.String toString()
This method creates a stringified representation of the EstablishContext class.

Overrides:
toString in class java.lang.Object
Returns:
A stringified respresentation of EstablishContext.