public string NewSession() { if (beagleVersion == 0) { DaemonInformationRequest infoReq = new DaemonInformationRequest(true, false, false, false); DaemonInformationResponse infoResp = (DaemonInformationResponse)infoReq.Send(); beagleVersion = (uint)VersionStringToInt(infoResp.Version); } Session session = new Session(); session.VendorId = "Beagle"; session.VendorVersion = beagleVersion; session.VendorDisplay = "The Beagle desktop search tool"; session.VendorXesam = 90; session.VendorOntologyFields = Ontologies.GetSupportedXesamFields(); session.VendorOntologySources = Ontologies.GetSupportedXesamSources(); session.VendorOntologyContents = Ontologies.GetSupportedXesamContents(); sessions.Add(Convert.ToString(sessionCount), session); if (Debug) { Console.Error.WriteLine("NewSession() -- {0}", sessionCount); } return(Convert.ToString(sessionCount++)); }
public override ResponseMessage Execute(RequestMessage request) { DaemonInformationResponse response = new DaemonInformationResponse(); DaemonInformationRequest req = (DaemonInformationRequest)request; if (req.GetVersion) { response.Version = ExternalStringsHack.Version; } if (req.GetSchedInfo) { response.SchedulerInformation = Scheduler.Global.GetCurrentStatus(); } if (req.GetIndexStatus) { response.IndexStatus = new ArrayList(); foreach (QueryableStatus status in QueryDriver.GetIndexInformation()) { response.IndexStatus.Add(status); } } if (req.GetIsIndexing) { response.IsIndexing = QueryDriver.IsIndexing; } return(response); }
public string[] GetState() { // FIXME: Is there any way to find out if we're doing a FULL_INDEX ? string[] ret = new string[] { null, null }; DaemonInformationRequest infoReq = new DaemonInformationRequest(false, false, true, true); DaemonInformationResponse infoResp = (DaemonInformationResponse)infoReq.Send(); if (!infoResp.IsIndexing) { ret [0] = "IDLE"; ret [1] = ""; } else { ret [0] = "UPDATE"; ret [1] = "0"; // FIXME: We were building total progress percentage as an average of all // Queryables' percentages and this does not work (the Queryables seem to not // set ProgressPercent) } if (Debug) { Console.Error.WriteLine("GetState() -- {0} - {1}", ret [0], ret [1]); } return(ret); }
public override ResponseMessage Execute (RequestMessage request) { DaemonInformationResponse response = new DaemonInformationResponse (); DaemonInformationRequest req = (DaemonInformationRequest) request; if (req.GetVersion) response.Version = ExternalStringsHack.Version; if (req.GetSchedInfo) response.SchedulerInformation = Scheduler.Global.GetCurrentStatus (); if (req.GetIndexStatus) { response.IndexStatus = new ArrayList (); foreach (QueryableStatus status in QueryDriver.GetIndexInformation ()) response.IndexStatus.Add (status); } if (req.GetIsIndexing) response.IsIndexing = QueryDriver.IsIndexing; return response; }