12 #ifndef ROOT_XrdProofdClient 13 #define ROOT_XrdProofdClient 30 #include "XrdOuc/XrdOucString.hh" 37 #define XPC_DEFMAXOLDLOGS 10 54 bool Match(
const char *usr,
const char *grp = 0);
92 int Touch(
bool reset = 0);
137 { fP =
pt; fSid =
id; SetR(); fResetTime = -1; }
144 void Reset() { fP = 0; fSid = 0; SetR(); fResetTime = time(0); }
147 void SetSid(
unsigned short sid) { fSid = sid; SetR();}
148 unsigned short Sid()
const {
return fSid; }
XrdSysRecMutex * Mutex() const
int GetClientID(XrdProofdProtocol *p)
Get next free client ID.
virtual ~XrdProofdClient()
Destructor.
int ResetClientSlot(int ic)
Reset slot at 'ic'.
int ReserveClientID(int cid)
Reserve a client ID.
const char * Group() const
XrdClientID(XrdProofdProtocol *pt=0, unsigned short id=0)
int TrimSessionDirs()
If the static fgMaxOldLogs > 0, logs for a fgMaxOldLogs number of sessions are kept in the sandbox; w...
void SetGroup(const char *g)
void SetSid(unsigned short sid)
XrdProofdProofServ * GetServObj(int id)
Get server at 'id'. If needed, increase the vector size.
XrdProofdClient * C() const
XrdProofdProtocol * P() const
const char * AdminPath() const
std::vector< XrdClientID * > fClients
const char * User() const
XrdOucString ExportSessions(XrdOucString &emsg, XrdProofdResponse *r=0)
Return a string describing the existing sessions.
bool Match(const char *usr, const char *grp=0)
return TRUE if this instance matches 'id' (and 'grp', if defined)
void Broadcast(const char *msg)
Broadcast message 'msg' to the connected clients.
XrdProofdClient(XrdProofUI ui, bool master, bool changeown, XrdSysError *edest, const char *tmp, int rtime)
Constructor.
XrdProofdResponse * Response(kXR_unt16 rid)
Get response instance corresponding to stream ID 'sid'.
int changeown(const std::string &path, uid_t u, gid_t g)
Change the ownership of 'path' to the entity described by {u,g}.
void SetP(XrdProofdProtocol *p)
XrdProofdSandbox * Sandbox() const
bool VerifySession(XrdProofdProofServ *xps, XrdProofdResponse *r=0)
Quick verification of session 'xps' to avoid attaching clients to non responding sessions.
int Touch(bool reset=0)
Send a touch the connected clients: this will remotely touch the associated TSocket instance and sche...
void TerminateSessions(int srvtype, XrdProofdProofServ *ref, const char *msg, XrdProofdPipe *pipe, bool changeown)
Terminate client sessions; IDs of signalled processes are added to sigpid.
XrdProofdSandbox fSandbox
int GetTopServers()
Return the number of valid proofserv topmaster sessions in the list.
XrdProofdProtocol * GetProtocol(int ic)
Return protocol attached to client slot at 'ic'.
unsigned short Sid() const
void EraseServer(int psid)
Erase server with id psid from the list.
void SkipSessionsCheck(std::list< XrdProofdProofServ *> *active, XrdOucString &emsg, XrdProofdResponse *r=0)
Skip the next sessions status check.
XrdProofdClient * Client() const
XrdProofdProofServ * GetServer(int psid)
Get from the vector server instance with ID psid.
std::vector< XrdProofdProofServ * > fProofServs
XrdProofdProofServ * GetFreeServObj()
Get next free server ID.
void SetValid(bool valid=1)
XrdProofdResponse * R() const
void ResetSessions()
Reset this instance.
int SetClientID(int cid, XrdProofdProtocol *p)
Set slot cid to instance 'p'.