summaryrefslogtreecommitdiff
path: root/cpp/src/IceGrid/InternalRegistryI.h
blob: f90637f66c6c1421bb1262d31d4134d013fc9d8a (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
//
// Copyright (c) ZeroC, Inc. All rights reserved.
//

#ifndef ICE_GRID_INTERNALREGISTRYI_H
#define ICE_GRID_INTERNALREGISTRYI_H

#include <IceGrid/Registry.h>
#include <IceGrid/Internal.h>

namespace IceGrid
{

class Database;
class FileCache;
class ReapThread;
class RegistryI;
class ReplicaSessionManager;
class WellKnownObjectsManager;

class InternalRegistryI : public InternalRegistry
{
public:

    InternalRegistryI(const std::shared_ptr<RegistryI>&, const std::shared_ptr<Database>&,
                      const std::shared_ptr<ReapThread>&, const std::shared_ptr<WellKnownObjectsManager>&,
                      ReplicaSessionManager&);

    std::shared_ptr<NodeSessionPrx> registerNode(std::shared_ptr<InternalNodeInfo>, std::shared_ptr<NodePrx>, LoadInfo,
                                                 const Ice::Current&) override;
    std::shared_ptr<ReplicaSessionPrx> registerReplica(std::shared_ptr<InternalReplicaInfo>,
                                                       std::shared_ptr<InternalRegistryPrx>,
                                                       const Ice::Current&) override;

    void registerWithReplica(std::shared_ptr<InternalRegistryPrx>, const Ice::Current&) override;

    NodePrxSeq getNodes(const Ice::Current&) const override;
    InternalRegistryPrxSeq getReplicas(const Ice::Current&) const override;

    ApplicationInfoSeq getApplications(long long&, const Ice::Current&) const override;
    AdapterInfoSeq getAdapters(long long&, const Ice::Current&) const override;
    ObjectInfoSeq getObjects(long long&, const Ice::Current&) const override;

    void shutdown(const Ice::Current&) const override;

    long long getOffsetFromEnd(std::string, int, const Ice::Current&) const override;
    bool read(std::string, long long, int, long long&, Ice::StringSeq&, const Ice::Current&) const override;

private:

    std::string getFilePath(const std::string&) const;

    const std::shared_ptr<RegistryI> _registry;
    const std::shared_ptr<Database> _database;
    const std::shared_ptr<ReapThread> _reaper;
    const std::shared_ptr<WellKnownObjectsManager> _wellKnownObjects;
    const std::shared_ptr<FileCache> _fileCache;
    ReplicaSessionManager& _session;
    std::chrono::seconds _nodeSessionTimeout;
    std::chrono::seconds _replicaSessionTimeout;
    bool _requireNodeCertCN;
    bool _requireReplicaCertCN;
};

};

#endif