ROOT » NET » HTTP » THttpServer

class THttpServer: public TNamed


THttpCallArg

Contains arguments for single HTTP call
Must be used in THttpEngine to process incoming http requests


Function Members (Methods)

public:
virtual~THttpServer()
voidTObject::AbstractMethod(const char* method) const
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTNamed::Clear(Option_t* option = "")
virtual TObject*TNamed::Clone(const char* newname = "") const
virtual Int_tTNamed::Compare(const TObject* obj) const
virtual voidTNamed::Copy(TObject& named) const
Bool_tCreateEngine(const char* engine)
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
Bool_tExecuteHttp(THttpCallArg* arg)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual voidTNamed::FillBuffer(char*& buffer)
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual const char*TObject::GetIconName() const
static const char*GetMimeType(const char* path)
virtual const char*TNamed::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
TRootSniffer*GetSniffer() const
virtual const char*TNamed::GetTitle() const
const char*GetTopName() const
virtual UInt_tTObject::GetUniqueID() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTNamed::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
Bool_tIsFileRequested(const char* uri, TString& res) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
Bool_tIsReadOnly() const
virtual Bool_tTNamed::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidTNamed::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual Bool_tTObject::Notify()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
voidTObject::operator delete(void* ptr)
voidTObject::operator delete(void* ptr, void* vp)
voidTObject::operator delete[](void* ptr)
voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
THttpServer&operator=(const THttpServer&)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidTNamed::Print(Option_t* option = "") const
voidProcessRequests()
virtual Int_tTObject::Read(const char* name)
static char*ReadFileContent(const char* filename, Int_t& len)
virtual voidTObject::RecursiveRemove(TObject* obj)
Bool_tRegister(const char* subfolder, TObject* obj)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
virtual voidTNamed::SetName(const char* name)MENU
virtual voidTNamed::SetNameTitle(const char* name, const char* title)
static voidTObject::SetObjectStat(Bool_t stat)
voidSetReadOnly(Bool_t readonly)
voidSetSniffer(TRootSniffer* sniff)
voidSetTimer(Long_t milliSec = 100, Bool_t mode = kTRUE)
virtual voidTNamed::SetTitle(const char* title = "")MENU
voidSetTopName(const char* top)
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector& insp) const
virtual Int_tTNamed::Sizeof() const
virtual voidStreamer(TBuffer&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
THttpServer(const char* engine = "civetweb:8080")
THttpServer(const THttpServer&)
Bool_tUnregister(TObject* obj)
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
protected:
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()
virtual voidProcessRequest(THttpCallArg* arg)
static Bool_tVerifyFilePath(const char* fname)

Data Members

public:
static TObject::(anonymous)TObject::kBitMask
static TObject::EStatusBitsTObject::kCanDelete
static TObject::EStatusBitsTObject::kCannotPick
static TObject::EStatusBitsTObject::kHasUUID
static TObject::EStatusBitsTObject::kInvalidObject
static TObject::(anonymous)TObject::kIsOnHeap
static TObject::EStatusBitsTObject::kIsReferenced
static TObject::EStatusBitsTObject::kMustCleanup
static TObject::EStatusBitsTObject::kNoContextMenu
static TObject::(anonymous)TObject::kNotDeleted
static TObject::EStatusBitsTObject::kObjInCanvas
static TObject::(anonymous)TObject::kOverwrite
static TObject::(anonymous)TObject::kSingleKey
static TObject::(anonymous)TObject::kWriteDelete
static TObject::(anonymous)TObject::kZombie
protected:
TListfCallArgs! submitted arguments
TStringfDefaultPage! file name for default page name
TStringfDefaultPageCont! content of the file content
TStringfDrawPage! file name for drawing of single element
TStringfDrawPageCont! content of draw page
TListfEngines! engines which runs http server
TStringfJsRootSys! location of JSROOT files
Long_tfMainThrdId! id of the main ROOT process
TMutexfMutex! mutex to protect list with arguments
TStringTNamed::fNameobject identifier
TRootSniffer*fSniffer! sniffer provides access to ROOT objects hierarchy
THttpTimer*fTimer! timer used to access main thread
TStringTNamed::fTitleobject title
TStringfTopName! name of top folder, default - "ROOT"

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

THttpServer(const char* engine = "civetweb:8080")
 constructor
~THttpServer()
 destructor
 delete all http engines and sniffer
void SetSniffer(TRootSniffer* sniff)
 Set TRootSniffer to the server
 Server takes ownership over sniffer
Bool_t IsReadOnly() const
 returns read-only mode
void SetReadOnly(Bool_t readonly)
 Set read-only mode for the server (default on)
 In read-only server is not allowed to change any ROOT object, registered to the server
 Server also cannot execute objects method via exe.json request
Bool_t CreateEngine(const char* engine)
 factory method to create different http engines
 At the moment two engine kinds are supported:
  civetweb (default) and fastcgi
 Examples:
   "civetweb:8080" or "http:8080" or ":8080" - creates civetweb web server with http port 8080
   "fastcgi:9000" - creates fastcgi server with port 9000
   "dabc:1237"    - create DABC server with port 1237 (only available with DABC installed)
   "dabc:master_host:port" - attach to DABC master, running on master_host:port (only available with DABC installed)
void SetTimer(Long_t milliSec = 100, Bool_t mode = kTRUE)
 create timer which will invoke ProcessRequests() function periodically
 Timer is required to perform all actions in main ROOT thread
 Method arguments are the same as for TTimer constructor
 By default, sync timer with 100 ms period is created

 If milliSec == 0, no timer will be created.
 In this case application should regularly call ProcessRequests() method.
Bool_t VerifyFilePath(const char* fname)
 Checked that filename does not contains relative path below current directory
 Used to prevent access to files below current directory
Bool_t IsFileRequested(const char* uri, TString& res) const
 Verifies that request is just file name
 File names typically contains prefix like "jsrootsys/"
 If true, method returns real name of the file,
 which should be delivered to the client
 Method is thread safe and can be called from any thread
Bool_t ExecuteHttp(THttpCallArg* arg)
 Executes http request, specified in THttpCallArg structure
 Method can be called from any thread
 Actual execution will be done in main ROOT thread, where analysis code is running.
void ProcessRequests()
 Process requests, submitted for execution
 Regularly invoked by THttpTimer, when somewhere in the code
 gSystem->ProcessEvents() is called.
 User can call serv->ProcessRequests() directly, but only from main analysis thread.
void ProcessRequest(THttpCallArg* arg)
 Process single http request
 Depending from requested path and filename different actions will be performed.
 In most cases information is provided by TRootSniffer class
Bool_t Register(const char* subfolder, TObject* obj)
 Register object in folders hierarchy

 See TRootSniffer::RegisterObject() for more details
Bool_t Unregister(TObject* obj)
 Unregister object in folders hierarchy

 See TRootSniffer::UnregisterObject() for more details
const char * GetMimeType(const char* path)
 Returns MIME type base on file extension
char* ReadFileContent(const char* filename, Int_t& len)
 reads file content
void SetTopName(const char* top)
 these methods used to set http request arguments
const char * GetTopName() const
 returns engine-specific top-name
THttpServer(const char* engine = "civetweb:8080")
TRootSniffer * GetSniffer() const