1 mike 1.4 //%/////////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (c) 2000, 2001 The Open group, BMC Software, Tivoli Systems, IBM
4 //
5 // Permission is hereby granted, free of charge, to any person obtaining a copy
6 // of this software and associated documentation files (the "Software"), to
7 // deal in the Software without restriction, including without limitation the
8 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
9 // sell copies of the Software, and to permit persons to whom the Software is
10 // furnished to do so, subject to the following conditions:
11 //
12 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
13 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
14 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
15 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
16 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
18 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
19 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20 //
21 //==============================================================================
22 mike 1.4 //
23 // Author: Mike Brasher (mbrasher@bmc.com)
24 //
25 // Modified By:
26 //
27 //%/////////////////////////////////////////////////////////////////////////////
28
29 #ifndef Pegasus_AssocInstTable_h
30 #define Pegasus_AssocInstTable_h
31
32 #include <iostream>
33 #include <fstream>
34 #include <Pegasus/Common/Config.h>
35 #include <Pegasus/Common/CIMReference.h>
36 #include <Pegasus/Common/String.h>
37 #include <Pegasus/Common/Array.h>
38
39 PEGASUS_NAMESPACE_BEGIN
40
41 /** Maintains all associations for a given namesspace.
42 */
43 mike 1.4 class PEGASUS_REPOSITORY_LINKAGE AssocInstTable
44 {
45 public:
46
47 /** Appends a row into the association table. There is no checking
48 for duplicate entries (the caller ensures this). The case of
49 the arguments doesn't matter. They are ignored during comparison.
50 */
51 static void append(
52 PEGASUS_STD(ofstream)& os,
53 const String& assocInstanceName,
54 const String& assocClassName,
55 const String& fromInstanceName,
56 const String& fromClassName,
57 const String& fromPropertyName,
58 const String& toInstanceName,
59 const String& toClassName,
60 const String& toPropertyName);
61
62 /** Appends a row into the association table. There is no checking
63 for duplicate entries (the caller ensures this). The case of the
64 mike 1.4 arguments doesn't matter. Case is ignored during comparison.
65 */
66 static void append(
67 const String& path,
68 const String& assocInstanceName,
69 const String& assocClassName,
70 const String& fromInstanceName,
71 const String& fromClassName,
72 const String& fromPropertyName,
73 const String& toInstanceName,
74 const String& toClassName,
75 const String& toPropertyName);
76
77 /** Deletes the given association from the table by removing every entry
78 with an assocInstanceName equal to the assocInstanceName parameter.
79 @returns true if such an association was found.
80 */
81 static Boolean deleteAssociation(
82 const String& path,
83 const CIMReference& assocInstanceName);
84
85 mike 1.4 /** Finds all associators of the given object. See
86 CIMOperations::associators() for a full description.
87 */
88 static Boolean getAssociatorNames(
89 const String& path,
90 const CIMReference& objectName,
91 const String& assocClass,
92 const String& resultClass,
93 const String& role,
94 const String& resultRole,
95 Array<String>& associatorNames);
96
97 /** Obtain all references (association instance names) in which the
98 given object is involved. See CIMOperations::associators() for a
99 full description.
100 */
101 static Boolean getReferenceNames(
102 const String& path,
103 const CIMReference& objectName,
104 const String& resultClass,
105 const String& role,
106 mike 1.4 Array<String>& referenceNames);
107
108 private:
109
110 AssocInstTable() { /* private */ }
111 };
112
113 PEGASUS_NAMESPACE_END
114
115 #endif /* Pegasus_AssocInstTable_h */
|