BOA::get_principal

Overview Returns a Principal object identifying, in a server, the client of a remote request.
Original class CORBA module: BOA Class
Exceptions CORBA::SystemException


Intended Usage

This method is intended to be used by implementations of IDL interfaces, residing in a server process, to find the identity of the calling client. This might be used, for example, to implement security authorization checks.

This method is part of the CORBA specification.

Syntax

  virtual CORBA::Principal_ptr get_principal (
                    CORBA::Object_ptr obj,
                    CORBA::Environment_ptr env);

Input parameters

obj
The target of a remote invocation in a server. Typically, it is the "this" pointer in C++ for the method calling CORBA::BOA:get_principal. Currently this parameter is not used and NULL can be passed.
env
Currently unused (NULL can be passed).

Return values

CORBA::Principal_ptr
A Principal object identifying the client that initiated the remote request. If CORBA::BOA::get_principal is called outside the context of any remote request, NULL is returned. The caller does not assume ownership of the returned Principal object and should not delete it.

Example

  #include "corba.h"
  /* Assume previously initialized using CORBA::ORB::BOA_init () */
  extern CORBA::BOA_ptr srvboa;
  ...
  ::CORBA::Boolean tmpBoolean;
  ::CORBA::Principal_ptr prncpl_ptr;
  /* Assume the following is called from within an implementation
     of some IDL operation */
  prncpl_ptr = srvboa->get_principal(this,
                                     CORBA::Environment::_nil());
  tmpBoolean = ::CORBA::is_nil(prncpl_ptr);
  /* Error checking */
  ...

Related reference
CORBA module



Searchable topic ID:   rcor_modbo9
Last updated: Jun 21, 2007 8:07:48 PM CDT    WebSphere Business Integration Server Foundation, Version 5.0.2
http://publib.boulder.ibm.com/infocenter/wasinfo/index.jsp?topic=/com.ibm.wasee.doc/info/ee/corba/ref/rcor_modbo9.html

Library | Support | Terms of Use | Feedback