ProxyInfo.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
3 
4  This file is part of the TerraLib - a Framework for building GIS enabled applications.
5 
6  TerraLib is free software: you can redistribute it and/or modify
7  it under the terms of the GNU Lesser General Public License as published by
8  the Free Software Foundation, either version 3 of the License,
9  or (at your option) any later version.
10 
11  TerraLib is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public License
17  along with TerraLib. See COPYING. If not, write to
18  TerraLib Team at <terralib-team@terralib.org>.
19  */
20 
21 /*!
22  \file terralib/core/uri/ProxyInfo.h
23 
24  \brief A class to store the proxy information that must be used to access data located in URIs.
25 
26  \author Mario Rocco Pettinati
27  */
28 
29 #ifndef __TERRALIB_CORE_URI_PROXYINFO_H__
30 #define __TERRALIB_CORE_URI_PROXYINFO_H__
31 
32 // TerraLib
33 #include "../Config.h"
34 
35 // STL
36 #include <string>
37 
38 namespace te
39 {
40  namespace core
41  {
42  /*!
43  \class URI
44 
45  \brief A class to store the proxy information that must be used to access data located in URIs.
46  */
48  {
49  public:
50 
51  /*! \brief Default constructor. */
53 
54  /*! \brief Gets Proxy Host information.
55  \return The Proxy Host information
56  */
57  const std::string& getHost() const;
58 
59  /*! \brief Sets Proxy Host information.
60  \param host The Proxy Host information
61  */
62  void setHost(const std::string& host);
63 
64  /*! \brief Gets Proxy Port information.
65  \return The Proxy Port information
66  */
67  int getPort() const;
68 
69  /*! \brief Sets Proxy Port information.
70  \param port The Proxy Port information
71  */
72  void setPort(int port);
73 
74  /*! \brief Gets Proxy UserName information.
75  \return The Proxy UserName information
76  */
77  const std::string& getUserName() const;
78 
79  /*! \brief Sets Proxy User Name information.
80  \param userName The Proxy User Name information
81  */
82  void setUserName(const std::string& userName);
83 
84  /*! \brief Gets Proxy Password information.
85  \return The Proxy Password information
86  */
87  const std::string& getPassword() const;
88 
89  /*! \brief Sets Proxy Password information.
90  \param password The Proxy Password information
91  */
92  void setPassword(const std::string& password);
93 
94  /*! \brief Checks if the use of the proxy settings is enabled and must be used in requests.
95  \return TRUE if the of the proxy settings is enabled; FALSE otherwise
96  */
97  bool isEnabled() const;
98 
99  /*! \brief Sets Enabled or Disabled the use of the proxy settings.
100  \param enabled The new state of the use of the proxy settings.
101  */
102  void setEnabled(bool enabled);
103 
104  /*! \brief Checks if the proxy settings has authentication information sets (userName and password). */
105  bool isAuthenticated() const;
106 
107  /*! \brief Gets the proxy settings host component (host:port). */
108  std::string getHostPort() const;
109 
110  /*! \brief Gets the proxy settings authentication component (user:password). */
111  std::string getAuthentication() const;
112 
113  /*! \brief Gets the proxy settings as a string.
114  \return The proxy settings as a string.
115  */
116  std::string toString() const;
117 
118  protected:
119 
120  std::string m_host; //!< Stores information related to the proxy host
121  int m_port; //!< Stores information related to the proxy port
122  std::string m_userName; //!< Stores information related to the proxy user
123  std::string m_password; //!< Stores information related to the proxy password
124  bool m_isEnabled; //!< Stores information related to the enabling of the use of these proxy settings
125 
126  };
127 
128  } // end namespace core
129 } // end namespace te
130 
131 #endif // __TERRALIB_CORE_URI_PROXYINFO_H__
bool isEnabled() const
Checks if the use of the proxy settings is enabled and must be used in requests.
void setPort(int port)
Sets Proxy Port information.
std::string toString() const
Gets the proxy settings as a string.
void setPassword(const std::string &password)
Sets Proxy Password information.
const std::string & getUserName() const
Gets Proxy UserName information.
std::string m_host
Stores information related to the proxy host.
Definition: ProxyInfo.h:120
void setHost(const std::string &host)
Sets Proxy Host information.
int getPort() const
Gets Proxy Port information.
bool m_isEnabled
Stores information related to the enabling of the use of these proxy settings.
Definition: ProxyInfo.h:124
std::string getHostPort() const
Gets the proxy settings host component (host:port).
std::string m_userName
Stores information related to the proxy user.
Definition: ProxyInfo.h:122
std::string m_password
Stores information related to the proxy password.
Definition: ProxyInfo.h:123
bool isAuthenticated() const
Checks if the proxy settings has authentication information sets (userName and password).
int m_port
Stores information related to the proxy port.
Definition: ProxyInfo.h:121
const std::string & getPassword() const
Gets Proxy Password information.
void setEnabled(bool enabled)
Sets Enabled or Disabled the use of the proxy settings.
const std::string & getHost() const
Gets Proxy Host information.
void setUserName(const std::string &userName)
Sets Proxy User Name information.
ProxyInfo()
Default constructor.
std::string getAuthentication() const
Gets the proxy settings authentication component (user:password).
TerraLib.
#define TECOREEXPORT
Definition: Config.h:52