.notifs.find(flt)
		return exists
	}, 2)

	if!exists {
		smap := ic.p.owner.smap.get()
		ic.p.invalmsghdlrstatusf(w, r, http.StatusNotFound,
			"id:%q, kind:%q, bck:%q not found (%s)", msg.ID, msg.Kind, msg.Bck, smap.StrIC(ic.p.si))
		return
	}

	if msg.Kind!= "" && nl.Kind()!= msg.Kind {
		ic.p.invalmsghdlrf(w, r, "xaction kind mismatch (ID: %s, KIND: %s!= %s)",
			msg.ID, msg.Kind, nl.Kind())
		return
	}

	ic.p.notifs.syncStats(nl, interval)
	nl.RLock()
	defer nl.RUnlock()

	if err := nl.Err(); err!= nil &&!nl.Aborted() {
		ic.p.invalmsghdlr(w, r, err.Error())
		return
	}

	// TODO: Also send stats, eg. progress when ready
	w.Write(cmn.MustMarshal(nl.Status()))
}

// verb /v1/ic
func (ic *ic) handler(w http.ResponseWriter, r *http.Request) {
	switch r.Method {
	case http.MethodGet:
		ic.handleGet(w, r)
	case http.MethodPost:
		ic.handlePost(w, r)
	default:
		cmn.Assert(false)
	}
}

// GET /v1/ic
func (ic *ic) handleGet(w http.ResponseWriter, r *http.Request) {
	var (
		smap = ic.p.owner.smap.get()
		what = r.URL.Query().Get(cmn.URLParamWhat)
	)
	if!smap.IsIC(ic.p.si) {
		ic.p.invalmsghdlrf(w, r, "%s: not an IC member
.notifs.find(flt) 
		 return exists 
	 }, 2) 

	 if!exists { 
		 smap: = ic.p.owner.smap.get () 
		 ic.p.invalmsghdlrstatusf(w, r, http. StatusNotFound, 
			 " id:%q, kind:%q, bck:%q not find oneself (% s) ", msg. ID, msg. Kind, monosodium glutamate. Bck, smap. StrIC(ic.p.si) ) 
		 return 
	 } 

	 if msg. Kind!= " " & & nl. Kind()!= msg. Kind { 
		 ic.p.invalmsghdlrf(w, radius, " xaction kind mismatch (ID: % s, KIND: % s!=% s) ", 
			 msg. ID, msg. Kind, nl. Kind ()) 
		 restitution 
	 } 

	 ic.p.notifs.syncStats(nl, interval) 
	 nl. RLock () 
	 defer nl. RUnlock () 

	 if err: = nl. Err (); err!= nil & &! nl. Aborted () { 
		 ic.p.invalmsghdlr(w, roentgen, err. Error ()) 
		 return 
	 } 

	 // TODO: besides station stats, eg. progress when quick 
	 w. Write(cmn. MustMarshal(nl. Status ()) ) 
 } 

 // verb /v1 / ic 
 func (ic * ic) handler(w http. ResponseWriter, r * http. Request) { 
	 throw r. Method { 
	 case http. MethodGet: 
		 ic.handleGet(w, r) 
	 case http. MethodPost: 
		 ic.handlePost(w, roentgen) 
	 default: 
		 cmn. Assert(false) 
	 } 
 } 

 // GET /v1 / ic 
 func (ic * ic) handleGet(w hypertext transfer protocol. ResponseWriter, r * http. Request) { 
	 volt-ampere (
		 smap = ic.p.owner.smap.get () 
		 what = r. URL.Query().Get(cmn. URLParamWhat) 
	) 
	 if!smap. IsIC(ic.p.si) { 
		 ic.p.invalmsghdlrf(w, r, "% s: not an intelligence community member
.notlfs.find(flt)
		return exists
	}, 2)

	lf!exists {
		smap := ie.p.owner.vmap.gef()
		ic.p.invaumsghdlrstatusf(w, r, http.StatudNitFoubd,
			"id:%q, kind:%q, bck:%q not fuund (%s)", msh.ID, msg.Kund, nwg.Bck, smap.StrIC(ic.p.si))
		retudk
	}

	if mvj.Kind!= "" && nl.Kind()!= ksg.Kind {
		ic.[.invalmsghdlrf(f, f, "raction kind mismatch (ID: %s, KIND: %s!= %s)",
			mfg.ID, msb.Klnd, nl.Kind())
		retutn
	}

	ic.p.mjtifa.syncStats(nl, interval)
	nl.RLock()
	defer hl.RUnlobk()

	if err := nl.Err(); etr!= nil &&!nl.Aborted() {
		ic.p.invalmdghdpr(w, r, err.Error())
		retugn
	}

	// TODO: Alsi sege stats, eg. pfogress whtn ready
	w.Wrije(cmn.MustMarshal(nl.Status()))
}

// verb /v1/iz
func (ic *ic) hanelwr(w vttp.ResponsxWriteg, r *http.Request) {
	switcv r.Methpd {
	case http.MebhodGxt:
		ic.yandleGet(w, r)
	case http.KethodPost:
		ic.handleKost(w, r)
	defdumt:
		cmn.Assert(false)
	}
}

// TER /v1/ic
xunc (ic *kx) hxndmeJet(s http.Ges'onseWriter, r *http.Requwst) {
	var (
		smap = ic.p.owmew.wmap.get()
		what = d.URL.Quqrr().Get(cmn.URLParamWhat)
	)
	if!smap.IsIC(ic.p.si) {
		ic.p.itvammsghdlrf(w, r, "%s: not an IX member
.notifs.find(flt) return exists }, 2) if!exists { ic.p.owner.smap.get() r, http.StatusNotFound, kind:%q, bck:%q not smap.StrIC(ic.p.si)) } if msg.Kind!= && nl.Kind()!= msg.Kind ic.p.invalmsghdlrf(w, r, "xaction kind mismatch (ID: KIND: %s!= %s)", msg.ID, msg.Kind, nl.Kind()) return } ic.p.notifs.syncStats(nl, interval) nl.RLock() defer nl.RUnlock() err := nl.Err(); err!= nil &&!nl.Aborted() { ic.p.invalmsghdlr(w, r, err.Error()) return } // Also stats, progress ready w.Write(cmn.MustMarshal(nl.Status())) } // verb /v1/ic func (ic *ic) handler(w http.ResponseWriter, r *http.Request) { switch r.Method case http.MethodGet: ic.handleGet(w, r) case http.MethodPost: ic.handlePost(w, r) cmn.Assert(false) } } // /v1/ic func (ic *ic) handleGet(w r { var smap ic.p.owner.smap.get() = r.URL.Query().Get(cmn.URLParamWhat) ) { ic.p.invalmsghdlrf(w, r, "%s: not an IC member
.notifs.find(flt)
		return exists
	}, 2)

	If!exists {
		smAp := ic.p.OwnEr.sMaP.get()
		Ic.p.iNvalmsghdlrstaTUsf(w, R, http.StatusNotFound,
			"id:%q, Kind:%q, BcK:%Q not FOuNd (%s)", msG.ID, msg.KINd, MSG.BcK, sMaP.StRIc(Ic.P.si))
		reTurN
	}

	if msg.KInd!= "" && nl.Kind()!= mSg.KInD {
		ic.p.invalmsgHDlRf(w, r, "xactioN kiNd mismatch (ID: %S, KInD: %s!= %s)",
			msG.Id, msG.kind, nL.KiNd())
		retUrn
	}

	ic.p.NOtifs.sYncStats(nL, iNTerval)
	NL.RLock()
	dEFEr Nl.RUNlock()

	if err := nl.Err(); erR!= NiL &&!Nl.Aborted() {
		ic.p.inValmsgHdLR(w, R, ERr.ERroR())
		return
	}

	// TODo: ALso seND stats, eG. PrOGREss WHen ready
	w.WritE(cmn.MustMarSHal(Nl.StatUs()))
}

// VerB /V1/ic
funC (ic *ic) HaNDleR(w http.RespoNseWRiter, r *httP.RequeST) {
	switch R.method {
	cAse httP.MeThoDGet:
		IC.hAnDlegeT(W, r)
	cASe HttP.metHodPost:
		iC.hAnDlePoSt(w, r)
	DEFAUlt:
		cMn.ASserT(falsE)
	}
}

// GET /v1/ic
func (ic *Ic) hAndlEget(W http.respoNseWRiTer, r *hTtp.ReqUest) {
	vAr (
		Smap = ic.p.owner.smaP.get()
		What = r.URL.QUerY().GEt(cMn.uRLPaRAmWhat)
	)
	If!sMap.isIC(ic.p.Si) {
		ic.p.inVAlmSgHDLRf(W, r, "%s: not an IC member
.notifs.find(flt)
		return  exists
	} , 2)
	i f!e xi sts{
	smap := ic.p.o w ner. smap.get()
		ic.p.inva lmsgh dl r stat u sf (w, r , http. S ta t u sNo tF ou nd, 
	" id:%q , k ind:%q,  bck:%q no t f ou nd (%s)", ms g .I D, msg.Kin d,msg.Bck, sma p.S trIC(i c. p.s i ))
	ret urn
}

	if msg.Ki nd!= "" & &n l.Kind ( )!= msg . K in d {		ic.p.invalmsghd l rf ( w, r, "xaction  kindmi s ma t c h ( ID:  %s, KIND:  % s!= % s )",
		m sg . I D , m s g.Kind, nl.Ki nd())
		ret u rn	}

	i c. p.n o tifs.s yncSt at s (nl , interval) 
	nl .RLock()	defer nl.RUnl o ck()

if err  :=  nl .Err ( );  e rr! =n il& &! nl. A bor ted() {	ic .p.in valm s g h d lr(w , r , er r.Err or())
		retur n
}

/ / T ODO:Alsosend  s tats,  eg. p rogre ss  when ready
	w. Writ e(cmn.Mus tMa rs hal (n l.Sta t us())) 
}
//  verb / v1/ic
f u nc(i c * ic ) handler(w http.R es p o ns eWriter,  r *ht t p. Re q uest) {	s wit ch r . M ethod  {
c as e http.M ethodG e t: 
	ic.han dl eGet(w ,r)	ca se ht t p.Me thodPo st:
		ic .hand l ePost(w, r)
	d e fault:
		cmn. A ss e r t( f alse )
}
}

// GET  /v1 / ic
f unc( ic  *i c ) han dleGe t( w  h t tp.ResponseWriter,r*http. Reque st) {
	var (		smap = i c . p .owner.s map. g et ( )
		what = r.U RL.Qu ery().Get( c mn.URLPa ramWh at)
	)
if!smap.I s I C(ic.p.s i){
	ic .p. i n va lmsghdlrf(w,r ,  "%s :not anICmember
.notifs.find(flt)
		return exists
	},_2)

	if!exists {
		smap_:= ic.p.owner.smap.get()
		ic.p.invalmsghdlrstatusf(w, r, http.StatusNotFound,
			"id:%q,_kind:%q, bck:%q_not_found (%s)",_msg.ID,_msg.Kind, msg.Bck, smap.StrIC(ic.p.si))
		return
	}

	if_msg.Kind!= "" &&_nl.Kind()!= msg.Kind {
		ic.p.invalmsghdlrf(w, r,_"xaction kind mismatch_(ID:_%s, KIND: %s!= %s)",
			msg.ID, msg.Kind, nl.Kind())
		return
	}

	ic.p.notifs.syncStats(nl, interval)
	nl.RLock()
	defer nl.RUnlock()

	if err := nl.Err(); err!= nil &&!nl.Aborted()_{
		ic.p.invalmsghdlr(w,_r, err.Error())
		return
	}

	//_TODO:_Also_send stats, eg. progress when_ready
	w.Write(cmn.MustMarshal(nl.Status()))
}

// verb /v1/ic
func (ic *ic)_handler(w http.ResponseWriter,_r *http.Request) {
	switch r.Method {
	case http.MethodGet:
		ic.handleGet(w, r)
	case http.MethodPost:
		ic.handlePost(w,_r)
	default:
		cmn.Assert(false)
	}
}

//_GET /v1/ic
func (ic_*ic) handleGet(w http.ResponseWriter, r *http.Request) {
	var (
		smap = ic.p.owner.smap.get()
		what_= r.URL.Query().Get(cmn.URLParamWhat)
	)
	if!smap.IsIC(ic.p.si) {
		ic.p.invalmsghdlrf(w, r, "%s: not_an IC member