/// <summary> /// Return an LLSD-serializable Hashtable describing the /// capabilities and their handler details. /// </summary> /// <param name="excludeSeed">If true, then exclude the seed cap.</param> public Hashtable GetCapsDetails(bool excludeSeed) { Hashtable caps = new Hashtable(); string baseUrl = m_httpListener.ServerURI; lock (m_capsHandlers) { foreach (string capsName in m_capsHandlers.Keys) { if (excludeSeed && "SEED" == capsName) { continue; } CapsHandler handler = m_capsHandlers[capsName]; if (handler.HandlerIsExternal) { caps[capsName] = handler.ExternalHandlerURL; } else { IRequestHandler reqHandler = handler.RequestHandler; caps[capsName] = baseUrl + reqHandler.Path; } } } return(caps); }
/// <summary> /// Registers an external handler that also can respond to pause and resume commands /// </summary> /// <param name="capsName"></param> /// <param name="url"></param> /// <param name="pauseTrafficHandler"></param> /// <param name="resumeTrafficHandler"></param> public void RegisterHandler(string capsName, string url, Action pauseTrafficHandler, Action resumeTrafficHandler, Action <int> setMaxBandwidthHandler) { var handler = new CapsHandler(capsName, url, true); handler.PauseTrafficHandler = pauseTrafficHandler; handler.ResumeTrafficHandler = resumeTrafficHandler; handler.MaxBandwidthHandler = setMaxBandwidthHandler; m_capsHandlers[capsName] = handler; }
/// <summary> /// Registers an external handler that also can respond to pause and resume commands /// </summary> /// <param name="capsName"></param> /// <param name="url"></param> /// <param name="pauseTrafficHandler"></param> /// <param name="resumeTrafficHandler"></param> public void RegisterHandler(string capsName, string url, Action pauseTrafficHandler, Action resumeTrafficHandler, Action<int> setMaxBandwidthHandler) { var handler = new CapsHandler(capsName, url, true); handler.PauseTrafficHandler = pauseTrafficHandler; handler.ResumeTrafficHandler = resumeTrafficHandler; handler.MaxBandwidthHandler = setMaxBandwidthHandler; m_capsHandlers[capsName] = handler; }
/// <summary> /// Register an external handler. The service for this capability is somewhere else /// given by the URL. /// </summary> /// <param name="capsName"></param> /// <param name="url"></param> public void RegisterHandler(string capsName, string url) { m_capsHandlers[capsName] = new CapsHandler(capsName, url, false); }
/// <summary> /// Register a handler. This allows modules to register handlers. /// </summary> /// <param name="capName"></param> /// <param name="handler"></param> public void RegisterHandler(string capName, IRequestHandler handler) { m_capsHandlers[capName] = new CapsHandler(capName, handler, false); //m_log.DebugFormat("[CAPS]: Registering handler for \"{0}\": path {1}", capName, handler.Path); }