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
|
// **********************************************************************
//
// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
#ifndef ICEGRID_NODE_SESSION_H
#define ICEGRID_NODE_SESSION_H
#include <IceGrid/Internal.h>
namespace IceGrid
{
class Database;
typedef IceUtil::Handle<Database> DatabasePtr;
class TraceLevels;
typedef IceUtil::Handle<TraceLevels> TraceLevelsPtr;
class PatcherFeedbackAggregator : public IceUtil::Mutex, public IceUtil::Shared
{
public:
PatcherFeedbackAggregator(Ice::Identity, const TraceLevelsPtr&, const std::string&, const std::string&, int);
virtual ~PatcherFeedbackAggregator();
void finished(const std::string&);
void failed(const std::string&, const std::string&);
protected:
virtual void exception(const Ice::Exception&) = 0;
virtual void response() = 0;
private:
void checkIfDone();
const Ice::Identity _id;
const TraceLevelsPtr _traceLevels;
const std::string _type;
const std::string _name;
const int _count;
std::set<std::string> _successes;
std::set<std::string> _failures;
Ice::StringSeq _reasons;
};
typedef IceUtil::Handle<PatcherFeedbackAggregator> PatcherFeedbackAggregatorPtr;
class NodeSessionI : public NodeSession, public IceUtil::Mutex
{
public:
NodeSessionI(const DatabasePtr&, const NodePrx&, const InternalNodeInfoPtr&, int);
virtual void keepAlive(const LoadInfo&, const Ice::Current&);
virtual void setReplicaObserver(const ReplicaObserverPrx&, const Ice::Current&);
virtual int getTimeout(const Ice::Current& = Ice::Current()) const;
virtual NodeObserverPrx getObserver(const Ice::Current&) const;
virtual void loadServers_async(const AMD_NodeSession_loadServersPtr&, const Ice::Current&) const;
virtual Ice::StringSeq getServers(const Ice::Current&) const;
virtual void waitForApplicationUpdate_async(const AMD_NodeSession_waitForApplicationUpdatePtr&,
const std::string&, int, const Ice::Current&) const;
virtual void destroy(const Ice::Current& = Ice::Current());
virtual IceUtil::Time timestamp() const;
virtual void shutdown();
void patch(const PatcherFeedbackAggregatorPtr&, const std::string&, const std::string&,
const InternalDistributionDescriptorPtr&, bool);
const NodePrx& getNode() const;
const InternalNodeInfoPtr& getInfo() const;
const LoadInfo& getLoadInfo() const;
NodeSessionPrx getProxy() const;
bool isDestroyed() const;
void removeFeedback(const PatcherFeedbackPtr&, const Ice::Identity&);
private:
void destroyImpl(bool);
const DatabasePtr _database;
const TraceLevelsPtr _traceLevels;
const std::string _name;
const NodePrx _node;
const InternalNodeInfoPtr _info;
const int _timeout;
NodeSessionPrx _proxy;
ReplicaObserverPrx _replicaObserver;
IceUtil::Time _timestamp;
LoadInfo _load;
bool _destroy;
std::set<PatcherFeedbackPtr> _feedbacks;
};
typedef IceUtil::Handle<NodeSessionI> NodeSessionIPtr;
};
#endif
|