00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef STORAGELOCATION_H
00015 #define STORAGELOCATION_H
00016
00017 #include <string>
00018
00019 namespace glite
00020 {
00021 namespace rgma
00022 {
00042 class Storage
00043 {
00044
00045 private:
00046 std::string m_location;
00047 std::string m_userName;
00048 std::string m_password;
00049
00050 std::string m_logicalName;
00051
00052 int m_type;
00053
00054 bool compare(std::string a, std::string b);
00055
00056 public:
00058 const static Storage MEMORY;
00059
00061 const static Storage DATABASE;
00062
00064 const static Storage FILE;
00065
00066 virtual ~Storage();
00067
00072 Storage(const Storage& storage);
00073
00078 Storage& operator=(const Storage& storage);
00079
00089 static Storage getDatabase(const std::string location,
00090 const std::string userName, const std::string password);
00091
00099 static Storage getDatabase(const std::string logicalName);
00100
00106 bool isDatabase();
00107
00113 bool isFile();
00114
00120 bool isMemory();
00121
00127 std::string getPassword();
00128
00134 std::string getLocation();
00135
00141 std::string getUserName();
00142
00148 std::string getLogicalName();
00149
00157
00158
00164 bool hasDetails();
00165
00173 int hashCode();
00174
00183 bool operator==(const Storage storage);
00184
00193 bool operator!=(const Storage storage);
00194
00203 bool equals(Storage Storage);
00204
00205 Storage(){};
00206 int getType();
00207
00208 protected:
00210 const static int M = 1;
00212 const static int D = 2;
00214 const static int F = 4;
00215
00221 Storage(int type);
00222
00229 Storage( const int type, const std::string logicalName );
00230
00239 Storage( const std::string location, const std::string userName,
00240 const std::string password);
00241
00242 };
00243 }
00244 }
00245 #endif // STORAGELOCATION_H