1 karl 1.35 //%2006////////////////////////////////////////////////////////////////////////
|
2 mike 1.14 //
|
3 karl 1.33 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
4 // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
5 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
|
6 karl 1.27 // IBM Corp.; EMC Corporation, The Open Group.
|
7 karl 1.33 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
8 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
|
9 karl 1.34 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 // EMC Corporation; VERITAS Software Corporation; The Open Group.
|
11 karl 1.35 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
12 // EMC Corporation; Symantec Corporation; The Open Group.
|
13 mike 1.14 //
14 // Permission is hereby granted, free of charge, to any person obtaining a copy
15 // of this software and associated documentation files (the "Software"), to
16 // deal in the Software without restriction, including without limitation the
17 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
18 // sell copies of the Software, and to permit persons to whom the Software is
19 // furnished to do so, subject to the following conditions:
|
20 karl 1.27 //
|
21 mike 1.14 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
22 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
23 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
24 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
25 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
26 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
27 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 //
30 //==============================================================================
31 //
32 //%/////////////////////////////////////////////////////////////////////////////
33
|
34 kumpf 1.22 #ifndef Pegasus_CIMProvider_h
35 #define Pegasus_CIMProvider_h
|
36 mike 1.14
37 #include <Pegasus/Common/Config.h>
|
38 kumpf 1.22 #include <Pegasus/Common/OperationContext.h>
39 #include <Pegasus/Provider/CIMOMHandle.h>
40 #include <Pegasus/Provider/ProviderException.h>
41 #include <Pegasus/Common/ResponseHandler.h>
42 #include <Pegasus/Provider/Linkage.h>
|
43 mike 1.14
44 PEGASUS_NAMESPACE_BEGIN
45
|
46 kumpf 1.22 /**
|
47 kumpf 1.37 CIMProvider is the base class for the provider interface. A provider
48 must implement all the interfaces of the CIMProvider class and one or
49 more of its subclasses (such as CIMInstanceProvider). If a provider
50 does not support any of the operations specified by the interfaces,
51 it may just throw a CIMNotSupportedException.
|
52 mike 1.14
|
53 kumpf 1.37 <p>Some of the parameters that are common to the provider operation
54 interfaces are:
|
55 kumpf 1.22
|
56 kumpf 1.37 <ul>
57 <li>The OperationContext parameter contains information about the
58 context for the specified operation, including the user name of the
59 client requesting the operation. It is the provider's responsibility
60 to determine whether the user is authorized to perform the operation.
61 If the operation should not be permitted, the provider must throw
62 a CIMAccessDeniedException.</li>
63
64 <li>A CIMObjectPath specifies the CIM object on which the operation
65 is to be performed. This parameter specifies the hostname, namespace,
66 classname, and key values that uniquely identify a CIM instance.</li>
|
67 kumpf 1.22
|
68 kumpf 1.37 <li>A ResponseHandler is a callback handle used by the provider to
69 deliver response data to the CIM Server.</li>
70 </ul>
|
71 kumpf 1.22 */
|
72 mike 1.18 class PEGASUS_PROVIDER_LINKAGE CIMProvider
|
73 mike 1.14 {
74 public:
|
75 kumpf 1.37 /**
76 Default constructor for the abstract CIMProvider class.
77 */
78 CIMProvider();
|
79 mike 1.14
|
80 kumpf 1.22 /**
|
81 kumpf 1.37 Destructs the CIMProvider instance.
82 */
83 virtual ~CIMProvider();
|
84 mike 1.14
|
85 kumpf 1.37 /**
86 Initializes the provider. This method is called each time the
87 provider is loaded and must complete before any of the other
88 provider methods (other than terminate) are called.
89
90 An exception thrown from this method indicates a provider
91 initialization failure which prevents it from processing operation
92 requests.
|
93 kumpf 1.36
|
94 kumpf 1.37 @param cimom Reserved for future use.
|
95 kumpf 1.22 */
96 virtual void initialize(CIMOMHandle & cimom) = 0;
|
97 mike 1.14
98 /**
|
99 kumpf 1.37 Performs any cleanup required before the provider is unloaded.
100 This method may be called by the CIM Server at any time, including
101 during initialization. No other provider methods are called after
102 this method is invoked.
103
104 <p>Examples of cleanup a provider may perform in this method include:
105 <ul>
106 <li>Closing files and/or I/O streams</li>
107 <li>Releasing resources such as shared memory</li>
108 <li>Informing concurrently executing requests to complete
109 immediately (perhaps by setting a global flag)</li>
110 <li>Terminating subprocesses</li>
111 </ul>
112
113 <p>If the PegasusCreateProvider function dynamically instantiates the
114 provider with the "new" operator, then the terminate() method must
115 "delete" it:
116
117 <pre>
118 void MyProvider::terminate()
119 {
120 kumpf 1.37 ...
121 delete this;
122 }
123 </pre>
|
124 kumpf 1.36
|
125 kumpf 1.37 <p>An exception thrown from this method is considered to be a provider
126 error and is ignored.
|
127 mike 1.14 */
|
128 kumpf 1.37 virtual void terminate() = 0;
|
129 mike 1.14 };
130
131 PEGASUS_NAMESPACE_END
132
|
133 kumpf 1.22 #endif
|