NetworkProxy.cc 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*
  2. * Copyright 2009-2017 Alibaba Cloud All rights reserved.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #include <alibabacloud/core/NetworkProxy.h>
  17. using namespace AlibabaCloud;
  18. NetworkProxy::NetworkProxy(Type type,
  19. const std::string &hostName,
  20. uint16_t port,
  21. const std::string &user,
  22. const std::string &password)
  23. : hostName_(hostName),
  24. password_(password),
  25. port_(port),
  26. type_(type),
  27. user_(user)
  28. {
  29. }
  30. NetworkProxy::~NetworkProxy()
  31. {
  32. }
  33. std::string NetworkProxy::hostName() const
  34. {
  35. return hostName_;
  36. }
  37. std::string NetworkProxy::password() const
  38. {
  39. return password_;
  40. }
  41. uint16_t NetworkProxy::port() const
  42. {
  43. return port_;
  44. }
  45. void NetworkProxy::setHostName(const std::string &hostName)
  46. {
  47. hostName_ = hostName;
  48. }
  49. void NetworkProxy::setPassword(const std::string &password)
  50. {
  51. password_ = password;
  52. }
  53. void NetworkProxy::setPort(uint16_t port)
  54. {
  55. port_ = port;
  56. }
  57. void NetworkProxy::setType(NetworkProxy::Type type)
  58. {
  59. type_ = type;
  60. }
  61. void NetworkProxy::setUser(const std::string &user)
  62. {
  63. user_ = user;
  64. }
  65. NetworkProxy::Type NetworkProxy::type() const
  66. {
  67. return type_;
  68. }
  69. std::string NetworkProxy::user() const
  70. {
  71. return user_;
  72. }