|
xrootd
|
00001 #ifndef __CMS_CLIENT__ 00002 #define __CMS_CLIENT__ 00003 /******************************************************************************/ 00004 /* */ 00005 /* X r d C m s C l i e n t . h h */ 00006 /* */ 00007 /* (c) 2007 by the Board of Trustees of the Leland Stanford, Jr., University */ 00008 /* All Rights Reserved */ 00009 /* Produced by Andrew Hanushevsky for Stanford University under contract */ 00010 /* DE-AC02-76-SFO0515 with the Department of Energy */ 00011 /******************************************************************************/ 00012 00013 class XrdOucEnv; 00014 class XrdOucErrInfo; 00015 class XrdOucLogger; 00016 struct XrdSfsPrep; 00017 00018 // The following return conventions are use by Forward(), Locate(), & Prepare() 00019 // 00020 // Return Val Resp.errcode Resp.errtext 00021 // --------- ------------------- -------- 00022 // -EREMOTE port (0 for default) Host name 00023 // -EINPROGRESS n/a n/a 00024 // -EEXIST Length of errtext Data to be returned to client as response 00025 // > 0 Wait time (= retval) Reason for wait 00026 // < 0 Error number Error message 00027 // = 0 Not applicable Not applicable (see below) 00028 // Forward() -> Request forwarded 00029 // Locate() -> Redirection does not apply 00030 // Prepare() -> Request submitted 00031 // 00032 00033 class XrdCmsClient 00034 { 00035 public: 00036 virtual void Added(const char *path, int Pend=0) = 0; 00037 00038 virtual int Configure(char *cfn, XrdOucEnv *EnvInfo) = 0; 00039 00040 virtual int Forward(XrdOucErrInfo &Resp, const char *cmd, 00041 const char *arg1=0, const char *arg2=0, 00042 const char *arg3=0, const char *arg4=0) = 0; 00043 00044 virtual int isRemote() {return myPersona == XrdCmsClient::amRemote;} 00045 00046 virtual int Locate(XrdOucErrInfo &Resp, const char *path, int flags, 00047 XrdOucEnv *Info=0) = 0; 00048 00049 virtual int Prepare(XrdOucErrInfo &Resp, XrdSfsPrep &pargs) = 0; 00050 00051 virtual void Removed(const char *path) = 0; 00052 00053 virtual int Space(XrdOucErrInfo &Resp, const char *path) = 0; 00054 00055 enum Persona {amLocal, amProxy, amRemote, amTarget}; 00056 00057 XrdCmsClient(Persona acting) {myPersona = acting;} 00058 virtual ~XrdCmsClient() {} 00059 00060 protected: 00061 00062 Persona myPersona; 00063 }; 00064 #endif
1.7.5