environment.hpp 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. /*##############################################################################
  2. Copyright (C) 2011 HPCC Systems.
  3. All rights reserved. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU Affero General Public License as
  5. published by the Free Software Foundation, either version 3 of the
  6. License, or (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU Affero General Public License for more details.
  11. You should have received a copy of the GNU Affero General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. ############################################################################## */
  14. // *** Include file generated by HIDL Version 1.3 from environment.scm ***
  15. // *** Not to be hand edited (changes will be lost on re-generation) ***
  16. #ifndef environment_SCM_INCL
  17. #define environment_SCM_INCL
  18. #include "jiface.hpp"
  19. #include "dasubs.hpp"
  20. #ifdef WIN32
  21. #ifdef ENVIRONMENT_EXPORTS
  22. #define ENVIRONMENT_API __declspec(dllexport)
  23. #else
  24. #define ENVIRONMENT_API __declspec(dllimport)
  25. #endif
  26. #else
  27. #define ENVIRONMENT_API
  28. #endif
  29. interface IPropertyTree; // Not yet SCM-compliant
  30. interface IEnvironment; // Forward reference
  31. interface ISDSSubscription;// Forward reference
  32. interface IConstEnvBase : extends IInterface
  33. {
  34. virtual IStringVal & getXML(IStringVal & str) const = 0;
  35. virtual IStringVal & getName(IStringVal & str) const = 0;
  36. virtual IPropertyTree & getPTree() const = 0;
  37. };
  38. interface IConstDomainInfo : extends IConstEnvBase
  39. {
  40. virtual void getAccountInfo(IStringVal & name, IStringVal & pw) const = 0;
  41. virtual void getSnmpSecurityString(IStringVal & securityString) const = 0;
  42. virtual void getSSHAccountInfo(IStringVal & name, IStringVal & sshKeyFile, IStringVal& sshKeyPassphrase) const = 0;
  43. };
  44. enum EnvMachineState
  45. {
  46. MachineStateAvailable = 0,
  47. MachineStateUnavailable = 1,
  48. MachineStateUnknown = 2
  49. };
  50. enum EnvMachineOS
  51. {
  52. MachineOsW2K = 0,
  53. MachineOsSolaris = 1,
  54. MachineOsLinux = 2,
  55. MachineOsUnknown = 3,
  56. MachineOsSize = 4
  57. };
  58. interface IConstComputerTypeInfo : extends IConstEnvBase
  59. {
  60. virtual EnvMachineOS getOS() const = 0;
  61. virtual unsigned getNicSpeedMbitSec() const = 0;
  62. };
  63. interface IConstMachineInfo : extends IConstEnvBase
  64. {
  65. virtual IConstDomainInfo * getDomain() const = 0;
  66. virtual IStringVal & getNetAddress(IStringVal & str) const = 0;
  67. virtual unsigned getNicSpeedMbitSec() const = 0;
  68. virtual IStringVal & getDescription(IStringVal & str) const = 0;
  69. virtual EnvMachineOS getOS() const = 0;
  70. virtual EnvMachineState getState() const = 0;
  71. };
  72. interface IConstInstanceInfo : extends IConstEnvBase
  73. {
  74. virtual IConstMachineInfo * getMachine() const = 0;
  75. virtual IStringVal & getEndPoint(IStringVal & str) const = 0;
  76. virtual unsigned getPort() const = 0;
  77. virtual IStringVal & getExecutableDirectory(IStringVal & str) const = 0;
  78. virtual bool getRunInfo(IStringVal & progpath, IStringVal & workdir, const char * defaultprogname) const = 0;
  79. };
  80. interface IConstEnvironment : extends IConstEnvBase
  81. {
  82. virtual IConstDomainInfo * getDomain(const char * name) const = 0;
  83. virtual IConstMachineInfo * getMachine(const char * name) const = 0;
  84. virtual IConstMachineInfo * getMachineByAddress(const char * netaddress) const = 0;
  85. virtual IConstInstanceInfo * getInstance(const char * type, const char * version, const char * domain) const = 0;
  86. virtual IConstComputerTypeInfo * getComputerType(const char * name) const = 0;
  87. virtual bool getRunInfo(IStringVal & path, IStringVal & dir, const char * type, const char * version, const char * machineaddr, const char * defaultprogname) const = 0;
  88. virtual IEnvironment & lock() const = 0;
  89. virtual bool isConstEnvironment() const = 0;
  90. virtual void clearCache() = 0;
  91. };
  92. interface IEnvironment : extends IConstEnvironment
  93. {
  94. virtual void commit() = 0;
  95. virtual void rollback() = 0;
  96. virtual void setXML(const char * (null)) = 0;
  97. virtual void preload() = 0;
  98. };
  99. interface IEnvironmentFactory : extends IInterface
  100. {
  101. virtual IConstEnvironment * openEnvironment() = 0;
  102. virtual IConstEnvironment * createEnvironmentByFile(const char * environmentConfFile, const char * environmentXMLFile) = 0;
  103. virtual IConstEnvironment * openEnvironmentByFile() = 0;
  104. virtual const char * getEnvironmentConf() = 0;
  105. virtual IEnvironment * updateEnvironment() = 0;
  106. virtual IEnvironment * loadLocalEnvironmentFile(const char * filename) = 0;
  107. virtual IEnvironment * loadLocalEnvironment(const char * xml) = 0;
  108. virtual SubscriptionId subscribe(ISDSSubscription * pSubHandler) = 0;
  109. virtual void unsubscribe(SubscriptionId id) = 0;
  110. virtual void validateCache() = 0;
  111. };
  112. class StringBuffer;
  113. extern "C" ENVIRONMENT_API IEnvironmentFactory * getEnvironmentFactory();
  114. extern "C" ENVIRONMENT_API void closeEnvironment();
  115. #endif // _environment_SCM_INCL
  116. //end