1 ashok.pathak 1.4.4.2 //%LICENSE////////////////////////////////////////////////////////////////
2 //
3 // Licensed to The Open Group (TOG) under one or more contributor license
4 // agreements. Refer to the OpenPegasusNOTICE.txt file distributed with
5 // this work for additional information regarding copyright ownership.
6 // Each contributor licenses this file to you under the OpenPegasus Open
7 // Source License; you may not use this file except in compliance with the
8 // License.
9 //
10 // Permission is hereby granted, free of charge, to any person obtaining a
11 // copy of this software and associated documentation files (the "Software"),
12 // to deal in the Software without restriction, including without limitation
13 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 // and/or sell copies of the Software, and to permit persons to whom the
15 // Software is furnished to do so, subject to the following conditions:
16 //
17 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
19 //
20 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 ashok.pathak 1.4.4.2 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23 // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24 // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25 // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26 // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 //
28 //////////////////////////////////////////////////////////////////////////
29 //
30 //%/////////////////////////////////////////////////////////////////////////////
31
32 #ifndef Pegasus_SubscriptionKey_h
33 #define Pegasus_SubscriptionKey_h
34
35 #include <Pegasus/Common/Config.h>
36 #include <Pegasus/General/Linkage.h>
37 #include <Pegasus/Common/String.h>
38 #include <Pegasus/Common/CIMObjectPath.h>
39
40 PEGASUS_NAMESPACE_BEGIN
41
42 class SubscriptionKey;
43 ashok.pathak 1.4.4.2
44 struct PEGASUS_GENERAL_LINKAGE SubscriptionKeyEqualFunc
45 {
46 static Boolean equal(const SubscriptionKey& x, const SubscriptionKey& y);
47 };
48
49 struct PEGASUS_GENERAL_LINKAGE SubscriptionKeyHashFunc
50 {
51 static Uint32 hash(const SubscriptionKey& x);
52 };
53
54
55 /**
56 Normalizes the subscription path. Host name will be removed from both
57 filter and handler objectPaths. Namespace will also be removed from
58 filter or handler if filter's or handler's namespace is same as
59 subscription namespace.
60 */
61
62 class PEGASUS_GENERAL_LINKAGE SubscriptionKey
63 {
64 ashok.pathak 1.4.4.2
65 public:
66 SubscriptionKey(){};
67
68 SubscriptionKey(const CIMObjectPath & subscription);
69
70 ~SubscriptionKey(){};
71
72 String toString() const;
73
74 protected:
75 static void _parseObjectName(
76 const String & objectName,
77 String & name,
78 String & ns,
79 String & className);
80
81 private:
82 String handlerName;
83 String filterName;
84
85 ashok.pathak 1.4.4.2 String filterNamespace;
86 String handlerNamespace;
87 String subscriptionNamespace;
88
89 String filterClassName;
90 String handlerClassName;
91 String subscriptionClassName;
92
93
94 friend Boolean SubscriptionKeyEqualFunc::equal(
95 const SubscriptionKey&,
96 const SubscriptionKey&);
97
98 friend Uint32 SubscriptionKeyHashFunc::hash(const SubscriptionKey&);
99 };
100
101 PEGASUS_GENERAL_LINKAGE Boolean operator==(
102 const SubscriptionKey& key1,
103 const SubscriptionKey& key2);
104
105 PEGASUS_NAMESPACE_END
106 ashok.pathak 1.4.4.2
107 #endif /* Pegasus_SubscriptionKey_h */
|