00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ReplicaLocationIndex_H
00013 #define ReplicaLocationIndex_H 1
00014
00015 #include <string>
00016 #include <set>
00017 #include <map>
00018 #include <vector>
00019
00020 #include <EdgReplicaLocationIndex/ReplicationExceptions.h>
00021
00022 namespace EdgReplicaLocationIndex
00023 {
00034 typedef std::vector<std::string> LRCs;
00035 typedef unsigned char Byte;
00036 typedef std::vector<Byte> Bytes;
00037
00038 class ReplicaLocationIndex
00039 {
00045 public:
00048 ReplicaLocationIndex(const std::string& url) { }
00049
00052 virtual ~ReplicaLocationIndex() { }
00053
00058 virtual const std::string getUrl() const =0;
00059
00067 virtual void getLRC(const std::string& guid, LRCs& toFill ) const
00068 throw(CommunicationException) = 0;
00069
00075 virtual void lrcList(LRCs& toFill) const
00076 throw(CommunicationException) = 0;
00077
00084 virtual bool exists(const std::string& guid) const
00085 throw(CommunicationException) = 0;
00086
00094 virtual bool existsAt(const std::string& lrc,
00095 const std::string& guid) const
00096 throw(CommunicationException) = 0;
00097
00098
00099
00100
00101
00113 virtual void update(const std::string& lrcEndpoint,
00114 long expiration,
00115 const Bytes& bits,
00116 int entries,
00117 int numBits,
00118 int optimalNumKeys,
00119 int numHashes)
00120 throw(CommunicationException) = 0;
00121
00128 virtual bool remove(const std::string& lrcEndpoint)
00129 throw(CommunicationException) = 0;
00130
00131
00132
00133
00134
00135
00142 virtual const std::string ping() const
00143 throw(CommunicationException) = 0;
00144
00148 virtual const std::string getVersion() const
00149 throw(CommunicationException) = 0;
00150
00154 virtual const std::string getInterfaceVersion() const
00155 throw(CommunicationException) = 0;
00156 };
00157 }
00158
00159 #endif // ReplicaLocationIndex_H
00160
00161