12#ifndef ROOT_XrdProofdProofServ
13#define ROOT_XrdProofdProofServ
18#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__APPLE__)
29#include "Xrd/XrdLink.hh"
30#include "XrdOuc/XrdOucHash.hh"
54 if (dup && bp && sz > 0) {
104#define kXPROOFSRVTAGMAX 64
105#define kXPROOFSRVALIASMAX 256
124 int shutopt,
int shutdel,
bool changeown,
int &nc);
141 inline short int ID()
const { XrdSysMutexHelper mhp(
fMutex);
return fID; }
145 inline bool Match(
short int id)
const { XrdSysMutexHelper mhp(
fMutex);
return (
id ==
fID); }
151 inline std::list<XrdProofQuery *> *
Queries()
const
152 {
return (std::list<XrdProofQuery *> *)&
fQueries; }
161 int SendData(
int cid,
void *buff,
int len);
195 inline const char *
Tag()
const { XrdSysMutexHelper mhp(
fMutex);
return fTag.c_str(); }
199 inline XrdOucHash<XrdProofWorker> *
Workers()
const
200 { XrdSysMutexHelper mhp(
fMutex);
return (XrdOucHash<XrdProofWorker> *)&
fWorkers; }
256 { XrdSysMutexHelper mhp(
fMutex);
fPingSem =
new XrdSysSemWait(0);}
XrdProofQuery(const char *t, const char *n="", long s=0)
XrdSrvBuffer * StartMsg() const
int BroadcastPriority(int priority)
Broadcast a new group priority value to the worker servers.
int Resume()
Send a resume message to the this session.
XrdOucHash< XrdProofWorker > fWorkers
int Enqueue(XrdProofQuery *q)
const char * Client() const
void SetIdle()
Set status to idle and update the related time stamp.
void ClearWorkers()
Decrease worker counters and clean-up the list.
void SetPLiteNWrks(int n)
void AddWorker(const char *o, XrdProofWorker *w)
Add a worker assigned to this session with label 'o'.
void SetOrdinal(const char *o)
void RemoveQuery(const char *tag)
remove query with tag form the list of queries
void SetGroup(const char *g)
void DeleteUNIXSock()
Delete the current UNIX socket.
void SetClient(const char *c)
void SetValid(bool valid=1)
XrdProofdResponse * Response() const
void SetTag(const char *t)
const char * AdminPath() const
void SetConnection(XrdProofdResponse *r)
int DisconnectTime()
Return the time (in secs) all clients have been disconnected.
std::list< XrdProofQuery * > fQueries
XrdOucHash< XrdProofWorker > * Workers() const
void ExportBuf(XrdOucString &buf)
Fill buf with relevant info about this session.
void SetProtocol(XrdProofdProtocol *p)
XrdProofdProofServ()
Constructor.
const char * Ordinal() const
XrdClientID * GetClientID(int cid)
Get instance corresponding to cid.
const char * UserEnvs() const
int CreateUNIXSock(XrdSysError *edest)
Create UNIX socket for internal connections.
const char * Alias() const
int SendData(int cid, void *buff, int len)
Send data to client cid.
int VerifyProofServ(bool fw)
Check if the associated proofserv process is alive.
std::list< XrdProofQuery * > * Queries() const
const char * UNIXSockPath() const
int TerminateProofServ(bool changeown)
Terminate the associated process.
int FreeClientID(int pid)
Free instance corresponding to protocol connecting process 'pid'.
int SendDataN(void *buff, int len)
Send data over the open client links of this session.
int SetAdminPath(const char *a, bool assert, bool setown)
Set the admin path and make sure the file exists.
void SetFileout(const char *f)
XrdProofQuery * GetQuery(const char *tag)
Get query with tag form the list of queries.
void SetUserEnvs(const char *t)
XrdOucString fUNIXSockPath
const char * Group() const
void SendClusterInfo(int nsess, int nacti)
Calculate the effective number of users on this session nodes and communicate it to the master togeth...
void SetAlias(const char *a)
bool Match(short int id) const
XrdProofdProtocol * fProtocol
void ExportWorkers(XrdOucString &wrks)
Export the assigned workers in the format understood by proofserv.
int GetNClients(bool check)
Get the number of connected clients.
void DumpQueries()
Export the assigned workers in the format understood by proofserv.
void Reset()
Reset this instance.
void SetUNIXSockPath(const char *s)
~XrdProofdProofServ()
Destructor.
void Broadcast(const char *msg, int type=kXPD_srvmsg)
Broadcast message 'msg' at 'type' to the attached clients.
std::vector< XrdClientID * > fClients
int IdleTime()
Return the time (in secs) the session has been idle.
XrdProofQuery * CurrentQuery()
XrdNet * UNIXSock() const
void SetStartMsg(XrdSrvBuffer *sm)
XrdProofdResponse * fResponse
bool SkipCheck()
Return the value of fSkipCheck and reset it to false.
void RemoveWorker(const char *o)
Release worker assigned to this session with label 'o'.
XrdClientID * Parent() const
void SetRunning()
Set status to running and reset the related time stamp.
void SetParent(XrdClientID *cid)
const char * Fileout() const
int CheckSession(bool oldvers, bool isrec, int shutopt, int shutdel, bool changeown, int &nc)
Calculate the effective number of users on this session nodes and communicate it to the master togeth...
XrdProofdProtocol * Protocol() const
XrdSrvBuffer(char *bp=0, int sz=0, bool dup=0)
int changeown(const std::string &path, uid_t u, gid_t g)
Change the ownership of 'path' to the entity described by {u,g}.