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);
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.
XrdProofdProtocol * P() 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.
void SkipSessionsCheck(std::list< XrdProofdProofServ * > *active, XrdOucString &emsg, XrdProofdResponse *r=0)
Skip the next sessions status check.
XrdSysRecMutex * Mutex() const
std::vector< XrdClientID * > fClients
XrdProofdClient * C() 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)
bool VerifySession(XrdProofdProofServ *xps, XrdProofdResponse *r=0)
Quick verification of session 'xps' to avoid attaching clients to non responding sessions.
unsigned short Sid() const
int Touch(bool reset=0)
Send a touch the connected clients: this will remotely touch the associated TSocket instance and sche...
XrdProofdSandbox * Sandbox() const
void TerminateSessions(int srvtype, XrdProofdProofServ *ref, const char *msg, XrdProofdPipe *pipe, bool changeown)
Terminate client sessions; IDs of signalled processes are added to sigpid.
const char * AdminPath() const
XrdProofdSandbox fSandbox
int GetTopServers()
Return the number of valid proofserv topmaster sessions in the list.
const char * Group() const
XrdProofdProtocol * GetProtocol(int ic)
Return protocol attached to client slot at 'ic'.
void EraseServer(int psid)
Erase server with id psid from the list.
const char * User() const
XrdProofdResponse * R() 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)
XrdProofdClient * Client() const
void ResetSessions()
Reset this instance.
int SetClientID(int cid, XrdProofdProtocol *p)
Set slot cid to instance 'p'.