00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef __BROKERINFO_H__
00029 #define __BROKERINFO_H__
00030
00034 const bool PARSE_RULE = true;
00035
00036 #include <string>
00037 #include <vector>
00038 #include <strstream>
00039 #include <fstream>
00040
00041 #ifdef WANT_NAMESPACES
00042 #define CLASSAD( x ) classad::x
00043 #else
00044 #define CLASSAD( x ) x
00045 #endif
00046
00047 #include "classad_distribution.h"
00048
00049 #include "bi_result.h"
00050
00051 class BrokerInfoEx {
00052 };
00053
00054 class BrokerInfo {
00055 public:
00056
00059 ~BrokerInfo(void);
00060
00063 static BrokerInfo* instance(void);
00064
00067 std::string getBIFileName(void);
00068
00073 BI_Result getCE(std::string& CE);
00074
00079 BI_Result getDataAccessProtocol(std::vector<std::string>& DAPs);
00080
00086 BI_Result getLFN2SFN(std::string LFN, std::vector<std::string>& SFNs);
00087
00092 BI_Result getSEs(std::vector<std::string>& SEs);
00093
00098 BI_Result getSEProtocols(std::string SE, std::vector<std::string>& SEProtos);
00099
00104 BI_Result getSEPort(std::string SE, std::string SEProtocol, std::string& SEPort);
00105
00110 BI_Result getCloseSEs(std::vector<std::string>& SEs);
00111
00116 BI_Result getSEMountPoint(std::string CloseSE, std::string& SEMount);
00117
00122 BI_Result getSEFreeSpace(std::string CloseSE, std::string& SEFreeSpace);
00123
00128 BI_Result getInputData(std::vector<std::string>& LFNs);
00129
00134 BI_Result getVirtualOrganization(std::string& VO);
00135
00138 int parser(std::string& outbuffer);
00139
00140 private:
00141
00146 BrokerInfo(void);
00147
00150 BI_Result searchAD(std::string attrName, std::string& attrExpr, CLASSAD(ClassAd*) clAd);
00151 void prettyStrList(std::string buffer, std::vector<std::string>& outList);
00152 void prettyCAdList(std::string buffer, std::vector<std::string>& outList);
00153 void prettyString(std::string& outStr);
00154 CLASSAD(ClassAd*) parserAD(std::string buffer);
00155
00156 std::string BrokerInfoFile_;
00157 std::ifstream fbrokerinfo_;
00158 std::strstream mbrokerinfo_;
00159 CLASSAD(ClassAd*) ad_;
00160
00161 static BrokerInfo* instance_;
00162 };
00163
00173 #endif // __BROKERINFO_H__