ws_dfsclient.hpp 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*##############################################################################
  2. HPCC SYSTEMS software Copyright (C) 2022 HPCC Systems®.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. ############################################################################## */
  13. #ifndef _WS_DFSCLIENT_HPP
  14. #define _WS_DFSCLIENT_HPP
  15. #ifndef WS_DFSCLIENT_API
  16. #ifdef WS_DFSCLIENT_EXPORTS
  17. #define WS_DFSCLIENT_API DECL_EXPORT
  18. #else
  19. #define WS_DFSCLIENT_API DECL_IMPORT
  20. #endif
  21. #endif
  22. namespace wsdfs
  23. {
  24. static constexpr unsigned keepAliveExpiryFrequency = 30; // may want to make configurable at some point
  25. interface IDFSFile : extends IInterface
  26. {
  27. virtual IPropertyTree *queryFileMeta() const = 0;
  28. virtual IPropertyTree *queryCommonMeta() const = 0;
  29. virtual unsigned __int64 getLockId() const = 0;
  30. virtual unsigned numSubFiles() const = 0; // >0 implies this is a superfile
  31. virtual IDFSFile *getSubFile(unsigned idx) const = 0;
  32. // there are here in case a client wants to use them to lookup a related file (e.g. subfiles of a super)
  33. virtual const char *queryRemoteName() const = 0;
  34. virtual IUserDescriptor *queryUserDescriptor() const = 0;
  35. virtual unsigned queryTimeoutSecs() const = 0;
  36. };
  37. WS_DFSCLIENT_API IDFSFile *lookupDFSFile(const char *logicalName, unsigned timeoutSecs, unsigned keepAliveExpiryFrequency, IUserDescriptor *userDesc);
  38. WS_DFSCLIENT_API IDistributedFile *createLegacyDFSFile(IDFSFile *dfsFile);
  39. WS_DFSCLIENT_API IDistributedFile *lookupLegacyDFSFile(const char *logicalName, unsigned timeoutSecs, unsigned keepAliveExpiryFrequency, IUserDescriptor *userDesc);
  40. } // end of namespace wsdfs
  41. #endif // _WS_DFSCLIENT_HPP