summaryrefslogtreecommitdiff
path: root/Input_Adapters/SA_POP_Input_Adapter/Admin_exec.cpp
blob: e8b73970eaecb7c941fb3b58a0a62817cc3cc596 (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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
#include "Admin_exec.h"
#include <string>

namespace CIAO
{
  namespace RACE
  {
    namespace Input_Adapter
    {
      namespace CIDL_SA_POP_IA_Component_Impl
      {
        Admin_exec_i::Admin_exec_i (CIAO_CIAO_RACE_Input_Adapter_SA_POP_IA_Component_Impl::SA_POP_IA_Component_Context *context,
                                    Logger &logger)
          : logger_ (logger)
        {
          try
            {
              this->conductor_ = context->get_connection_conductor ();
            }
          catch (CORBA::Exception &ex)
            {
              std::string msg = "Exception caught::Admin_exec:: "
                                "Error while resolving references to "
                                "RACE Conductor object!\n";
              msg += ex._info ().c_str();
              this->logger_.log (msg);

            }
        }

        Admin_exec_i::~Admin_exec_i (void)
        {
        }

        ::CORBA::Boolean
        Admin_exec_i::add_string (
          const ::CIAO::RACE::OperationalString & opstring,
          ::CORBA::String_out ID)
        {
          try
            {
              return this->conductor_->add_string (opstring, ID);
            }
          catch (CORBA::Exception &ex)
            {
              std::string msg = "Exception caught in Admin_exec_i::"
                                "add_string.\n";
              msg += ex._info ().c_str();
              this->logger_.log (msg);

            }
          return false;
        }

        ::CORBA::Boolean
        Admin_exec_i::delete_string (const char * ID)
          throw (UnknownID)
        {
          try
            {
              return this->conductor_->delete_string (ID);
            }
          catch (UnknownID &ex)
            {
              std::string msg = "Given string ID is not know to RACE. ID:";
              msg += ID;
              this->logger_.log (msg);
              throw ex;
            }
          return false;
        }

        ::CORBA::Boolean
        Admin_exec_i::deploy_string (
          const ::CIAO::RACE::OperationalString & opstring,
          ::CORBA::String_out ID)
        {
          try
            {
              return this->conductor_->deploy_string (opstring, ID);
            }
          catch (CORBA::Exception &ex)
            {
              std::string msg = "Exception caught in "
                                "SA_POP_IA::Admin_exec_i::deploy_string.\n";
              msg += ex._info ().c_str();
              this->logger_.log (msg);
            }
          return false;
        }

        ::CORBA::Boolean
        Admin_exec_i::deploy_string_with_id (const char *ID)
          throw (UnknownID)
        {
          try
            {
              return this->deploy_string_with_id (ID);
            }
          catch (UnknownID &ex)
            {
              std::string msg = "Given string ID is not know to RACE. ID:";
              msg += ID;
              this->logger_.log (msg);
              throw ex;
            }
          return false;
        }

        CORBA::Boolean
        Admin_exec_i::modify_string
        (const ::CIAO::RACE::OperationalString & opstring,
         const char * ID) throw (UnknownID)
        {
          try
            {
              return this->conductor_->modify_string(opstring, ID);
            }
          catch (UnknownID &ex)
            {
              std::string msg = "Given string ID is not know to RACE. ID:";
              msg += ID;
              this->logger_.log (msg);
              throw ex;
            }
          return false;
        }

        ::CORBA::Boolean
        Admin_exec_i::tear_down_string (const char * ID)
          throw (UnknownID)
        {
          try
            {
              return this->conductor_->tear_down_string (ID);
            }
          catch (UnknownID &ex)
            {
              std::string msg = "Given string ID is not know to RACE. ID:";
              msg += ID;
              this->logger_.log (msg);
              throw ex;
            }
          return false;
        }
      }
    }
  }
}