summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/Security/SL3_SecurityCurrent.cpp
blob: 2ad9a8ca9fca956327d70c0bff88cc37ae7fcf46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// $Id$

#include "SL3_SecurityCurrent.h"


ACE_RCSID (Security,
           SL3_SecurityCurrent,
           "$Id$")


#if !defined (__ACE_INLINE__)
# include "SL3_SecurityCurrent.inl"
#endif /* __ACE_INLINE__ */


TAO::SL3::SecurityCurrent::SecurityCurrent (size_t tss_slot,
                                            TAO_ORB_Core * oc)
  : tss_slot_ (tss_slot),
    orb_core_ (oc)
{
}


TAO::SL3::SecurityCurrent::~SecurityCurrent (void)
{
}

SecurityLevel3::ClientCredentials_ptr
TAO::SL3::SecurityCurrent::client_credentials (ACE_ENV_SINGLE_ARG_DECL)
  ACE_THROW_SPEC ((CORBA::SystemException))
{
  TAO::SL3::SecurityCurrent_Impl * impl = this->implementation ();

  // If the implementation pointer returned from TSS is zero, then
  // we're not in the middle of a request/upcall.  Throw an exception
  // to indicate that.
  if (impl == 0)
    ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (),
                      SecurityLevel3::ClientCredentials::_nil ());

  return impl->client_credentials (ACE_ENV_SINGLE_ARG_PARAMETER);
}

CORBA::Boolean
TAO::SL3::SecurityCurrent::request_is_local (ACE_ENV_SINGLE_ARG_DECL)
  ACE_THROW_SPEC ((CORBA::SystemException))
{
  TAO::SL3::SecurityCurrent_Impl * impl = this->implementation ();

  // If the implementation pointer returned from TSS is zero, then
  // we're not in the middle of a request/upcall.  Throw an exception
  // to indicate that.
  if (impl == 0)
    ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (), false);

  return impl->request_is_local (ACE_ENV_SINGLE_ARG_PARAMETER);
}