summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/Log/LogMgr_i.h
blob: a66f7719ea33b20c643d35ca27671e7784e3238d (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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
// -*- C++ -*-

//=============================================================================
/**
 *  @file   LogMgr_i.h
 *
 *  $Id$
 *
 *  Implementation of the DsLogAdmin::LogMgr interface.
 *
 *  @author Matthew Braun <mjb2@cs.wustl.edu>
 *  @author Pradeep Gore <pradeep@cs.wustl.edu>
 *  @author David A. Hanvey <d.hanvey@qub.ac.uk>
 */
//=============================================================================

#ifndef TAO_TLS_LOGMGR_I_H
#define TAO_TLS_LOGMGR_I_H
#include /**/ "ace/pre.h"

#include "orbsvcs/DsLogAdminS.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#include "orbsvcs/Log/Log_i.h"
#include "orbsvcs/Log/Log_Persistence_Strategy.h"
#include "orbsvcs/Log/log_serv_export.h"

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

/**
 * @class TAO_LogMgr_i
 * @brief Log Factory
 *
 * The implementation delegates operations to a dynamically loaded
 * Strategy class.
 */
class TAO_Log_Serv_Export TAO_LogMgr_i
  : public virtual POA_DsLogAdmin::LogMgr
{
public:

  // = Initialization and Termination Methods

  /// Constructor.
  TAO_LogMgr_i ();

  /// Destructor.
  virtual ~TAO_LogMgr_i ();

  /// Lists all log object references.
  DsLogAdmin::LogList *
    list_logs (void);

  /// Lists all log ids.
  DsLogAdmin::LogIdList *
    list_logs_by_id (void);

  /// Returns a reference to the log with the supplied id.
  DsLogAdmin::Log_ptr
    find_log (DsLogAdmin::LogId id);

  /// Returns true if log exists, otherwise false
  bool exists (DsLogAdmin::LogId id);

  /// Remove the given entry from the container.
  int remove (DsLogAdmin::LogId id);

  /// @brief Create ObjectId
  ///
  /// Create object id for log channel @ id.
  ///
  /// @param id log id
  ///
  /// @return object id
  ///
  virtual PortableServer::ObjectId*
    create_objectid (DsLogAdmin::LogId id);

  /// @brief Create log reference
  ///
  /// Create object reference for log channel @a id.
  ///
  /// @param id log id
  ///
  /// @return object reference
  ///
  virtual DsLogAdmin::Log_ptr
    create_log_reference (DsLogAdmin::LogId id);

  /// @brief Create log object
  ///
  /// Create Log object for log channel @a id.
  ///
  /// @param id log id
  ///
  /// @return object reference
  ///
  virtual DsLogAdmin::Log_ptr
    create_log_object (DsLogAdmin::LogId id);

  /// @brief Create log repository id
  ///
  /// Return repository id for log
  ///
  /// @return repository id
  ///
  virtual CORBA::RepositoryId
    create_repositoryid  ()					= 0;

  /// @brief Create log servant
  ///
  /// Create Log servant for log channel @a id.
  ///
  /// @param id log id
  ///
  /// @return pointer to servant
  virtual PortableServer::ServantBase*
    create_log_servant (DsLogAdmin::LogId id)			= 0;

  /// @brief Get log record store
  ///
  /// Get/Create a log record store for log channel @a id.
  ///
  /// @param id log id
  ///
  TAO_LogRecordStore*
    get_log_record_store (DsLogAdmin::LogId id);

  CORBA::ORB_ptr orb();

  PortableServer::POA_ptr factory_poa();

  PortableServer::POA_ptr log_poa();

protected:
  /// @brief Initialize
  ///
  /// Creates factory and log channel POAs, and obtains the LogStore
  /// from a dynamically loaded Log_Persistence_Strategy (if one was
  /// specified in the service config file, otherwise the default
  /// Hash_Persistence_Strategy is used.)
  ///
  /// @param orb ORB
  /// @param poa Parent POA
  ///
  void init (CORBA::ORB_ptr orb,
	     PortableServer::POA_ptr poa);

  /// @brief Create log
  void create_i (DsLogAdmin::LogFullActionType full_action,
		 CORBA::ULongLong max_size,
		 const DsLogAdmin::CapacityAlarmThresholdList* thresholds,
		 DsLogAdmin::LogId_out id_out);

  /// @brief Create log
  void create_with_id_i (DsLogAdmin::LogId id,
			 DsLogAdmin::LogFullActionType full_action,
			 CORBA::ULongLong max_size,
			 const DsLogAdmin::CapacityAlarmThresholdList* thresholds);

  /// ORB.
  CORBA::ORB_var                orb_;

  /// POA.
  PortableServer::POA_var	poa_;

  /// Factory POA.
  PortableServer::POA_var	factory_poa_;

  /// Log POA.
  PortableServer::POA_var	log_poa_;

private:
  TAO_LogStore*			logstore_;
};

TAO_END_VERSIONED_NAMESPACE_DECL

#include /**/ "ace/post.h"
#endif /* TAO_TLS_LOGMGR_I_H */