public void Register(Type type, Jid jid, IXmppHandlerInvoker invoker) { using (locker.WriteLock()) { var id = uniqueId.CreateId(); types.Add(type, id); jids.Add(jid.ToString(), id); handlerIds.Add(invoker.HandlerId, id); handlers.Add(id, invoker); } }
private bool ProcessValidation(IXmppHandlerInvoker i, Element e, XmppSession s, XmppHandlerContext c) { foreach (var validator in i.Validators) { var result = validator.ValidateElement(e, s, c); if (result != null) { ProcessResult(result); return(false); } } return(true); }
public XmppHandlerManager(XmppSessionManager sessionManager, IXmppResolver resolver) { Args.NotNull(sessionManager, "sessionManager"); Args.NotNull(resolver, "resolver"); this.router = new XmppHandlerRouter(); this.sessionManager = sessionManager; this.resolver = resolver; this.context = new XmppHandlerContext(this, resolver); this.defaultHandler = new XmppDefaultHandler(); this.defaultInvoker = new XmppHandlerRouter.Invoker <Element>(defaultHandler.ProcessElement, "DefaultHandler"); this.SupportedAuthMechanisms = new List <Mechanism>(); }