Added headers
[tpot/pegasus/.git] / src / Pegasus / Client / CIMClient.h
index 6f84e07e9ccafa2714307cb68440c895feae08cf..7bb62bd6d7d2ccc29241fcb890345d4a96d11cfb 100644 (file)
-//%/////////////////////////////////////////////////////////////////////////////
-//
-// Copyright (c) 2000 The Open Group, BMC Software, Tivoli Systems, IBM
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the "Software"),
-// to deal in the Software without restriction, including without limitation
-// the rights to use, copy, modify, merge, publish, distribute, sublicense,
-// and/or sell copies of the Software, and to permit persons to whom the
-// Software is furnished to do so, subject to the following conditions:
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-// DEALINGS IN THE SOFTWARE.
-//
-//==============================================================================
-//
-// Author: Mike Brasher (mbrasher@bmc.com)
-//
-// Modified By:
-//
-//%/////////////////////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////////////////////////
-//
-// CIMClient.h
-//
-////////////////////////////////////////////////////////////////////////////////
-
-#ifndef Pegasus_Client_h
-#define Pegasus_Client_h
-
-#include <fstream>
-#include <Pegasus/Common/Config.h>
-#include <Pegasus/Common/CIMOperations.h>
-#include <Pegasus/Client/ClientException.h>
-
-PEGASUS_NAMESPACE_BEGIN
-
-class ClientHandler;
-class Selector;
-class Channel;
-
-/** Class CIMClient - This class defines the client interfaces for Pegasus.
-    These are the interfaces that could be used by a CIM CIMClient written in 
-    C++. These interfaces are based completely on the operations interfaces 
-    defined in the Pegasus CIMOperations.h file with some extensions for the 
-    client interface. @see "The CIMOperations Class"
-*/
-class PEGASUS_CLIENT_LINKAGE CIMClient : public CIMOperations
-{
-public:
-
-    enum { DEFAULT_TIMEOUT_MILLISECONDS = 20000 };
-
-    ///
-    CIMClient(
-       Selector* selector,
-       Uint32 timeOutMilliseconds = DEFAULT_TIMEOUT_MILLISECONDS);
-
-    ///
-    ~CIMClient();
-
-    ///
-    Uint32 getTimeOut() const
-    {
-       return _timeOutMilliseconds;
-    }
-
-    ///
-    void setTimeOut(Uint32 timeOutMilliseconds)
-    {
-       _timeOutMilliseconds = timeOutMilliseconds;
-    }
-
-    ///
-    void connect(const char* address);
-
-    ///
-    void get(const char* document) const;
-
-    ///
-    void runOnce();
-
-    ///
-    void runForever();
-
-    ///
-    virtual CIMClass getClass(
-       const String& nameSpace,
-       const String& className,
-       Boolean localOnly = true,
-       Boolean includeQualifiers = true,
-       Boolean includeClassOrigin = false,
-       const Array<String>& propertyList = EmptyStringArray());
-
-    ///
-    virtual CIMInstance getInstance(
-       const String& nameSpace,
-       const CIMReference& instanceName,
-       Boolean localOnly = true,
-       Boolean includeQualifiers = false,
-       Boolean includeClassOrigin = false,
-       const Array<String>& propertyList = EmptyStringArray());
-
-    ///
-    virtual void deleteClass(
-       const String& nameSpace,
-       const String& className);
-
-    ///
-    virtual void deleteInstance(
-       const String& nameSpace,
-       const CIMReference& instanceName);
-
-    ///
-    virtual void createClass(
-       const String& nameSpace,
-       CIMClass& newClass);
-
-    ///
-    virtual void createInstance(
-       const String& nameSpace,
-       CIMInstance& newInstance) ;
-
-    ///
-    virtual void modifyClass(
-       const String& nameSpace,
-       CIMClass& modifiedClass);
-
-    ///
-    virtual void modifyInstance(
-       const String& nameSpace,
-       CIMInstance& modifiedInstance);
-
-    ///
-    virtual Array<CIMClass> enumerateClasses(
-       const String& nameSpace,
-       const String& className = String::EMPTY,
-       Boolean deepInheritance = false,
-       Boolean localOnly = true,
-       Boolean includeQualifiers  = true,
-       Boolean includeClassOrigin = false);
-
-    ///
-    virtual Array<String> enumerateClassNames(
-       const String& nameSpace,
-       const String& className = String::EMPTY,
-       Boolean deepInheritance = false);
-
-    ///
-    virtual Array<CIMInstance> enumerateInstances(
-       const String& nameSpace,
-       const String& className,
-       Boolean deepInheritance = true,
-       Boolean localOnly = true,
-       Boolean includeQualifiers = false,
-       Boolean includeClassOrigin = false,
-       const Array<String>& propertyList = EmptyStringArray());
-
-    ///
-    virtual Array<CIMReference> enumerateInstanceNames(
-       const String& nameSpace,
-       const String& className);
-
-    ///
-    virtual Array<CIMInstance> execQuery(
-       const String& queryLanguage,
-       const String& query) ;
-
-    ///
-    virtual Array<CIMInstance> associators(
-       const String& nameSpace,
-       const CIMReference& objectName,
-       const String& assocClass = String::EMPTY,
-       const String& resultClass = String::EMPTY,
-       const String& role = String::EMPTY,
-       const String& resultRole = String::EMPTY,
-       Boolean includeQualifiers = false,
-       Boolean includeClassOrigin = false,
-       const Array<String>& propertyList = EmptyStringArray());
-
-    ///
-    virtual Array<CIMReference> associatorNames(
-       const String& nameSpace,
-       const CIMReference& objectName,
-       const String& assocClass = String::EMPTY,
-       const String& resultClass = String::EMPTY,
-       const String& role = String::EMPTY,
-       const String& resultRole = String::EMPTY);
-    ///
-    virtual Array<CIMInstance> references(
-       const String& nameSpace,
-       const CIMReference& objectName,
-       const String& resultClass = String::EMPTY,
-       const String& role = String::EMPTY,
-       Boolean includeQualifiers = false,
-       Boolean includeClassOrigin = false,
-       const Array<String>& propertyList = EmptyStringArray());
-
-    ///
-    virtual Array<CIMReference> referenceNames(
-       const String& nameSpace,
-       const CIMReference& objectName,
-       const String& resultClass = String::EMPTY,
-       const String& role = String::EMPTY);
-
-    ///
-    virtual CIMValue getProperty(
-       const String& nameSpace,
-       const CIMReference& instanceName,
-       const String& propertyName);
-
-    ////
-    virtual void setProperty(
-       const String& nameSpace,
-       const CIMReference& instanceName,
-       const String& propertyName,
-       const CIMValue& newValue = CIMValue());
-
-    ///
-    virtual CIMQualifierDecl getQualifier(
-       const String& nameSpace,
-       const String& qualifierName);
-
-    ///
-    virtual void setQualifier(
-       const String& nameSpace,
-       const CIMQualifierDecl& qualifierDeclaration);
-
-    ///
-    virtual void deleteQualifier(
-       const String& nameSpace,
-       const String& qualifierName);
-
-    ///
-    virtual Array<CIMQualifierDecl> enumerateQualifiers(
-       const String& nameSpace);
-
-    ///
-    virtual CIMValue invokeMethod(
-       const String& nameSpace,
-       const CIMReference& instanceName,
-       const String& methodName,
-       const Array<CIMValue>& inParameters,
-       Array<CIMValue>& outParameters);
-
-private:
-
-    ClientHandler* _getHandler();
-
-    void _sendMessage(const Array<Sint8>& message);
-
-    // ATTN-A: supply the real hostname here!
-
-    const char* _getHostName() const { return "localhost"; }
-
-    Selector* _selector;
-    Channel* _channel;
-    Uint32 _timeOutMilliseconds;
-};
-
-PEGASUS_NAMESPACE_END
-
-#endif /* Pegasus_Client_h */
-
+//%/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Copyright (c) 2000, 2001 The Open group, BMC Software, Tivoli Systems, IBM\r
+//\r
+// Permission is hereby granted, free of charge, to any person obtaining a copy\r
+// of this software and associated documentation files (the "Software"), to \r
+// deal in the Software without restriction, including without limitation the \r
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or \r
+// sell copies of the Software, and to permit persons to whom the Software is\r
+// furnished to do so, subject to the following conditions:\r
+// \r
+// THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN \r
+// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED\r
+// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT\r
+// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR \r
+// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \r
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN \r
+// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
+//\r
+//==============================================================================\r
+//\r
+// Author: Mike Brasher (mbrasher@bmc.com)\r
+//\r
+// Modified By:\r
+//\r
+//%/////////////////////////////////////////////////////////////////////////////\r
+\r
+////////////////////////////////////////////////////////////////////////////////\r
+//\r
+// CIMClient.h\r
+//\r
+////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef Pegasus_Client_h\r
+#define Pegasus_Client_h\r
+\r
+#include <fstream>\r
+#include <Pegasus/Common/Config.h>\r
+#include <Pegasus/Common/CIMOperations.h>\r
+#include <Pegasus/Client/ClientException.h>\r
+\r
+PEGASUS_NAMESPACE_BEGIN\r
+\r
+class ClientHandler;\r
+class Selector;\r
+class Channel;\r
+\r
+/** Class CIMClient - This class defines the client interfaces for Pegasus.\r
+    These are the interfaces that could be used by a CIM CIMClient written in \r
+    C++. These interfaces are based completely on the operations interfaces \r
+    defined in the Pegasus CIMOperations.h file with some extensions for the \r
+    client interface. @see "The CIMOperations Class"\r
+*/\r
+class PEGASUS_CLIENT_LINKAGE CIMClient : public CIMOperations\r
+{\r
+public:\r
+\r
+    enum { DEFAULT_TIMEOUT_MILLISECONDS = 20000 };\r
+\r
+    ///\r
+    CIMClient(\r
+       Selector* selector,\r
+       Uint32 timeOutMilliseconds = DEFAULT_TIMEOUT_MILLISECONDS);\r
+\r
+    ///\r
+    ~CIMClient();\r
+\r
+    ///\r
+    Uint32 getTimeOut() const\r
+    {\r
+       return _timeOutMilliseconds;\r
+    }\r
+\r
+    ///\r
+    void setTimeOut(Uint32 timeOutMilliseconds)\r
+    {\r
+       _timeOutMilliseconds = timeOutMilliseconds;\r
+    }\r
+\r
+    ///\r
+    void connect(const char* address);\r
+\r
+    ///\r
+    void get(const char* document) const;\r
+\r
+    ///\r
+    void runOnce();\r
+\r
+    ///\r
+    void runForever();\r
+\r
+    ///\r
+    virtual CIMClass getClass(\r
+       const String& nameSpace,\r
+       const String& className,\r
+       Boolean localOnly = true,\r
+       Boolean includeQualifiers = true,\r
+       Boolean includeClassOrigin = false,\r
+       const Array<String>& propertyList = EmptyStringArray());\r
+\r
+    ///\r
+    virtual CIMInstance getInstance(\r
+       const String& nameSpace,\r
+       const CIMReference& instanceName,\r
+       Boolean localOnly = true,\r
+       Boolean includeQualifiers = false,\r
+       Boolean includeClassOrigin = false,\r
+       const Array<String>& propertyList = EmptyStringArray());\r
+\r
+    ///\r
+    virtual void deleteClass(\r
+       const String& nameSpace,\r
+       const String& className);\r
+\r
+    ///\r
+    virtual void deleteInstance(\r
+       const String& nameSpace,\r
+       const CIMReference& instanceName);\r
+\r
+    ///\r
+    virtual void createClass(\r
+       const String& nameSpace,\r
+       CIMClass& newClass);\r
+\r
+    ///\r
+    virtual void createInstance(\r
+       const String& nameSpace,\r
+       CIMInstance& newInstance) ;\r
+\r
+    ///\r
+    virtual void modifyClass(\r
+       const String& nameSpace,\r
+       CIMClass& modifiedClass);\r
+\r
+    ///\r
+    virtual void modifyInstance(\r
+       const String& nameSpace,\r
+       CIMInstance& modifiedInstance);\r
+\r
+    ///\r
+    virtual Array<CIMClass> enumerateClasses(\r
+       const String& nameSpace,\r
+       const String& className = String::EMPTY,\r
+       Boolean deepInheritance = false,\r
+       Boolean localOnly = true,\r
+       Boolean includeQualifiers  = true,\r
+       Boolean includeClassOrigin = false);\r
+\r
+    ///\r
+    virtual Array<String> enumerateClassNames(\r
+       const String& nameSpace,\r
+       const String& className = String::EMPTY,\r
+       Boolean deepInheritance = false);\r
+\r
+    ///\r
+    virtual Array<CIMInstance> enumerateInstances(\r
+       const String& nameSpace,\r
+       const String& className,\r
+       Boolean deepInheritance = true,\r
+       Boolean localOnly = true,\r
+       Boolean includeQualifiers = false,\r
+       Boolean includeClassOrigin = false,\r
+       const Array<String>& propertyList = EmptyStringArray());\r
+\r
+    ///\r
+    virtual Array<CIMReference> enumerateInstanceNames(\r
+       const String& nameSpace,\r
+       const String& className);\r
+\r
+    ///\r
+    virtual Array<CIMInstance> execQuery(\r
+       const String& queryLanguage,\r
+       const String& query) ;\r
+\r
+    ///\r
+    virtual Array<CIMInstance> associators(\r
+       const String& nameSpace,\r
+       const CIMReference& objectName,\r
+       const String& assocClass = String::EMPTY,\r
+       const String& resultClass = String::EMPTY,\r
+       const String& role = String::EMPTY,\r
+       const String& resultRole = String::EMPTY,\r
+       Boolean includeQualifiers = false,\r
+       Boolean includeClassOrigin = false,\r
+       const Array<String>& propertyList = EmptyStringArray());\r
+\r
+    ///\r
+    virtual Array<CIMReference> associatorNames(\r
+       const String& nameSpace,\r
+       const CIMReference& objectName,\r
+       const String& assocClass = String::EMPTY,\r
+       const String& resultClass = String::EMPTY,\r
+       const String& role = String::EMPTY,\r
+       const String& resultRole = String::EMPTY);\r
+    ///\r
+    virtual Array<CIMInstance> references(\r
+       const String& nameSpace,\r
+       const CIMReference& objectName,\r
+       const String& resultClass = String::EMPTY,\r
+       const String& role = String::EMPTY,\r
+       Boolean includeQualifiers = false,\r
+       Boolean includeClassOrigin = false,\r
+       const Array<String>& propertyList = EmptyStringArray());\r
+\r
+    ///\r
+    virtual Array<CIMReference> referenceNames(\r
+       const String& nameSpace,\r
+       const CIMReference& objectName,\r
+       const String& resultClass = String::EMPTY,\r
+       const String& role = String::EMPTY);\r
+\r
+    ///\r
+    virtual CIMValue getProperty(\r
+       const String& nameSpace,\r
+       const CIMReference& instanceName,\r
+       const String& propertyName);\r
+\r
+    ////\r
+    virtual void setProperty(\r
+       const String& nameSpace,\r
+       const CIMReference& instanceName,\r
+       const String& propertyName,\r
+       const CIMValue& newValue = CIMValue());\r
+\r
+    ///\r
+    virtual CIMQualifierDecl getQualifier(\r
+       const String& nameSpace,\r
+       const String& qualifierName);\r
+\r
+    ///\r
+    virtual void setQualifier(\r
+       const String& nameSpace,\r
+       const CIMQualifierDecl& qualifierDeclaration);\r
+\r
+    ///\r
+    virtual void deleteQualifier(\r
+       const String& nameSpace,\r
+       const String& qualifierName);\r
+\r
+    ///\r
+    virtual Array<CIMQualifierDecl> enumerateQualifiers(\r
+       const String& nameSpace);\r
+\r
+    ///\r
+    virtual CIMValue invokeMethod(\r
+       const String& nameSpace,\r
+       const CIMReference& instanceName,\r
+       const String& methodName,\r
+       const Array<CIMValue>& inParameters,\r
+       Array<CIMValue>& outParameters);\r
+\r
+private:\r
+\r
+    ClientHandler* _getHandler();\r
+\r
+    void _sendMessage(const Array<Sint8>& message);\r
+\r
+    // ATTN-A: supply the real hostname here!\r
+\r
+    const char* _getHostName() const { return "localhost"; }\r
+\r
+    Selector* _selector;\r
+    Channel* _channel;\r
+    Uint32 _timeOutMilliseconds;\r
+};\r
+\r
+PEGASUS_NAMESPACE_END\r
+\r
+#endif /* Pegasus_Client_h */\r
+\r