Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

ReplicaOptimizationImpl.h

Go to the documentation of this file.
00001 /* -*- C++ -*-
00002  *
00003  * ReplicaOptimizationImpl.h
00004  *
00005  * Copyright (c) 2002 CERN on behalf of the EU DataGrid.
00006  * For license conditions see LICENSE file or 
00007  * http://www.edg.org/license.html
00008  *
00009  * $Id: ReplicaOptimizationImpl.h,v 1.16 2004/05/05 08:55:23 jamesc Exp $
00010  */
00011 
00012 
00013 #ifndef ReplicaOptimizationImpl_H
00014 #define ReplicaOptimizationImpl_H 1
00015 
00022 #include <string>
00023 
00024 #include "EdgReplicaOptimization/ReplicaOptimization.h"
00025 #include "edg_gsoap_baseH.h"
00026 
00027 namespace EdgReplicaOptimization
00028 {
00029 
00033   class ReplicaOptimizationImpl : public ReplicaOptimization
00034   {
00035     
00036   public:
00037                         
00055     ReplicaOptimizationImpl(const std::string& url,
00056                             int timeOut=30
00057 #ifdef WITH_WP2_SECURITY
00058                             ,char *passphrase = NULL,
00059                             char *credentials = NULL,
00060                             char *cacertdir = NULL,
00061                             char *rseedfile = NULL,
00062                             char *role = NULL,
00063                             char *policy = NULL,
00064                             char *defrole = NULL,
00065                             char *defpolicy = NULL
00066 #endif
00067                             );
00068 
00069 #ifdef WITH_WP2_SECURITY
00070 
00071     int addRoleAndPolicy(char *role,
00072                          char *policy,
00073                          char *defaultrole,
00074                          char *defaultpolicy);
00075       
00076     void clearRoleAndPolicy();
00077 
00078 #endif
00079 
00081     virtual ~ReplicaOptimizationImpl();
00082                         
00083     virtual const std::string& getUrl() const;
00084                         
00085     virtual bool ping();
00086                         
00090     virtual const std::string getVersion() const
00091       throw(CommunicationException);
00092                         
00096     virtual const std::string getInterfaceVersion() const
00097       throw(CommunicationException);
00098 
00099     virtual void getAccessCost(ROSFiles_t                        &files, 
00100                                ROSComputingElements_t  &ce, 
00101                                Protocols_t             &protocol,
00102                                AccessCosts_t                 &accessCost);
00103                           
00104     virtual void
00105     getBestNetworkCost(ROSFile                &file,
00106                        std::string      &destinationSE,
00107                        BestNetworkCost  &networkCost );
00108                         
00109   private:
00110                         
00111     void
00112     dump_soap_error(int ret, const struct soap* const_soap) const;
00113                         
00114     void
00115     handleGenericFaults(int ret, const struct soap* soap) const;
00116                         
00117     const char* endpoint() const;
00118                         
00119     struct soap* soap() const;
00120                         
00121                         
00122     //
00123     // member variables
00124     //
00125     const std::string m_endpoint;
00126     struct soap*      m_soap;
00127                         
00128   };
00129 }
00130 
00131 #endif // ReplicaOptimizationImpl_H
00132 
The EU DataGrid Project. All rights reserved.