summaryrefslogtreecommitdiff
path: root/cpp/slice/IceGrid/Query.ice
blob: 939145263ad151158f48548b9ce4f7421583c046 (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
// **********************************************************************
//
// Copyright (c) 2003-2006 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 ICE_GRID_QUERY_ICE
#define ICE_GRID_QUERY_ICE

#include <Ice/Identity.ice>
#include <Ice/BuiltinSequences.ice>

#include <IceGrid/Exception.ice>

/**
 *
 * &IceGrid; is a server activation and deployment tool. &IceGrid;,
 * simplifies the complex task of deploying applications in a
 * heterogenous computer network.
 *
 **/
module IceGrid
{

enum LoadSample
{
    LoadSample1,
    LoadSample5,
    LoadSample15
};

/**
 *
 * The &IceGrid; query interface. This interface is accessible to
 * &Ice; clients who wish to lookup objects.
 *
 **/
interface Query
{
    /**
     *
     * Find an object by identity.
     *
     * @param id The identity.
     *
     * @return The proxy or null if no such object has been found.
     *
     **/
    nonmutating Object* findObjectById(Ice::Identity id);

    /**
     *
     * Find an object by type. If there's several objects registered
     * for the given type, the object will be randomly selected.
     *
     * @param type The object type.
     *
     * @return The proxy or null if no such object has been found.
     *
     **/
    nonmutating Object* findObjectByType(string type);


    /**
     *
     * Find an object by type on the least loaded node. If the
     * registry can't figure out the node that hosts the object (e.g.,
     * if the object was registered with a direct proxy), the registry
     * assumes the object is hosted on a node that has a load average
     * of 1.0.
     *
     * @param type The object type.
     *
     * @return The proxy or null if no such object has been found.
     *
     **/
    nonmutating Object* findObjectByTypeOnLeastLoadedNode(string type, LoadSample sample);

    /**
     *
     * Find all the objects with the given type.
     *
     * @param type The object type.
     *
     * @return The proxies or an empty sequence if no such objects
     * have been found.
     *
     **/
    nonmutating Ice::ObjectProxySeq findAllObjectsByType(string type);
};

};

#endif