src/BrokerInfo.h

Go to the documentation of this file.
00001 /*
00002 Copyright (c) Members of the EGEE Collaboration. 2004.
00003 See http://www.eu-egee.org/partners/ for details on the
00004 copyright holders.
00005 
00006 Licensed under the Apache License, Version 2.0 (the "License");
00007 you may not use this file except in compliance with the License.
00008 You may obtain a copy of the License at
00009 
00010     http://www.apache.org/licenses/LICENSE-2.0
00011 
00012 Unless required by applicable law or agreed to in writing, software
00013 distributed under the License is distributed on an "AS IS" BASIS,
00014 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
00015 either express or implied.
00016 See the License for the specific language governing permissions and
00017 limitations under the License.
00018 */
00019 
00020 /***************************************************************************
00021 * filename : BrokerInfo.h
00022 * authors : Livio Salconi <livio.salconi@pi.infn.it>
00023 * copyright : (C) 2001 by INFN
00024 ***************************************************************************/
00025 
00026 // $Id: BrokerInfo.h,v 1.3.8.1 2010/04/07 12:53:50 mcecchi Exp $
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__

Generated on Mon Feb 4 13:41:45 2013 for glite-wms-brokerinfo-access-3.3.2 by  doxygen 1.4.7