(file) Return to EmbeddedServer.h CVS log (file) (dir) Up to [Pegasus] / pegasus / vxworks / cimserver

  1 mike  1.1.2.1 //%2006////////////////////////////////////////////////////////////////////////
  2               //
  3               // 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               // IBM Corp.; EMC Corporation, The Open Group.
  7               // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
  8               // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
  9               // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 10               // EMC Corporation; VERITAS Software Corporation; The Open Group.
 11               // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 12               // EMC Corporation; Symantec Corporation; The Open Group.
 13               //
 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               // 
 21               // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 22 mike  1.1.2.1 // 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               #ifndef Pegasus_EmbeddedServer_h
 35               #define Pegasus_EmbeddedServer_h
 36               
 37               #include <Pegasus/Common/Config.h>
 38               #include <Pegasus/Common/String.h>
 39               #include <Pegasus/Common/CIMName.h>
 40               
 41               PEGASUS_NAMESPACE_BEGIN
 42               
 43 mike  1.1.2.1 typedef class CIMProvider* (*PegasusCreateProviderEntryPoint)(const String&);
 44               
 45               /** This module defines a class EmbeddedServer that provides functions for
 46                   defining the setup of embedded servers where the providers are statically
 47                   defined and the pegasus memory-resident CIM repository is used.
 48                   See PEP 305 and the embeddedsystembuild readmes for more detailed
 49                   information.
 50               */
 51               class EmbeddedServer
 52               {
 53               public:
 54               
 55                   static const Uint32 INSTANCE_PROVIDER_TYPE;
 56                   static const Uint32 ASSOCIATION_PROVIDER_TYPE;
 57                   static const Uint32 INDICATION_PROVIDER_TYPE;
 58                   static const Uint32 METHOD_PROVIDER_TYPE;
 59                   static const Uint32 INSTANCE_QUERY_PROVIDER_TYPE;
 60               
 61                   /** Constructor.
 62                   */
 63                   EmbeddedServer();
 64 mike  1.1.2.1 
 65                   /** Destructor.
 66                   */
 67                   virtual ~EmbeddedServer();
 68               
 69                   /** This method is called once the repository is initialized. Provider
 70                       modules should be registered from this function.
 71                   */
 72                   virtual void initialize();
 73               
 74                   /** Load the repository. The derived class may optionally override and
 75                       implement this function; otherwise, this function takes no action.
 76                       The #data# parameter must point to memory obtained with malloc()
 77                       and will be passed to free() after it is consumed.
 78                       @param data array of bytes representing the repository.
 79                   */
 80                   virtual void loadRepository(Array<Uint8>& data);
 81               
 82                   /** Save the repository. The derived class may optionally override and
 83                       implement this function; otherwise, this function takes no action.
 84                       @param data array of bytes representing the repository.
 85 mike  1.1.2.1     */
 86                   virtual void saveRepository(const Array<Uint8>& data);
 87               
 88                   /** Put a record into the log. The derived class may optionally override
 89                       and implement this function; otherwise, this function takes no action.
 90                       @param type log type (1=TRACE, 2=STANDARD, 3=AUDIT, 4=ERROR, 5=DEBUG).
 91                       @param system name of system performing log.
 92                       @param level log level (1=TRACE, 2=INFO, 3=WARNING, 4=SEVERE, 5=FATAL).
 93                       @param message the localized log message.
 94                   */
 95                   virtual void putLog(
 96                       int type,
 97                       const char* system,
 98                       int level,
 99                       const char* message);
100               
101 mike  1.1.2.2     /** Authenticate the given user. This implementation returns true (allows
102                       any user to access the server). The derived class should override this
103                       function.
104                   */
105                   virtual bool authenticate(const char* user, const char* password);
106               
107 mike  1.1.2.1     /** Add a namespace to the meta-repository.
108                       @param nameSpace pointer to generated namespace to be added.
109                       @return true if successful.
110                   */
111                   Boolean addNameSpace(const struct SchemaNameSpace* nameSpace);
112               
113                   /** Shortcut for registering a PG_ProviderModule instance, a PG_Provider
114                       instance, and a PG_ProviderCapabilities instance for the special
115                       case in which there is one provider per module (a "singleton provider").
116                   */
117                   Boolean registerProvider(
118                       const Array<CIMNamespaceName>& nameSpaces,
119                       const CIMName& className,
120                       Uint32 providerTypes);
121               
122                   /** Register the provider entry point for the given Pegasus provider.
123                   */
124                   Boolean registerPegasusProviderEntryPoint(
125                       const String& location,
126                       class CIMProvider* (*entryPoint)(const String&));
127               
128 mike  1.1.2.1     /** Register the PegasusCreateProvider function.
129                   */
130                   Boolean registerPegasusCreateProviderEntryPoint(
131                       PegasusCreateProviderEntryPoint entryPoint);
132               
133 mike  1.1.2.2     /** Register an SLP service.
134 mike  1.1.2.1     */
135 mike  1.1.2.2     bool registerSLPService(unsigned short port, bool https);
136 mike  1.1.2.1 
137                   /** Run the cimserver. This function returns when the server is shut down.
138                       @param argc
139                       @param argv
140                       @return false if server generated an exception.
141                   */
142                   Boolean run(int argc, char** argv);
143               
144 mike  1.1.2.2 
145 mike  1.1.2.1 private:
146               
147                   EmbeddedServer(const EmbeddedServer&);
148                   EmbeddedServer& operator=(const EmbeddedServer&);
149               
150                   // Create PG_ProviderModule instance.
151                   Boolean _create_PG_ProviderModule(
152                       const String& moduleName,
153 mike  1.1.2.2         const String& location);
154 mike  1.1.2.1 
155                   // Create PG_Provider instance.
156                   Boolean _create_PG_Provider(
157                       const String& moduleName,
158                       const String& providerName);
159               
160                   // Create PG_ProviderCapabilities instance.
161                   Boolean _create_PG_ProviderCapabilities(
162                       const String& moduleName,
163                       const String& providerName,
164                       const String& capabilityId,
165                       const CIMName& className,
166                       const Array<CIMNamespaceName>& nameSpaces,
167                       Uint32 providerTypes);
168               
169                   // Opaque implementation state data.
170                   char _opaque[128];
171                   friend struct EmbeddedServerRep;
172               
173                   // Whether the "StaticProviderModule" PG_ProviderModule instances has been
174                   // created.
175 mike  1.1.2.1     bool _createdStaticProviderModule;
176               };
177               
178               PEGASUS_NAMESPACE_END
179               
180               #endif // Pegasus_EmbeddedServer_h

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2