summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/Security/MechanismPolicy.cpp
blob: d5cb2b2d9891c6e3becdc3643232d0d25d375d61 (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
58
59
60
61
62
63
64
// -*- C++ -*-

#include "MechanismPolicy.h"

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

TAO_MechanismPolicy::TAO_MechanismPolicy (
  const Security::MechanismTypeList &mechanisms)
  : mechanisms_ (mechanisms)
{
}

TAO_MechanismPolicy::~TAO_MechanismPolicy (void)
{
}

CORBA::PolicyType
TAO_MechanismPolicy::policy_type (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
  ACE_THROW_SPEC ((CORBA::SystemException))
{
  return Security::SecMechanismsPolicy;
}

CORBA::Policy_ptr
TAO_MechanismPolicy::copy (ACE_ENV_SINGLE_ARG_DECL)
  ACE_THROW_SPEC ((CORBA::SystemException))
{
  TAO_MechanismPolicy *policy = 0;
  ACE_NEW_THROW_EX (policy,
                    TAO_MechanismPolicy (this->mechanisms_),
                    CORBA::NO_MEMORY (
                      CORBA::SystemException::_tao_minor_code (
                        TAO_DEFAULT_MINOR_CODE,
                        ENOMEM),
                      CORBA::COMPLETED_NO));
  ACE_CHECK_RETURN (CORBA::Policy::_nil ());

  return policy;
}

void
TAO_MechanismPolicy::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
  ACE_THROW_SPEC ((CORBA::SystemException))
{
}

Security::MechanismTypeList *
TAO_MechanismPolicy::mechanisms (ACE_ENV_SINGLE_ARG_DECL)
  ACE_THROW_SPEC ((CORBA::SystemException))
{
  Security::MechanismTypeList *mechs = 0;
  ACE_NEW_THROW_EX (mechs,
                    Security::MechanismTypeList (this->mechanisms_),
                    CORBA::NO_MEMORY (
                      CORBA::SystemException::_tao_minor_code (
                        TAO_DEFAULT_MINOR_CODE,
                        ENOMEM),
                      CORBA::COMPLETED_NO));
  ACE_CHECK_RETURN (0);

  return mechs;
}