No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

xep-0060.xml 369KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223
  1. <?xml version='1.0' encoding='UTF-8'?>
  2. <!DOCTYPE xep SYSTEM 'xep.dtd' [
  3. <!ENTITY % ents SYSTEM 'xep.ent'>
  4. %ents;
  5. <!ENTITY ITEM "&lt;item/&gt;">
  6. <!ENTITY ITEMS "&lt;items/&gt;">
  7. <!ENTITY PUBSUB "&lt;pubsub/&gt;">
  8. ]>
  9. <?xml-stylesheet type='text/xsl' href='xep.xsl'?>
  10. <xep>
  11. <header>
  12. <title>Publish-Subscribe</title>
  13. <abstract>This specification defines an XMPP protocol extension for generic publish-subscribe functionality. The protocol enables XMPP entities to create nodes (topics) at a pubsub service and publish information at those nodes; an event notification (with or without payload) is then broadcasted to all entities that have subscribed to the node. Pubsub therefore adheres to the classic Observer design pattern and can serve as the foundation for a wide variety of applications, including news feeds, content syndication, rich presence, geolocation, workflow systems, network management systems, and any other application that requires event notifications.</abstract>
  14. &LEGALNOTICE;
  15. <number>0060</number>
  16. <status>Draft</status>
  17. <type>Standards Track</type>
  18. <sig>Standards</sig>
  19. <dependencies>
  20. <spec>XMPP Core</spec>
  21. <spec>XEP-0004</spec>
  22. <spec>XEP-0030</spec>
  23. <spec>XEP-0059</spec>
  24. <spec>XEP-0068</spec>
  25. <spec>XEP-0082</spec>
  26. <spec>XEP-0131</spec>
  27. </dependencies>
  28. <supersedes/>
  29. <supersededby/>
  30. <shortname>pubsub</shortname>
  31. <schemaloc>
  32. <ns>pubsub</ns>
  33. <url>http://xmpp.org/schemas/pubsub.xsd</url>
  34. </schemaloc>
  35. <schemaloc>
  36. <ns>pubsub#errors</ns>
  37. <url>http://xmpp.org/schemas/pubsub-errors.xsd</url>
  38. </schemaloc>
  39. <schemaloc>
  40. <ns>pubsub#event</ns>
  41. <url>http://xmpp.org/schemas/pubsub-event.xsd</url>
  42. </schemaloc>
  43. <schemaloc>
  44. <ns>pubsub#owner</ns>
  45. <url>http://xmpp.org/schemas/pubsub-owner.xsd</url>
  46. </schemaloc>
  47. <discuss>pubsub</discuss>
  48. &pgmillard;
  49. &stpeter;
  50. &ralphm;
  51. <revision>
  52. <version>1.15.1</version>
  53. <date>2018-02-02</date>
  54. <initials>sc</initials>
  55. <remark>
  56. <p>Add missing "retrieve-default-sub" feature to the XML Schema</p>
  57. </remark>
  58. </revision>
  59. <revision>
  60. <version>1.15.0</version>
  61. <date>2017-12-12</date>
  62. <initials>dg</initials>
  63. <remark>
  64. <ul>
  65. <li>Specify that unregistered publish-options are mapped 1:1 to node configurations</li>
  66. <li>Get rid of per-item OVERRIDE</li>
  67. <li>Get rid of METADATA publish-options</li>
  68. <li>Remove registration for the obsolete pubsub#access_model publish-options</li>
  69. </ul>
  70. </remark>
  71. </revision>
  72. <revision>
  73. <version>1.14</version>
  74. <date>2017-11-29</date>
  75. <initials>jt</initials>
  76. <remark><p>Add pubsub#multi-items to features.</p></remark>
  77. </revision>
  78. <revision>
  79. <version>1.13.8</version>
  80. <date>2017-10-10</date>
  81. <initials>fs (XEP Editor: jwi)</initials>
  82. <remark><p>Add missing dependency on XEP-0059.</p></remark>
  83. </revision>
  84. <revision>
  85. <version>1.13.7</version>
  86. <date>2017-08-24</date>
  87. <initials>egp</initials>
  88. <remark><p>Fix examples using invalid XEP-0082 dates.</p></remark>
  89. </revision>
  90. <revision>
  91. <version>1.13.6</version>
  92. <date>2017-06-22</date>
  93. <initials>dg</initials>
  94. <remark><p>Clarify behaviour of publish-options. Fields must be registered</p></remark>
  95. </revision>
  96. <revision>
  97. <version>1.13.5</version>
  98. <date>2016-12-21</date>
  99. <initials>psa (XEP Editor: ssw)</initials>
  100. <remark><p>Add missing options to schema.</p></remark>
  101. </revision>
  102. <revision>
  103. <version>1.13.4</version>
  104. <date>2016-12-02</date>
  105. <initials>psa</initials>
  106. <remark><p>Make Multiple Simultaneous Modifications examples consistent with text.</p></remark>
  107. </revision>
  108. <revision>
  109. <version>1.13.3</version>
  110. <date>2016-12-08</date>
  111. <initials>ss (XEP Editor: ssw)</initials>
  112. <remark><p>Include publisher with any item retrieval.</p></remark>
  113. </revision>
  114. <revision>
  115. <version>1.13.2</version>
  116. <date>2016-10-11</date>
  117. <initials>ss (XEP Editor: ssw)</initials>
  118. <remark><p>Be more consistent with reply.</p></remark>
  119. </revision>
  120. <revision>
  121. <version>1.13.1</version>
  122. <date>2016-07-21</date>
  123. <initials>ss</initials>
  124. <remark>
  125. <ul>
  126. <li>Fix wording, replace Jabber with XMPP where applicable.</li>
  127. </ul>
  128. </remark>
  129. </revision>
  130. <revision>
  131. <version>1.13</version>
  132. <date>2010-07-12</date>
  133. <initials>psa</initials>
  134. <remark>
  135. <ul>
  136. <li>Pending further discussion: added but then removed change to allow notifications via IQ stanzas; removed but then retained batch publishing; removed but then retained SubIDs in subscription approvals.</li>
  137. <li>Corrected a large number of reported errata.</li>
  138. <li>Removed delete-any feature.</li>
  139. <li>Added missing delete-items feature.</li>
  140. <li>Added special value of "presence" for the pubsub#expire option to support temporary subscriptions.</li>
  141. <li>Removed replyto and replyroom config options.</li>
  142. <li>Removed multiple node discovery since it depended on the deprecated Service Discovery Publishing feature.</li>
  143. <li>Defined "room" value for itemreply config option.</li>
  144. <li>Added optional 'publisher' attribute to &lt;item/&gt; element.</li>
  145. <li>Added optional &lt;redirect/&gt; child to &lt;delete/&gt; element.</li>
  146. <li>Based redirects on URIs for consistency with RFC 6120 gone and redirect errors.</li>
  147. <li>Clarified meaning of filtered notifications (they are based on NodeIDs, not payload namespaces).</li>
  148. <li>Added pubsub-on-a-jid service discovery feature for explicit discovery that an IM and presence account also functions as a virtual pubsub service.</li>
  149. <li>Added purge_offline node configuration option for purging the node when the relevant publisher goes offline, for use in certain extended presence applications.</li>
  150. <li>Added item_expire node configuration option for automatically removing items after a certain number of seconds.</li>
  151. <li>Added notification_type node configuration option for defining which value of the &lt;message/&gt; type attribute shall be used for notifications.</li>
  152. <li>Added retrieve-default-sub feature for retrieving default subscription configuration from a node (as you can retrieve default node configuration from the service).</li>
  153. <li>Clarified suggested rules for payload definitions.</li>
  154. <li>Mentioned that singleton pattern can be enforced by setting max_items to 1.</li>
  155. <li>Removed the notion of batch publishing because it makes information coherence and atom handling excessively difficult.</li>
  156. <li>Added error handling for too-many-subscriptions to help prevent a certain denial of service attack.</li>
  157. <li>Added process for retrieving default subscription configuration options for leaf nodes, by omitting the 'node' attribute on the &lt;default/&gt; element (also added the &lt;default/&gt; element to the schema for the http://jabber.org/protocol/pubsub namespace, since it was missing).</li>
  158. <li>Removed informational mapping of node meta-data to Dublin Core.</li>
  159. </ul>
  160. </remark>
  161. </revision>
  162. <revision>
  163. <version>1.12</version>
  164. <date>2008-09-03</date>
  165. <initials>psa</initials>
  166. <remark>
  167. <ul>
  168. <li>Specified that service should return ItemID on successful publish if no ItemID was provided in request.</li>
  169. <li>Described the use of Result Set Management to return some but not all published items.</li>
  170. <li>Defined pubsub#notify_sub config option so that owners can receive notifications of new subscriptions, unsubscribes, and other subscription changes.</li>
  171. <li>Harmonized definition of +notify feature with implementation reality.</li>
  172. <li>Moved text about collections to XEP-0248.</li>
  173. </ul>
  174. </remark>
  175. </revision>
  176. <revision>
  177. <version>1.11</version>
  178. <date>2008-03-05</date>
  179. <initials>rm/psa</initials>
  180. <remark><p>For collection nodes, changed name of node child element to associate and added disassociate child element to handle disassociation use case; corrected SHIM examples to conform to XEP-0131; modified lease expiry notification for consistency with other subscription-related notifications (i.e., not using SHIM header); renamed SHIM headers to Collection and SubID for consistency with HTTP and Email headers.</p></remark>
  181. </revision>
  182. <revision>
  183. <version>1.10</version>
  184. <date>2007-09-26</date>
  185. <initials>psa</initials>
  186. <remark>
  187. <ul>
  188. <li>In accordance with XMPP Council consensus, moved the auto-create, auto-subscribe, filtered-notifications, and last-published features from XEP-0163 to this specification</li>
  189. <li>Clarified implications of auto-subscribe feature for handling of account owners, stable presence subscribers, and transient presence sharers</li>
  190. <li>Updated filtered-notifications text and examples to track changes to XEP-0115</li>
  191. <li>Added publish-options functionality</li>
  192. <li>Added developer-friendly How It Works section</li>
  193. <li>Defined member affiliation to properly implement whitelist feature</li>
  194. <li>Split several long sections into smaller sub-sections.</li>
  195. <li>Clarified that a pubsub service must generate an ItemID if the publisher does not provide one.</li>
  196. <li>Specified recommended ItemID for singleton nodes.</li>
  197. <li>Summarized triggers for sending notifications.</li>
  198. </ul>
  199. </remark>
  200. </revision>
  201. <revision>
  202. <version>1.9</version>
  203. <date>2006-09-13</date>
  204. <initials>psa</initials>
  205. <remark>
  206. <ul>
  207. <li>Replaced boolean send_item_subscribe node configuration option with more comprehensive send_last_published_item option per list discussion</li>
  208. <li>Added deliver_notifications node configuration option to enable quiet nodes without notifications, if desired enabling pull-model item retrieval only.</li>
  209. <li>Modified subscription and affiliation retrieval to return empty element if no results.</li>
  210. </ul>
  211. </remark>
  212. </revision>
  213. <revision>
  214. <version>1.8</version>
  215. <date>2006-06-27</date>
  216. <initials>psa</initials>
  217. <remark>
  218. <ul>
  219. <li>Defined five access models: open, presence, roster, authorize, and whitelist</li>
  220. <li>Renamed pubsub#subscription_model feature to pubsub#access_model</li>
  221. <li>Separated affiliations retrieval from subscriptions retrieval</li>
  222. <li>Removed subscription information from affiliations management</li>
  223. <li>Changed &lt;entity/&gt; element to &lt;subscription/&gt; element in response to subscription request</li>
  224. <li>Clarified batch processing of item publication and item deletion</li>
  225. <li>Added basic example to introduction</li>
  226. <li>More fully specified node creation flows</li>
  227. <li>More fully specified recommended behavior for caching last published item, including use of jabber:x:delay protocol</li>
  228. <li>Specified that semantic meaning of NodeIDs must not be used to encapsulate hierarchy</li>
  229. <li>More fully specified error conditions</li>
  230. <li>Changed some feature-related conditions to &lt;unsupported/&gt; plus feature attribute</li>
  231. <li>Changed some error conditions from &lt;not-authorized/&gt; to &lt;forbidden/&gt;</li>
  232. <li>Harmonized error conditions for unsubscribe if entity is not subscribed (unexpected-request rather than not-found)</li>
  233. <li>Further defined error conditions related to item publication</li>
  234. <li>Specified structure of &lt;affiliations/&gt;, &lt;delete/&gt;, &lt;purge/&gt;, and &lt;subscriptions/&gt; elements qualified by pubsub#owner namespace</li>
  235. <li>Changed retrieval of default node configuration options to use &lt;default/&gt; element, not &lt;configure/&gt; element</li>
  236. <li>Allowed caching of last published item</li>
  237. <li>Added pubsub#deliver subscription option</li>
  238. <li>Added meta-data fields for pubsub#owners and pubsub#contact</li>
  239. <li>Changed element for retrieval of default node configuration options from &lt;configure/&gt; to &lt;default/&gt; to prevent ambiguity related to configuration of root collection node</li>
  240. <li>Specified pubsub#node_type configuration field</li>
  241. <li>Specified pubsub#collection SHIM header</li>
  242. <li>Specified conformance with Resourceprep for nodes addressable as JIDs</li>
  243. <li>Added pubsub#modify-affiliations feature</li>
  244. <li>Added pubsub#digest_frequency field to subscribe_options FORM_TYPE</li>
  245. <li>Added pubsub#roster_groups_allowed field to node_config FORM_TYPE</li>
  246. <li>More clearly specified the requirements level (MUST, SHOULD, MAY) for each service discovery feature</li>
  247. <li>Defined pubsub#include_body subscription option and the pubsub#body_xslt node configuration option to transform payload format into an XMPP message body, and clarified rules for inclusion of message bodies</li>
  248. <li>Clarified nature of collections and association of a node to a collection</li>
  249. <li>Specified that simultaneous subscriptions of type nodes and items are allowed to collection nodes</li>
  250. <li>Added examples and further explanation of time-based and content-based subscriptions</li>
  251. <li>Added Internationalization Considerations</li>
  252. <li>Clarified terminology</li>
  253. <li>Corrected and updated the schemas</li>
  254. </ul>
  255. </remark>
  256. </revision>
  257. <revision>
  258. <version>1.7</version>
  259. <date>2005-03-03</date>
  260. <initials>psa/rm</initials>
  261. <remark>
  262. <ul>
  263. <li>Reinstated pubsub#subscribe feature (deleted in error)</li>
  264. <li>Added type attribute for the &lt;create/&gt; and &lt;configure/&gt; elements to differentiate between leaf nodes and collection nodes</li>
  265. <li>In Section 8.1.7, changed affiliations retrieval support to SHOULD and added pubsub#retrieve-affiliations feature</li>
  266. <li>In Section 8.1.10, removed two duplicate examples</li>
  267. <li>In Section 8.1.12, clarified relationship between normal disco#info data and node meta-data (which uses a service discovery extension)</li>
  268. <li>In Section 8.2.4, specified that node purgation MUST result in one event notification, not a notification per item</li>
  269. <li>In Section 8.1.8, further specified handling of SubIDs</li>
  270. <li>Clarified nature of the pubsub#type field</li>
  271. <li>Mentioned that the forbidden error should be returned in response to certain operations requested by an outcast</li>
  272. <li>Corrected datatype of max_items attribute from xs:string to xs:positiveInteger</li>
  273. <li>Corrected &lt;requesting-entity-not-subscribed/&gt; error to &lt;not-subscribed/&gt; since the subscribed JID need not be that of the requesting entity</li>
  274. <li>Added service discovery features for more optional use cases: retracting items, purging nodes, deleting nodes</li>
  275. <li>Updated relevant registries</li>
  276. </ul>
  277. </remark>
  278. </revision>
  279. <revision>
  280. <version>1.6</version>
  281. <date>2004-07-13</date>
  282. <initials>pgm/psa</initials>
  283. <remark><p>Added service discovery features for pubsub#meta-data, and pubsub#retrieve-items. Added pubsub#subscription_depth configuration option. Specified pubsub-specific error condition elements qualified by pubsub#errors namespace.</p></remark>
  284. </revision>
  285. <revision>
  286. <version>1.5</version>
  287. <date>2004-07-07</date>
  288. <initials>pgm/psa</initials>
  289. <remark><p>Fixed typos. Added more details to the section on collections. Added paragraph to create node use case to allow the service to change the requested node-id to something which it creates. Added text about bouncing publish requests when the request does not match the event-type for that node. Added disco features for the jabber registrar. Changed affiliation verbiage to allow publishers to remove any item. Tweaked verbiage for create node, eliminated extra example. Fully defined XMPP Registrar submissions. Corrected schemas.</p></remark>
  290. </revision>
  291. <revision>
  292. <version>1.4</version>
  293. <date>2004-06-22</date>
  294. <initials>pgm</initials>
  295. <remark><p>Added subid syntax in a variety of places. Added more information about disco#info and disco#items support. Added more info about subscription options. Added collection information. Added implementation notes about subscription leases, and content-based pubsub services.</p></remark>
  296. </revision>
  297. <revision>
  298. <version>1.3</version>
  299. <date>2004-04-25</date>
  300. <initials>psa</initials>
  301. <remark><p>Editorial review; added one implementation note.</p></remark>
  302. </revision>
  303. <revision>
  304. <version>1.2</version>
  305. <date>2004-03-09</date>
  306. <initials>psa</initials>
  307. <remark><p>Added XMPP error handling.</p></remark>
  308. </revision>
  309. <revision>
  310. <version>1.1</version>
  311. <date>2004-01-14</date>
  312. <initials>psa</initials>
  313. <remark><p>Added XMPP Registrar Considerations subsection for Service Discovery category/type registration.</p></remark>
  314. </revision>
  315. <revision>
  316. <version>1.0</version>
  317. <date>2003-10-28</date>
  318. <initials>psa</initials>
  319. <remark><p>Per a vote of the Jabber Council, advanced status to Draft.</p></remark>
  320. </revision>
  321. <revision>
  322. <version>0.16</version>
  323. <date>2003-10-23</date>
  324. <initials>pgm</initials>
  325. <remark><p>Clarified JID addressing usage for nodes. Added specific MAY requirement for disco usage. Added sentence about implementations verifying that an entity has a subscription before getting the current items.</p></remark>
  326. </revision>
  327. <revision>
  328. <version>0.15</version>
  329. <date>2003-10-21</date>
  330. <initials>pgm</initials>
  331. <remark><p>Fixed invalid XML in examples for subscription deny/allow.</p></remark>
  332. </revision>
  333. <revision>
  334. <version>0.14</version>
  335. <date>2003-10-21</date>
  336. <initials>pgm</initials>
  337. <remark><p>Clarified restrictions on addressing nodes by JID. Added section on Approving and Denying Subscription Requests. Changed get-pending to use Ad-Hoc Commands. Changed semantics when sending in a form type='cancel' for pending subscriptions.</p></remark>
  338. </revision>
  339. <revision>
  340. <version>0.13</version>
  341. <date>2003-09-30</date>
  342. <initials>pgm</initials>
  343. <remark><p>Removed item as a possible child of subscribe and unsubscribe and pubsub in the schemas. Removed retract as a possible child of item in the pubsub#event schema. Added verbiage to requirements for addressing nodes either via JIDs or disco nodes.</p></remark>
  344. </revision>
  345. <revision>
  346. <version>0.12</version>
  347. <date>2003-08-13</date>
  348. <initials>pgm/psa</initials>
  349. <remark><p>Defined public vs. private nodes; described how changes to existing nodes might trigger meta-node events (e.g., configuration changes); changed &lt;x/&gt; to &lt;event/&gt; for #events namespace; added meta-data about meta-nodes; fully defined XMPP Registrar considerations.</p></remark>
  350. </revision>
  351. <revision>
  352. <version>0.11</version>
  353. <date>2003-06-25</date>
  354. <initials>pgm</initials>
  355. <remark><p>Removed subscription notifications since they have inherent issues. Removed empty implementation note sub-section.</p></remark>
  356. </revision>
  357. <revision>
  358. <version>0.10</version>
  359. <date>2003-06-11</date>
  360. <initials>pgm</initials>
  361. <remark><p>Fixed error example when returning 501 from an items-get request. Added note about receiving subscription requests when an entity is already subscribed. Fixed some entity elements in various subscription examples. Many were missing the node attribute. Added subscription change notification verbiage and example. Added verbiage and example of subscription state notification being sent to the requesting entity. Added disco#items information for getting a list of item identifiers for a single node. Added verbiage for returning the current entity element when a curent subscriber attempts to subscribe again.</p></remark>
  362. </revision>
  363. <revision>
  364. <version>0.9</version>
  365. <date>2003-04-30</date>
  366. <initials>pgm</initials>
  367. <remark><p>Include JID attributes in the entity elements when receiving your affiliations. Changed error code 406 (which was wrong) to 404, which is correct. Changed many 405 errors to 401, and modified the error table to make it more implementable (rules are more concrete). Added subscribe-options element for indicating subscriptions may be configured.</p></remark>
  368. </revision>
  369. <revision>
  370. <version>0.8</version>
  371. <date>2003-04-03</date>
  372. <initials>pgm</initials>
  373. <remark><p>Clarified the affiliations table and the semantics around subscribing and unsubscribing. Added protocol to get all of your affiliations in the service. Added protocol for services informing subscribers that configurable subscription options are available. Added protocol for obtaining existing node configuration settings and for concatenating configuration and node creation requests into a single stanza. Added meta-node implementation notes and specified the interaction with the XMPP Registrar and the meta NodeIDs. Added authorization notes to subscription options.</p></remark>
  374. </revision>
  375. <revision>
  376. <version>0.7</version>
  377. <date>2003-02-14</date>
  378. <initials>pgm</initials>
  379. <remark><p>Clarified requirements around what affiliations must be supported. Moved requirements about specifying entities which can subscribe and publish out of the MUSTs to MAYs. Changed SHOULD to MAY when talking about allowing entities to create nodes. Added ability to send configuration requests in the same stanza as a creation request.</p></remark>
  380. </revision>
  381. <revision>
  382. <version>0.6</version>
  383. <date>2003-02-06</date>
  384. <initials>pgm</initials>
  385. <remark><p>Added more details and an example about publishing without NodeID. Added more implementation notes about NodeIDs and persistent storage.</p></remark>
  386. </revision>
  387. <revision>
  388. <version>0.5</version>
  389. <date>2003-01-22</date>
  390. <initials>pgm</initials>
  391. <remark><p>Fixed header for delete item example. Added examples showing subscribers being notified of deleted items. Added examples for notification of node deletion, and configuration for node deletion. Added Subscriber option semantics and examples. Added examples for 402 and 407 errors on subscribe and create respectively. Added clarification about ItemID handling to impl notes.</p></remark>
  392. </revision>
  393. <revision>
  394. <version>0.4</version>
  395. <date>2003-01-21</date>
  396. <initials>pgm</initials>
  397. <remark><p>Clarified in-band and out-of-band configuration requirement. Added Delete Item privilege for all affiliations to the table. Added Delete item protocol for publishers and owners. Added 401 error case for subscribing to an illegal jid. Changed subscription request form. Added defaults to configuration form, and clarified role of the XMPP Registrar for the features show. Added text explaining the max_items attribute. Changed &quot;last items&quot; to &quot;most recent items&quot;. Removed default configuration acceptance -- owners should just cancel. Added the notify_retract configuration option. Clarified error handling for affiliation modifications. </p></remark>
  398. </revision>
  399. <revision>
  400. <version>0.3</version>
  401. <date>2003-01-20</date>
  402. <initials>pgm</initials>
  403. <remark><p>Added subscription attribute for entities. Removed subscriber from the affiliations table. Clarified configuration details. Clarified JabberID usages. Added XMPP Registrar Considerations. Added link to XEP-0068 about the FORM_TYPE element in subscription request notifications. Fixed some typos in examples. Added unsupported configuration namespace to example. Added a default node configuration example. </p></remark>
  404. </revision>
  405. <revision>
  406. <version>0.2</version>
  407. <date>2003-01-02</date>
  408. <initials>pgm</initials>
  409. <remark><p>Added numerous implementation notes; added get-pending action with regard to subscriptions; added error table; changed purge and delete to use IQ type='set'.</p></remark>
  410. </revision>
  411. <revision>
  412. <version>0.1</version>
  413. <date>2002-11-19</date>
  414. <initials>pgm</initials>
  415. <remark><p>Initial version.</p></remark>
  416. </revision>
  417. </header>
  418. <section1 topic='Introduction' anchor='intro'>
  419. <section2 topic='Overview' anchor='intro-overview'>
  420. <p>The XMPP publish-subscribe extension defined in this document provides a framework for a wide variety of applications, including news feeds, content syndication, extended presence, geolocation, avatar management, shared bookmarks, auction and trading systems, workflow systems, network management systems, NNTP gateways, profile management, and any other application that requires event notifications.</p>
  421. <p>This technology uses the classic "publish-subscribe" or "observer" design pattern: a person or application publishes information, and an event notification (with or without payload) is broadcasted to all authorized subscribers. In general, the relationship between the publisher and subscriber is mediated by a service that receives publication requests, broadcasts event notifications to subscribers, and enables privileged entities to manage lists of people or applications that are authorized to publish or subscribe. The focal point for publication and subscription is a "node" to which publishers send data and from which subscribers receive event notifications. Nodes can also maintain a history of events and provide other services that supplement the pure pubsub model.</p>
  422. <p>This document defines a generic protocol that all pubsub applications can use. Compliant implementations are not required to implement all of the features defined here (see the <link url='#features'>Feature Summary</link>.) Other specifications may define "subsets" or "profiles" of publish-subscribe for use in specialized contexts, but such profiles are out of scope for this document.</p>
  423. </section2>
  424. <section2 topic='How It Works' anchor='intro-howitworks'>
  425. <p>Although this specification is large because it defines many side use cases and possible error flows, the basic idea is simple:</p>
  426. <ol>
  427. <li>An entity publishes information to a node at a publish-subscribe service.</li>
  428. <li>The pubsub service pushes an event notification to all entities that are authorized to learn about the published information.</li>
  429. </ol>
  430. <p>Perhaps the most popular application of pubsub-like functionality is content syndication, which has become familiar from the RSS and Atom (&rfc4287;) feeds associated with weblogs, news sites, and other frequently-updated information available on the Internet. Consider the example of a weblog published by &lt;hamlet@denmark.lit&gt;. When Hamlet writes a new weblog entry, his blogging software publishes the entry to a pubsub node hosted at &lt;pubsub.shakespeare.lit&gt;:</p>
  431. <example caption='Publisher Publishes a New Weblog Entry'><![CDATA[
  432. <iq type='set'
  433. from='hamlet@denmark.lit/blogbot'
  434. to='pubsub.shakespeare.lit'
  435. id='pub1'>
  436. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  437. <publish node='princely_musings'>
  438. <item>
  439. <entry xmlns='http://www.w3.org/2005/Atom'>
  440. <title>Soliloquy</title>
  441. <summary>
  442. To be, or not to be: that is the question:
  443. Whether 'tis nobler in the mind to suffer
  444. The slings and arrows of outrageous fortune,
  445. Or to take arms against a sea of troubles,
  446. And by opposing end them?
  447. </summary>
  448. <link rel='alternate' type='text/html'
  449. href='http://denmark.lit/2003/12/13/atom03'/>
  450. <id>tag:denmark.lit,2003:entry-32397</id>
  451. <published>2003-12-13T18:30:02Z</published>
  452. <updated>2003-12-13T18:30:02Z</updated>
  453. </entry>
  454. </item>
  455. </publish>
  456. </pubsub>
  457. </iq>
  458. ]]></example>
  459. <p>So that is the "pub" part of pubsub.</p>
  460. <p>Now the pubsub service notifies all the subscribers about the new blog entry:</p>
  461. <example caption='Service Notifies Subscribers'><![CDATA[
  462. <message from='pubsub.shakespeare.lit' to='francisco@denmark.lit' id='foo'>
  463. <event xmlns='http://jabber.org/protocol/pubsub#event'>
  464. <items node='princely_musings'>
  465. <item id='ae890ac52d0df67ed7cfdf51b644e901'>
  466. [ ... ENTRY ... ]
  467. </item>
  468. </items>
  469. </event>
  470. </message>
  471. <message from='pubsub.shakespeare.lit' to='bernardo@denmark.lit' id='bar'>
  472. <event xmlns='http://jabber.org/protocol/pubsub#event'>
  473. <items node='princely_musings'>
  474. <item id='ae890ac52d0df67ed7cfdf51b644e901'>
  475. [ ... ENTRY ... ]
  476. </item>
  477. </items>
  478. </event>
  479. </message>
  480. <message from='pubsub.shakespeare.lit' to='horatio@denmark.lit' id='baz'>
  481. <event xmlns='http://jabber.org/protocol/pubsub#event'>
  482. <items node='princely_musings'>
  483. <item id='ae890ac52d0df67ed7cfdf51b644e901'>
  484. [ ... ENTRY ... ]
  485. </item>
  486. </items>
  487. </event>
  488. </message>
  489. <message from='pubsub.shakespeare.lit' to='bard@shakespeare.lit' id='fez'>
  490. <event xmlns='http://jabber.org/protocol/pubsub#event'>
  491. <items node='princely_musings'>
  492. <item id='ae890ac52d0df67ed7cfdf51b644e901'>
  493. [ ... ENTRY ... ]
  494. </item>
  495. </items>
  496. </event>
  497. </message>
  498. ]]></example>
  499. <p>Here is an even simpler example: a transient node that sends only event notifications without a payload:</p>
  500. <example caption='A Transient Notification'><![CDATA[
  501. <message from='pubsub.shakespeare.lit' to='francisco@denmark.lit'>
  502. <event xmlns='http://jabber.org/protocol/pubsub#event'>
  503. <items node='elsinore/doorbell'/>
  504. </event>
  505. </message>
  506. ]]></example>
  507. <p>Naturally, the entities involved may need to complete other use cases in order to enable full pubsub functionality -- for example, the publisher may need to create the node (see <link url='#owner-create'>Create a Node</link>) and subscribers may need to sign up for event notifications (see <link url='#subscriber-subscribe'>Subscribe to a Node</link>). These use cases are fully described in the remainder of this document. (For information about which features are required and which are recommended or optional, consult the <link url='#features'>Feature Summary</link>.)</p>
  508. </section2>
  509. </section1>
  510. <section1 topic='Glossary' anchor='glossary'>
  511. <p>The following terms are used throughout this document to refer to elements, objects, or actions that occur in the context of a pubsub service. (Note: Some of these terms are specified in greater detail within the body of this document.)</p>
  512. <dl>
  513. <di><dt>Authorize Access Model</dt><dd>A node access model under which an entity can subscribe only through having a subscription request approved by a node owner (subscription requests are accepted but only provisionally) and only subscribers may retrieve items.</dd></di>
  514. <di><dt>Address</dt><dd>(1) A JID as defined in &xmppcore;, or (2) the combination of a JID and a &xep0030; node.</dd></di>
  515. <di><dt>Collection Node</dt><dd>A type of node that contains nodes and/or other collections but no published items. Collections make it possible to represent more sophisticated relationships among nodes. Collection nodes are defined in &xep0248;.</dd></di>
  516. <di><dt>Entity</dt><dd>A JID-addressable XMPP entity (client, service, application, etc.).</dd></di>
  517. <di><dt>Event</dt><dd>A change in the state of a node.</dd></di>
  518. <di><dt>Instant Node</dt><dd>A node whose NodeID is automatically generated by a pubsub service.</dd></di>
  519. <di><dt>Item</dt><dd>An XML fragment which is published to a node, thereby generating an event.</dd></di>
  520. <di><dt>ItemID</dt><dd>A unique identifier for an item in the context of a specific node.</dd></di>
  521. <di><dt>Leaf Node</dt><dd>A type of node that contains published items only. It is NOT a container for other nodes.</dd></di>
  522. <di><dt>Node</dt><dd>A virtual location to which information can be published and from which event notifications and/or payloads can be received (in other pubsub systems, this may be labelled a "topic").</dd></di>
  523. <di><dt>NodeID</dt><dd>The unique identifier for a node within the context of a pubsub service. The NodeID is either supplied by the node creator or generated by the pubsub service (if the node creator requests an Instant Node). The NodeID MAY have semantic meaning (e.g., in some systems or in pubsub profiles such as PEP the NodeID might be an XML namespace for the associated payload), but such meaning is OPTIONAL. If a document defines a given NodeID as unique within the realm of XMPP pubsub systems, it MUST specify the XML namespace of the associated payload.</dd></di>
  524. <di><dt>Notification</dt><dd>A message sent to a subscriber informing them of an event.</dd></di>
  525. <di><dt>Outcast</dt><dd>An entity that is disallowed from subscribing or publishing to a node.</dd></di>
  526. <di><dt>Owner</dt><dd>The manager of a node, of which there may be more than one; often but not necessarily the node creator.</dd></di>
  527. <di><dt>Open Access Model</dt><dd>A node access model under which any entity may subscribe and retrieve items without approval.</dd></di>
  528. <di><dt>Payload</dt><dd>The XML data that is contained within the &lt;item/&gt; element of a publication request or an event notification. A given payload is defined by an XML namespace and associated schema. A document that defines a payload format SHOULD specify whether the payload can be used only for a NodeID whose value is the same as the XML namespace, or whether the payload can be used for any NodeID. Such a document also SHOULD specify whether it is suggested that node at which such payloads are published are best configured as <link url='#impl-singleton'>Singleton Nodes</link>.</dd></di>
  529. <di><dt>Personal Eventing</dt><dd>A simplified subset of Publish-Subscribe for use in the context of instant messaging and presence applications, whereby each IM user's JID is a virtual pubsub service; for details, see &xep0163;.</dd></di>
  530. <di><dt>Presence Access Model</dt><dd>A node access model under which any entity that is subscribed to the owner's presence with a subscription of type "from" or "both" (see &rfc3921;) may subscribe to the node and retrieve items from the node; this access model applies mainly to instant messaging systems.</dd></di>
  531. <di><dt>Publisher</dt><dd>An entity that is allowed to publish items to a node and that is automatically subscribed to the node.</dd></di>
  532. <di><dt>Publish-Only</dt><dd>An entity that is allowed to publish items to a node but that is not allowed to receive notifications. (This affiliation is useful in the context of nodes that do not have an open access model when automated entities need to generate notifications on behalf of the owner.)</dd></di>
  533. <di><dt>Pubsub Service</dt><dd>An XMPP server or component that adheres to the protocol defined herein.</dd></di>
  534. <di><dt>Roster Access Model</dt><dd>A node access model under which any entity that is subscribed to the owner's presence and in the specified roster group(s) may subscribe to the node and retrieve items from the node; this access model applies mainly to instant messaging systems.</dd></di>
  535. <di><dt>Subscriber</dt><dd>An entity that is subscribed to a node.</dd></di>
  536. <di><dt>Whitelist Access Model</dt><dd>A node access model under which an entity may subscribe and retrieve items only if explicitly allowed to do so by the node owner (subscription requests from unauthorized entities are rejected).</dd></di>
  537. </dl>
  538. </section1>
  539. <!-- =================== REQS ======================== -->
  540. <section1 topic='Requirements' anchor='reqs'>
  541. <p>Requirements for a pubsub service can be driven by end-user needs as well as the needs of other components and services which can use the service. First, a pubsub service implemented using XMPP MUST provide the basic features that implement a pure publish-subscribe pattern:</p>
  542. <!-- ================== MUSTS =================== -->
  543. <ul>
  544. <li>An entity MUST be able to publish events to a service such that all subscribers to a node receive notification of the event. See <link url='#publisher-publish'>Publish an Item to a Node</link>.</li>
  545. <li>An entity MUST be able to subscribe to a node (or be informed that subscription is not allowed). See <link url='#subscriber-subscribe'>Subscribe to a Node</link>.</li>
  546. <li>An entity MUST be allowed to be affiliated with a node. Allowable affiliations are member, none, outcast, owner, publish-only, and publisher. Implementations MUST support affiliations of none and owner, and MAY support affiliations of member, outcast, publisher, and publish-only. See <link url='#affiliations'>Affiliations</link>.</li>
  547. <li>An entity MUST be allowed to query the pubsub service (or a specific node) to determine what optional features of this specification the service (or node) implements. This query MUST use the Service Discovery (disco#info) protocol. See <link url='#entity-info'>Discover Node Information</link>.</li>
  548. </ul>
  549. <!-- =================== MAYS and SHOULDS =================== -->
  550. <p>Some of the possible uses of an XMPP-based pubsub service will require other features, but these features are OPTIONAL and therefore not mandatory for compliance with this specification. However, if these features are implemented, they MUST adhere to the protocol described herein in to be compliant. These features include:</p>
  551. <ul>
  552. <li>A service MAY cache the last item published to a node (even if the "persistent-items" option is set to false); if it does default "cache-last-item" to true, it SHOULD send the last published item (or notification thereof) to subscribed entities based on configuration of the "send_last_published_item" field.</li>
  553. <li>A node owner SHOULD be able to specify who may subscribe to a node.</li>
  554. <li>A node owner SHOULD be able to specify who may publish to a node.</li>
  555. <li>A node MAY be configured to deliver the published payload inside the event notification.</li>
  556. <li>A node MAY be configured to persist published items to some persistent storage mechanism.</li>
  557. <li>A node MAY be configured to persist only a limited number of items.</li>
  558. <li>A service MAY support collections as described in <cite>XEP-0248</cite>.</li>
  559. <li>A service or node MAY support extended service discovery information (meta-data).</li>
  560. </ul>
  561. </section1>
  562. <section1 topic='Preliminaries' anchor='preliminaries'>
  563. <section2 topic='Affiliations' anchor='affiliations'>
  564. <p>To manage permissions, the protocol defined herein uses a hierarchy of affiliations, similiar to those introduced in &xep0045;.</p>
  565. <p>All affiliations MUST be based on a bare JID &BAREJID; instead of a full JID &FULLJID;.</p>
  566. <p>Support for the "owner" and "none" affiliations is REQUIRED. Support for all other affiliations is RECOMMENDED. For each non-required affiliation supported by an implementation, it SHOULD return a service discovery feature of "name-affiliation" where "name" is the name of the affiliation, such as "member", "outcast", or "publisher" (see the <link url='#features'>Feature Summary</link>). Particular kinds of pubsub services MAY enforce additional requirements (e.g., requiring support for a given non-required affiliation or for all affiliations).</p>
  567. <table caption='Affiliations and their Privileges'>
  568. <tr>
  569. <th>Affiliation</th>
  570. <th>Subscribe</th>
  571. <th>Retrieve Items</th>
  572. <th>Publish Items</th>
  573. <th>Delete Single Item</th>
  574. <th>Purge Node</th>
  575. <th>Configure Node</th>
  576. <th>Delete Node</th>
  577. </tr>
  578. <tr>
  579. <td>Owner</td>
  580. <td>Yes</td>
  581. <td>Yes</td>
  582. <td>Yes</td>
  583. <td>Yes</td>
  584. <td>Yes</td>
  585. <td>Yes</td>
  586. <td>Yes</td>
  587. </tr>
  588. <tr>
  589. <td>Publisher</td>
  590. <td>Yes</td>
  591. <td>Yes</td>
  592. <td>Yes</td>
  593. <td>Yes *</td>
  594. <td>Yes *</td>
  595. <td>No</td>
  596. <td>No</td>
  597. </tr>
  598. <tr>
  599. <td>Publish-Only</td>
  600. <td>No</td>
  601. <td>No</td>
  602. <td>Yes</td>
  603. <td>Yes *</td>
  604. <td>No *</td>
  605. <td>No</td>
  606. <td>No</td>
  607. </tr>
  608. <tr>
  609. <td>Member</td>
  610. <td>Yes</td>
  611. <td>Yes</td>
  612. <td>No</td>
  613. <td>No</td>
  614. <td>No</td>
  615. <td>No</td>
  616. <td>No</td>
  617. </tr>
  618. <tr>
  619. <td>None</td>
  620. <td>Yes</td>
  621. <td>No</td>
  622. <td>No</td>
  623. <td>No</td>
  624. <td>No</td>
  625. <td>No</td>
  626. <td>No</td>
  627. </tr>
  628. <tr>
  629. <td>Outcast</td>
  630. <td>No</td>
  631. <td>No</td>
  632. <td>No</td>
  633. <td>No</td>
  634. <td>No</td>
  635. <td>No</td>
  636. <td>No</td>
  637. </tr>
  638. </table>
  639. <p>* Note: A service MAY allow any publisher to delete / purge any item once it has been published to that node instead of allowing only the original publisher to remove it. This behavior is NOT RECOMMENDED for the publish-only affiliation, which SHOULD be allowed to delete only items that the publish-only entity has published.</p>
  640. <p>The ways in which an entity changes its affiliation with a node are well-defined. Typically, action by an owner is required to make an affiliation state transition. Affiliation changes and their triggering actions are specified in the following table.</p>
  641. <table caption='Affiliation State Chart'>
  642. <tr>
  643. <th>&#160;</th>
  644. <th>Outcast</th>
  645. <th>None</th>
  646. <th>Member</th>
  647. <th>Publisher</th>
  648. <th>Owner</th>
  649. </tr>
  650. <tr>
  651. <td>Outcast</td>
  652. <td>--</td>
  653. <td>Owner removes ban</td>
  654. <td>Owner adds entity to member list</td>
  655. <td>Owner adds entity to publisher list</td>
  656. <td>Owner adds entity to owner list</td>
  657. </tr>
  658. <tr>
  659. <td>None</td>
  660. <td>Owner bans entity</td>
  661. <td>--</td>
  662. <td>Owner adds entity to member list</td>
  663. <td>Owner adds entity to publisher list</td>
  664. <td>Owner adds entity to owner list</td>
  665. </tr>
  666. <tr>
  667. <td>Member</td>
  668. <td>Owner bans entity</td>
  669. <td>Owner removes entity from member list</td>
  670. <td>--</td>
  671. <td>Owner adds entity to publisher list</td>
  672. <td>Owner adds entity to owner list</td>
  673. </tr>
  674. <tr>
  675. <td>Publisher</td>
  676. <td>Owner bans entity</td>
  677. <td>Owner removes entity from publisher list</td>
  678. <td>n/a</td>
  679. <td>--</td>
  680. <td>Owner adds entity to owner list</td>
  681. </tr>
  682. <tr>
  683. <td>Owner</td>
  684. <td>n/a</td>
  685. <td>Owner resigns</td>
  686. <td>n/a</td>
  687. <td>n/a</td>
  688. <td>--</td>
  689. </tr>
  690. </table>
  691. </section2>
  692. <section2 topic='Subscription States' anchor='substates'>
  693. <p>Subscriptions to a node may exist in several states.</p>
  694. <table caption='Subscription States'>
  695. <tr>
  696. <th>Subscription State</th>
  697. <th>Description</th>
  698. </tr>
  699. <tr>
  700. <td>None</td>
  701. <td>The node MUST NOT send event notifications or payloads to the Entity.</td>
  702. </tr>
  703. <tr>
  704. <td>Pending</td>
  705. <td>An entity has requested to subscribe to a node and the request has not yet been approved by a node owner. The node MUST NOT send event notifications or payloads to the entity while it is in this state.</td>
  706. </tr>
  707. <tr>
  708. <td>Unconfigured</td>
  709. <td>An entity has subscribed but its subscription options have not yet been configured. The node MAY send event notifications or payloads to the entity while it is in this state. The service MAY timeout unconfigured subscriptions.</td>
  710. </tr>
  711. <tr>
  712. <td>Subscribed</td>
  713. <td>An entity is subscribed to a node. The node MUST send all event notifications (and, if configured, payloads) to the entity while it is in this state (subject to subscriber configuration and content filtering).</td>
  714. </tr>
  715. </table>
  716. </section2>
  717. <section2 topic='Event Types' anchor='events'>
  718. <p>The requirements for the publish-subscribe protocol imply that there are two major dimensions along which we can measure events: persistent vs. transient, and pure event notification vs. inclusion of payload. An implementation SHOULD enable an owner to configure a node along both of these dimensions.</p>
  719. <p>No matter whether a node is configured for persistent or transient events, a service MAY cache the last item published to the node, in which case it SHOULD send that item to subscribers based on configuration of the "send_last_published_item" option (see the <link url='#impl-caching'>Item Caching</link> section of this document); if the service supports the "http://jabber.org/protocol/pubsub#last-published" feature then the value of this option MUST default to "on_sub_and_presence" (though the service SHOULD allow the node owner to override the default).</p>
  720. <p class='box'>Note: The "on_sub_and_presence" setting relates to the <em>subscriber's</em> presence, not the publisher's presence.</p>
  721. <p>A pubsub service MUST validate publish requests against the configuration of the node along both of these dimensions (see the <link url='#publisher-publish'>Publish An Item to a Node</link> section of this document for the relevant error conditions).</p>
  722. <p>The node configuration and desired event type determine whether an item must be provided by the publisher, whether the item includes a payload in the publish request or event notification, and whether an item ID is provided by the publisher or generated by the pubsub service. We can summarize the relevant rules as follows:</p>
  723. <table caption='Items, Payloads, and Item IDs'>
  724. <tr><th>&#160;</th><th>Notification-Only Node *</th><th>Payload-Included Node *</th></tr>
  725. <tr>
  726. <td><strong>Persistent Node **</strong></td>
  727. <td>Publish request MUST include an &ITEM; element, which MAY be empty or MAY contain a payload; even if publish request contains a payload, pubsub service MUST NOT include the payload in event notifications; if publish request did not include item ID, pubsub service MUST generate item ID</td>
  728. <td>Publish request MUST include an &ITEM; element, which SHOULD contain a payload; if publish request included a payload, event notifications MUST include the payload; if publish request did not include item ID, pubsub service MUST generate item ID</td>
  729. </tr>
  730. <tr>
  731. <td><strong>Transient Node **</strong></td>
  732. <td>Publish request MUST NOT include an &ITEM; element; payload is not included in publish request or event notifications, although event notifications MUST include an empty &ITEMS; element; item ID is neither provided in publish request nor generated by pubsub service</td>
  733. <td>Publish request MUST include an &ITEM; element, which SHOULD contain a payload; if publish request included a payload, event notifications MUST include the payload; pubsub service MAY generate an item ID</td>
  734. </tr>
  735. </table>
  736. <p>* Note: Whether the node is notification-only or includes payloads is determined by the "pubsub#deliver_payloads" configuration field.</p>
  737. <p>** Note: Whether the node is persistent or transient is determined by the "pubsub#persist_items" configuration field.</p>
  738. </section2>
  739. <section2 topic='Node Types' anchor='nodetypes'>
  740. <p>There are two types of nodes:</p>
  741. <table caption='Node Types'>
  742. <tr>
  743. <th>Node Type</th>
  744. <th>Description</th>
  745. </tr>
  746. <tr>
  747. <td>Leaf</td>
  748. <td>A node that contains published items only. It is NOT a container for other nodes. This is the most common node type.</td>
  749. </tr>
  750. <tr>
  751. <td>Collection</td>
  752. <td>A node that contains nodes and/or other collections but no published items. Collections make it possible to represent more sophisticated relationships among nodes. For details, refer to <cite>XEP-0248</cite>.</td>
  753. </tr>
  754. </table>
  755. </section2>
  756. <section2 topic='Node Access Models' anchor='accessmodels'>
  757. <p>In order to make node creation simpler for clients, we define the following node access models (in order of openness):</p>
  758. <table caption='Node Access Models'>
  759. <tr>
  760. <th>Access Model</th>
  761. <th>Description</th>
  762. </tr>
  763. <tr>
  764. <td>Open</td>
  765. <td>Any entity may subscribe to the node (i.e., without the necessity for subscription approval) and any entity may retrieve items from the node (i.e., without being subscribed); this SHOULD be the default access model for generic pubsub services.</td>
  766. </tr>
  767. <tr>
  768. <td>Presence</td>
  769. <td>Any entity with a subscription of type "from" or "both" may subscribe to the node and retrieve items from the node; this access model applies mainly to instant messaging systems (see <cite>RFC 3921</cite>).</td>
  770. </tr>
  771. <tr>
  772. <td>Roster</td>
  773. <td>Any entity in the specified roster group(s) may subscribe to the node and retrieve items from the node; this access model applies mainly to instant messaging systems (see <cite>RFC 3921</cite>).</td>
  774. </tr>
  775. <tr>
  776. <td>Authorize</td>
  777. <td>The node owner must approve all subscription requests, and only subscribers may retrieve items from the node.</td>
  778. </tr>
  779. <tr>
  780. <td>Whitelist</td>
  781. <td>An entity may subscribe or retrieve items only if on a whitelist managed by the node owner. The node owner MUST automatically be on the whitelist. In order to add entities to the whitelist, the node owner SHOULD use the protocol specified in the <link url='#owner-affiliations'>Manage Affiliated Entities</link> section of this document, specifically by setting the affiliation to "member".</td>
  782. </tr>
  783. </table>
  784. <p>A generic publish-subscribe implementation SHOULD support all of the defined access models, although specialized publish-subscribe implementations MAY support only a subset of the access models. Which access models are provided in a particular deployment is a matter of service provisioning (e.g., some restricted deployments may wish to lock down permissions so that only the "authorize" and "whitelist" access models are provided, or even only the "whitelist" access model).</p>
  785. <p>A node creator or owner can override the default access model by specifying an appropriate value for the 'pubsub#access_model' configuration field (see the <link url='#owner-create'>Create a Node With Default Configuration</link> and <link url='#owner-configure'>Configure a Node</link> sections of this document).</p>
  786. </section2>
  787. <section2 topic='Addressing' anchor='addressing'>
  788. <p>If a pubsub node is addressable, it MUST be addressable either (1) as a JID or (2) as the combination of a JID and a node. <note>These nodes are equivalent to those used in <cite>XEP-0030: Service Discovery</cite>.</note></p>
  789. <section3 topic='JID' anchor='addressing-jid'>
  790. <p>If a pubsub node is addressable as a JID, the NodeID MUST be the resource identifier, and MUST NOT be specified by the "user" portion (node identifier) of the JID (e.g. "domain.tld/NodeID" and "user@domain.tld/NodeID" are allowed; "NodeID@domain.tld" is not allowed <note>This rule does not apply to the root collection node, if any.</note>). JID addressing SHOULD be used when interacting with a pubsub node using a protocol that does not support the node attribute. For example, when a service makes it possible for entities to subscribe to nodes via presence, it would address nodes as JIDs. If a pubsub node is addressable as a JID, the pubsub service MUST ensure that the NodeID conforms to the Resourceprep profile of Stringprep as described in <cite>RFC 3920</cite>.</p>
  791. <p>Consider the following example, in which the pubsub service is located at the hostname pubsub.shakespeare.lit.</p>
  792. <example caption='Node addressed as domain.tld/NodeID'><![CDATA[
  793. <iq to='pubsub.shakespeare.lit/news announcements'>
  794. ...
  795. </iq>
  796. ]]></example>
  797. <p>Now consider the following example, in which the pubsub service is located at pubsub@shakespeare.lit.</p>
  798. <example caption='Node addressed as user@domain.tld/NodeID'><![CDATA[
  799. <iq to='pubsub@shakespeare.lit/news announcements'>
  800. ...
  801. </iq>
  802. ]]></example>
  803. </section3>
  804. <section3 topic='JID+NodeID' anchor='addressing-jidnode'>
  805. <p>If a pubsub node is addressable as a JID plus node, the NodeID MUST be the value of both the Service Discovery 'node' attribute and the pubsub 'node' attribute; i.e., for discovery purposes, a pubsub node is equivalent to a Service Discovery node. If a pubsub node is addressable as a JID plus node, the pubsub service SHOULD ensure that the NodeID conforms to the Resourceprep profile of Stringprep as described in <cite>RFC 3920</cite>.</p>
  806. <p>Consider the following example, in which the (virtual) pubsub service is located at hamlet@denmark.lit.</p>
  807. <example caption='Node addressed as JID+NodeID'><![CDATA[
  808. <iq to='hamlet@denmark.lit'>
  809. <query node='princely_musings'/>
  810. </iq>
  811. ]]></example>
  812. </section3>
  813. </section2>
  814. </section1>
  815. <section1 topic='Entity Use Cases' anchor='entity'>
  816. <p>This section defines the use cases for and protocols to be used by any entity that wishes to interact with a publish-subscribe service, mainly focused on Service Discovery use cases.</p>
  817. <section2 topic='Discover Features' anchor='entity-features'>
  818. <p>A service MUST respond to service discovery information requests qualified by the 'http://jabber.org/protocol/disco#info' namespace. The "disco#info" result returned by a pubsub service MUST indicate the identity of the service and indicate which pubsub features are supported.</p>
  819. <example caption='Entity Queries Pubsub Service Regarding Supported Features'><![CDATA[
  820. <iq type='get'
  821. from='francisco@denmark.lit/barracks'
  822. to='pubsub.shakespeare.lit'
  823. id='feature1'>
  824. <query xmlns='http://jabber.org/protocol/disco#info'/>
  825. </iq>
  826. ]]></example>
  827. <example caption='Pubsub Service Returns Set of Supported Features'><![CDATA[
  828. <iq type='result'
  829. from='pubsub.shakespeare.lit'
  830. to='francisco@denmark.lit/barracks'
  831. id='feature1'>
  832. <query xmlns='http://jabber.org/protocol/disco#info'>
  833. <identity category='pubsub' type='service'/>
  834. <feature var='http://jabber.org/protocol/pubsub'/>
  835. </query>
  836. </iq>
  837. ]]></example>
  838. <p>The possible pubsub features are noted throughout this document and have been registered as described in the <link url='#registrar'>XMPP Registrar Considerations</link> section of this document. For information regarding which features are required, recommended, and optional, see the <link url='#features'>Feature Summary</link> section of this document.</p>
  839. </section2>
  840. <section2 topic='Discover Nodes' anchor='entity-nodes'>
  841. <p>If a service implements a hierarchy of nodes (by means of <link url='#collections'>Collection Nodes</link>), it MUST also enable entities to discover the nodes in that hierarchy by means of the <strong>Service Discovery</strong> protocol, subject to the recommendations in <cite>XEP-0030</cite> regarding large result sets (for which &xep0055; or some other protocol SHOULD be used). The following examples show the use of service discovery in discovering the nodes available at a hierarchical pubsub service.</p>
  842. <p>Note: Node hierarchies and collection nodes are OPTIONAL. For details, refer to the <link url='#impl-semantics'>NodeID Semantics</link> and <link url='#collections'>Collection Nodes</link> sections of this document.</p>
  843. <p>In the first example, an entity sends a service discovery items ("disco#items") request to the root node (i.e., the service itself), which is a <link url='#collections'>Collection Node</link>:</p>
  844. <example caption='Entity asks service for all first-level nodes'><![CDATA[
  845. <iq type='get'
  846. from='francisco@denmark.lit/barracks'
  847. to='pubsub.shakespeare.lit'
  848. id='nodes1'>
  849. <query xmlns='http://jabber.org/protocol/disco#items'/>
  850. </iq>
  851. ]]></example>
  852. <example caption='Service returns all first-level nodes'><![CDATA[
  853. <iq type='result'
  854. from='pubsub.shakespeare.lit'
  855. to='francisco@denmark.lit/barracks'
  856. id='nodes1'>
  857. <query xmlns='http://jabber.org/protocol/disco#items'>
  858. <item jid='pubsub.shakespeare.lit'
  859. node='blogs'
  860. name='Weblog updates'/>
  861. <item jid='pubsub.shakespeare.lit'
  862. node='news'
  863. name='News and announcements'/>
  864. </query>
  865. </iq>
  866. ]]></example>
  867. <p>In the second example, an entity sends a disco#items request to one of the first-level nodes, which is also a collection node:</p>
  868. <example caption='Entity requests second-level nodes'><![CDATA[
  869. <iq type='get'
  870. from='francisco@denmark.lit/barracks'
  871. to='pubsub.shakespeare.lit'
  872. id='nodes2'>
  873. <query xmlns='http://jabber.org/protocol/disco#items'
  874. node='blogs'/>
  875. </iq>
  876. ]]></example>
  877. <example caption='Service returns second-level nodes'><![CDATA[
  878. <iq type='result'
  879. from='pubsub.shakespeare.lit'
  880. to='francisco@denmark.lit/barracks'
  881. id='nodes2'>
  882. <query xmlns='http://jabber.org/protocol/disco#items'
  883. node='blogs'>
  884. <item jid='pubsub.shakespeare.lit'
  885. node='princely_musings'/>
  886. <item jid='pubsub.shakespeare.lit'
  887. node='kingly_ravings'/>
  888. <item jid='pubsub.shakespeare.lit'
  889. node='starcrossed_stories'/>
  890. <item jid='pubsub.shakespeare.lit'
  891. node='moorish_meanderings'/>
  892. </query>
  893. </iq>
  894. ]]></example>
  895. <p>If a node is a leaf node rather than a collection node and items have been published to the node, the service MAY return one &ITEM; element for each published item as described in the <link url='#entity-discoveritems'>Discover Items for a Node</link> section of this document, however such items MUST NOT include a 'node' attribute (since they are published items, not nodes).</p>
  896. </section2>
  897. <section2 topic='Discover Node Information' anchor='entity-info'>
  898. <p>A pubsub service MUST allow entities to query individual nodes for the information associated with that node. The Service Discovery protocol MUST be used to discover this information. The "disco#info" result MUST include an identity with a category of "pubsub" and a type of either "leaf" or "collection".</p>
  899. <p>Note: If a node has an identity type of "leaf", then it MUST NOT contain other nodes or collections (only items); if a node has an identity type of "collection", then it MUST NOT contain items (only other nodes or collections).</p>
  900. <example caption='Entity queries collection node for information'><![CDATA[
  901. <iq type='get'
  902. from='francisco@denmark.lit/barracks'
  903. to='pubsub.shakespeare.lit'
  904. id='info2'>
  905. <query xmlns='http://jabber.org/protocol/disco#info'
  906. node='blogs'/>
  907. </iq>
  908. ]]></example>
  909. <example caption='Service responds with identity of pubsub/collection'><![CDATA[
  910. <iq type='result'
  911. from='pubsub.shakespeare.lit'
  912. to='francisco@denmark.lit/barracks'
  913. id='meta1'>
  914. <query xmlns='http://jabber.org/protocol/disco#info'
  915. node='blogs'>
  916. <identity category='pubsub' type='collection'/>
  917. </query>
  918. </iq>
  919. ]]></example>
  920. <example caption='Entity queries leaf node for information'><![CDATA[
  921. <iq type='get'
  922. from='francisco@denmark.lit/barracks'
  923. to='pubsub.shakespeare.lit'
  924. id='info1'>
  925. <query xmlns='http://jabber.org/protocol/disco#info'
  926. node='princely_musings'/>
  927. </iq>
  928. ]]></example>
  929. <example caption='Service responds with identity of pubsub/leaf'><![CDATA[
  930. <iq type='result'
  931. from='pubsub.shakespeare.lit'
  932. to='francisco@denmark.lit/barracks'
  933. id='info1'>
  934. <query xmlns='http://jabber.org/protocol/disco#info'
  935. node='princely_musings'>
  936. ...
  937. <identity category='pubsub' type='leaf'/>
  938. ...
  939. </query>
  940. </iq>
  941. ]]></example>
  942. </section2>
  943. <section2 topic='Discover Node Metadata' anchor='entity-metadata'>
  944. <p>The "disco#info" result MAY include detailed meta-data about the node, encapsulated in the &xep0004; format as described in &xep0128;, where the data form context is specified by including a FORM_TYPE of "http://jabber.org/protocol/pubsub#meta-data" in accordance with &xep0068;. If meta-data is provided, it SHOULD include values for all configured options as well as "automatic" information such as the node creation date, a list of publishers, and the like.</p>
  945. <example caption='Entity queries a node for information'><![CDATA[
  946. <iq type='get'
  947. from='francisco@denmark.lit/barracks'
  948. to='pubsub.shakespeare.lit'
  949. id='meta1'>
  950. <query xmlns='http://jabber.org/protocol/disco#info'
  951. node='princely_musings'/>
  952. </iq>
  953. ]]></example>
  954. <example caption='Service responds with information and meta-data'><![CDATA[
  955. <iq type='result'
  956. from='pubsub.shakespeare.lit'
  957. to='francisco@denmark.lit/barracks'
  958. id='meta1'>
  959. <query xmlns='http://jabber.org/protocol/disco#info'
  960. node='princely_musings'>
  961. <identity category='pubsub' type='leaf'/>
  962. <feature var='http://jabber.org/protocol/pubsub'/>
  963. <x xmlns='jabber:x:data' type='result'>
  964. <field var='FORM_TYPE' type='hidden'>
  965. <value>http://jabber.org/protocol/pubsub#meta-data</value>
  966. </field>
  967. <field var='pubsub#type' label='Payload type' type='text-single'>
  968. <value>http://www.w3.org/2005/Atom</value>
  969. </field>
  970. <field var='pubsub#creator' label='Node creator' type='jid-single'>
  971. <value>hamlet@denmark.lit</value>
  972. </field>
  973. <field var='pubsub#creation_date' label='Creation date' type='text-single'>
  974. <value>2003-07-29T22:56:10Z</value>
  975. </field>
  976. <field var='pubsub#title' label='A short name for the node' type='text-single'>
  977. <value>Princely Musings (Atom)</value>
  978. </field>
  979. <field var='pubsub#description' label='A description of the node' type='text-single'>
  980. <value>Updates for Hamlet&apos;s Princely Musings weblog.</value>
  981. </field>
  982. <field var='pubsub#language' label='Default language' type='list-single'>
  983. <value>en</value>
  984. </field>
  985. <field var='pubsub#contact' label='People to contact with questions' type='jid-multi'>
  986. <value>bard@shakespeare.lit</value>
  987. </field>
  988. <field var='pubsub#max_items' label='Max # of items to persist' type='text-single'>
  989. <value>120</value>
  990. </field>
  991. <field var='pubsub#owner' label='Node owners' type='jid-multi'>
  992. <value>hamlet@denmark.lit</value>
  993. </field>
  994. <field var='pubsub#publisher' label='Publishers to this node' type='jid-multi'>
  995. <value>hamlet@denmark.lit</value>
  996. </field>
  997. <field var='pubsub#num_subscribers' label='Number of subscribers to this node' type='text-single'>
  998. <value>1066</value>
  999. </field>
  1000. </x>
  1001. </query>
  1002. </iq>
  1003. ]]></example>
  1004. <p>Note: Node meta-data can be set in many ways. Some of it is based on node configuration (e.g., the owner's JID) whereas some of it may be dynamic (e.g., the number of subscribers). Any static information to be provided in the node meta-data SHOULD be provided as fields in the node configuration form.</p>
  1005. <p>Note: The pubsub#language field SHOULD be list-single so that the pubsub service can present an appropriate list of languages and language codes.</p>
  1006. </section2>
  1007. <section2 topic='Discover Items for a Node' anchor='entity-discoveritems'>
  1008. <p>To discover the published items which exist on the service for a specific node, an entity MAY send a "disco#items" request to the node itself, and the service MAY return each item as a Service Discovery &ITEM; element. The 'name' attribute of each Service Discovery item MUST contain its ItemID and the item MUST NOT possess a 'node' attribute. This ItemID MAY then be used to retrieve the item using the protocol defined in the <link url='#subscriber-retrieve'>Retrieve Items from a Node</link> section of this document.</p>
  1009. <example caption='Entity requests all of the items for a node'><![CDATA[
  1010. <iq type='get'
  1011. from='francisco@denmark.lit/barracks'
  1012. to='pubsub.shakespeare.lit'
  1013. id='items1'>
  1014. <query xmlns='http://jabber.org/protocol/disco#items'
  1015. node='princely_musings'/>
  1016. </iq>
  1017. <iq type='result'
  1018. from='pubsub.shakespeare.lit'
  1019. to='francisco@denmark.lit/barracks'
  1020. id='items1'>
  1021. <query xmlns='http://jabber.org/protocol/disco#items'
  1022. node='princely_musings'>
  1023. <item jid='pubsub.shakespeare.lit' name='368866411b877c30064a5f62b917cffe'/>
  1024. <item jid='pubsub.shakespeare.lit' name='3300659945416e274474e469a1f0154c'/>
  1025. <item jid='pubsub.shakespeare.lit' name='4e30f35051b7b8b42abe083742187228'/>
  1026. <item jid='pubsub.shakespeare.lit' name='ae890ac52d0df67ed7cfdf51b644e901'/>
  1027. </query>
  1028. </iq>
  1029. ]]></example>
  1030. </section2>
  1031. <section2 topic='Retrieve Subscriptions' anchor='entity-subscriptions'>
  1032. <p>An entity may want to query the service to retrieve its subscriptions for all nodes at the service. Support for this feature ("retrieve-subscriptions") is RECOMMENDED.</p>
  1033. <p>In order to make the request, the requesting entity MUST send an IQ-get whose &PUBSUB; child contains an empty &lt;subscriptions/&gt; element with no attributes.</p>
  1034. <example caption='Entity requests all current subscriptions'><![CDATA[
  1035. <iq type='get'
  1036. from='francisco@denmark.lit/barracks'
  1037. to='pubsub.shakespeare.lit'
  1038. id='subscriptions1'>
  1039. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  1040. <subscriptions/>
  1041. </pubsub>
  1042. </iq>
  1043. ]]></example>
  1044. <p>If the service returns a list of subscriptions, it MUST return all subscriptions for all JIDs that match the bare JID &BAREJID; portion of the 'from' attribute on the request.</p>
  1045. <p>For each subscription, a &lt;subscription/&gt; element is returned specifying the NodeID, the JID that is affiliated (which MAY include a resource, depending on how the entity subscribed), and the current subscription state. If subscription identifiers are supported by the service, the 'subid' attribute MUST be present as well.</p>
  1046. <example caption='Service returns all current subscriptions'><![CDATA[
  1047. <iq type='result'
  1048. from='pubsub.shakespeare.lit'
  1049. to='francisco@denmark.lit'
  1050. id='subscriptions1'>
  1051. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  1052. <subscriptions>
  1053. <subscription node='node1' jid='francisco@denmark.lit' subscription='subscribed'/>
  1054. <subscription node='node2' jid='francisco@denmark.lit' subscription='subscribed'/>
  1055. <subscription node='node5' jid='francisco@denmark.lit' subscription='unconfigured'/>
  1056. <subscription node='node6' jid='francisco@denmark.lit' subscription='subscribed' subid='123-abc'/>
  1057. <subscription node='node6' jid='francisco@denmark.lit' subscription='subscribed' subid='004-yyy'/>
  1058. </subscriptions>
  1059. </pubsub>
  1060. </iq>
  1061. ]]></example>
  1062. <p>If the requesting entity has no subscriptions, the pubsub service MUST return an empty &lt;subscriptions/&gt; element.</p>
  1063. <example caption='No subscriptions'><![CDATA[
  1064. <iq type='result'
  1065. from='pubsub.shakespeare.lit'
  1066. to='francisco@denmark.lit/barracks'
  1067. id='subscriptions1'>
  1068. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  1069. <subscriptions/>
  1070. </pubsub>
  1071. </iq>
  1072. ]]></example>
  1073. <p>If the service does not support subscriptions retrieval, the service MUST respond with a &feature; error, specifying a pubsub-specific error condition of &lt;unsupported/&gt; and a feature of "retrieve-subscriptions".</p>
  1074. <example caption='Subscriptions retrieval not supported'><![CDATA[
  1075. <iq type='error'
  1076. from='pubsub.shakespeare.lit'
  1077. to='francisco@denmark.lit/barracks'
  1078. id='subscriptions1'>
  1079. <error type='cancel'>
  1080. <feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  1081. <unsupported xmlns='http://jabber.org/protocol/pubsub#errors'
  1082. feature='retrieve-subscriptions'/>
  1083. </error>
  1084. </iq>
  1085. ]]></example>
  1086. <p>An entity MAY also request all of its subscriptions at a specific node (e.g., if it has subscriptions with multiple SubIDs) by including a 'node' attribute on the &lt;subscriptions/&gt; element.</p>
  1087. <example caption='Entity requests current subscriptions from a specific node'><![CDATA[
  1088. <iq type='get'
  1089. from='francisco@denmark.lit/barracks'
  1090. to='pubsub.shakespeare.lit'
  1091. id='subscriptions2'>
  1092. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  1093. <subscriptions node='princely_musings'/>
  1094. </pubsub>
  1095. </iq>
  1096. ]]></example>
  1097. <p>The service would then return only the entity's subscriptions to that specific node; this acts as a filter on the entity's subscriptions.</p>
  1098. <example caption='Service returns all current subscriptions to a specific node'><![CDATA[
  1099. <iq type='result'
  1100. from='pubsub.shakespeare.lit'
  1101. to='francisco@denmark.lit'
  1102. id='subscriptions2'>
  1103. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  1104. <subscriptions node='node6'>
  1105. <subscription node='node6' jid='francisco@denmark.lit' subscription='subscribed' subid='123-abc'/>
  1106. <subscription node='node6' jid='francisco@denmark.lit' subscription='subscribed' subid='004-yyy'/>
  1107. </subscriptions>
  1108. </pubsub>
  1109. </iq>
  1110. ]]></example>
  1111. </section2>
  1112. <section2 topic='Retrieve Affiliations' anchor='entity-affiliations'>
  1113. <p>An entity may want to query the service to retrieve its affiliations for all nodes at the service, or query a specific node for its affiliation with that node. Support for this feature ("retrieve-affiliations") is RECOMMENDED.</p>
  1114. <p>In order to make the request of the service, the requesting entity includes an empty &lt;affiliations/&gt; element with no attributes.</p>
  1115. <example caption='Entity requests all current affiliations'><![CDATA[
  1116. <iq type='get'
  1117. from='francisco@denmark.lit/barracks'
  1118. to='pubsub.shakespeare.lit'
  1119. id='affil1'>
  1120. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  1121. <affiliations/>
  1122. </pubsub>
  1123. </iq>
  1124. ]]></example>
  1125. <p>If the service returns a list of affiliations, it MUST return all affiliations for all JIDs that match the bare JID &BAREJID; portion of the 'from' attribute on the request.</p>
  1126. <p>For each affiliation, an &lt;affiliation/&gt; element is returned containing the NodeID and the affiliation state (owner, publisher, publish-only, member, or outcast).</p>
  1127. <example caption='Service replies with all current affiliations'><![CDATA[
  1128. <iq type='result'
  1129. from='pubsub.shakespeare.lit'
  1130. to='francisco@denmark.lit'
  1131. id='affil1'>
  1132. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  1133. <affiliations>
  1134. <affiliation node='node1' affiliation='owner'/>
  1135. <affiliation node='node2' affiliation='publisher'/>
  1136. <affiliation node='node5' affiliation='outcast'/>
  1137. <affiliation node='node6' affiliation='owner'/>
  1138. </affiliations>
  1139. </pubsub>
  1140. </iq>
  1141. ]]></example>
  1142. <p>If the requesting entity has no affiliations, the pubsub service MUST return an empty &lt;affiliations/&gt; element.</p>
  1143. <example caption='No affiliations'><![CDATA[
  1144. <iq type='result'
  1145. from='pubsub.shakespeare.lit'
  1146. to='francisco@denmark.lit/barracks'
  1147. id='affil1'>
  1148. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  1149. <affiliations/>
  1150. </pubsub>
  1151. </iq>
  1152. ]]></example>
  1153. <p>If the service does not support affiliations retrieval, the service MUST respond with a &feature; error, specifying a pubsub-specific error condition of &lt;unsupported/&gt; and a feature of "retrieve-affiliations".</p>
  1154. <example caption='Affiliations retrieval not supported'><![CDATA[
  1155. <iq type='error'
  1156. from='pubsub.shakespeare.lit'
  1157. to='francisco@denmark.lit/barracks'
  1158. id='affil1'>
  1159. <error type='cancel'>
  1160. <feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  1161. <unsupported xmlns='http://jabber.org/protocol/pubsub#errors'
  1162. feature='retrieve-affiliations'/>
  1163. </error>
  1164. </iq>
  1165. ]]></example>
  1166. <p>In order to make an affiliations request of a specific node, the requesting entity includes an empty &lt;affiliations/&gt; element with a 'node' attribute.</p>
  1167. <example caption='Entity requests affiliation at a specific node'><![CDATA[
  1168. <iq type='get'
  1169. from='francisco@denmark.lit/barracks'
  1170. to='pubsub.shakespeare.lit'
  1171. id='affil2'>
  1172. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  1173. <affiliations node='node6'/>
  1174. </pubsub>
  1175. </iq>
  1176. ]]></example>
  1177. <example caption='Service replies with current affiliation'><![CDATA[
  1178. <iq type='result'
  1179. from='pubsub.shakespeare.lit'
  1180. to='francisco@denmark.lit'
  1181. id='affil2'>
  1182. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  1183. <affiliations>
  1184. <affiliation node='node6' affiliation='owner'/>
  1185. </affiliations>
  1186. </pubsub>
  1187. </iq>
  1188. ]]></example>
  1189. </section2>
  1190. </section1>
  1191. <section1 topic='Subscriber Use Cases' anchor='subscriber'>
  1192. <p>This section defines the use cases for and protocols to be used by potential and actual subscribers. (Note: The <link url='#impl'>Implementation Notes</link> section of this document describes many important factors and business rules which a pubsub service MUST observe. In addition, the examples throughout assume the existence of a separate pubsub component and include any relevant 'from' addresses as stamped by a server or network edge.)</p>
  1193. <section2 topic='Subscribe to a Node' anchor='subscriber-subscribe'>
  1194. <section3 topic='Request' anchor='subscriber-subscribe-request'>
  1195. <p>When an XMPP entity wishes to subscribe to a node, it sends a subscription request to the pubsub service. The subscription request is an IQ-set where the &lt;pubsub/&gt; element contains one and only one &lt;subscribe/&gt; element. The &lt;subscribe/&gt; element SHOULD possess a 'node' attribute specifying the node to which the entity wishes to subscribe. The &lt;subscribe/&gt; element MUST also possess a 'jid' attribute specifying the exact XMPP address to be used as the subscribed JID -- often a bare JID &BAREJID; or full JID &FULLJID;.</p>
  1196. <p>Here is an example of a subscription request.</p>
  1197. <example caption='Entity subscribes to a node'><![CDATA[
  1198. <iq type='set'
  1199. from='francisco@denmark.lit/barracks'
  1200. to='pubsub.shakespeare.lit'
  1201. id='sub1'>
  1202. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  1203. <subscribe
  1204. node='princely_musings'
  1205. jid='francisco@denmark.lit'/>
  1206. </pubsub>
  1207. </iq>
  1208. ]]></example>
  1209. </section3>
  1210. <section3 topic='Success Case' anchor='subscriber-subscribe-success'>
  1211. <p>If the subscription request is successfully processed, the server MUST inform the requesting entity that it is now subscribed (which MAY include a service-generated SubID).</p>
  1212. <example caption='Service replies with success'><![CDATA[
  1213. <iq type='result'
  1214. from='pubsub.shakespeare.lit'
  1215. to='francisco@denmark.lit/barracks'
  1216. id='sub1'>
  1217. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  1218. <subscription
  1219. node='princely_musings'
  1220. jid='francisco@denmark.lit'
  1221. subid='ba49252aaa4f5d320c24d3766f0bdcade78c78d3'
  1222. subscription='subscribed'/>
  1223. </pubsub>
  1224. </iq>
  1225. ]]></example>
  1226. </section3>
  1227. <section3 topic='Error Cases' anchor='subscriber-subscribe-error'>
  1228. <p>There are several reasons why the subscription request might fail:</p>
  1229. <ol>
  1230. <li>The bare JID portions of the JIDs do not match.</li>
  1231. <li>The node has an access model of "presence" and the requesting entity is not subscribed to the owner's presence.</li>
  1232. <li>The node has an access model of "roster" and the requesting entity is not in one of the authorized roster groups.</li>
  1233. <li>The node has an access model of "whitelist" and the requesting entity is not on the whitelist.</li>
  1234. <li>The service requires payment for subscriptions to the node.</li>
  1235. <li>The requesting entity is anonymous and the service does not allow anonymous entities to subscribe.</li>
  1236. <li>The requesting entity has a pending subscription.</li>
  1237. <li>The requesting entity is blocked from subscribing (e.g., because having an affiliation of outcast).</li>
  1238. <li>The requesting entity has attempted to establish too many subscriptions.</li>
  1239. <li>The node does not support subscriptions.</li>
  1240. <li>The node has moved.</li>
  1241. <li>The node does not exist.</li>
  1242. </ol>
  1243. <p>These error cases are described more fully in the following sections.</p>
  1244. <section4 topic='JIDs Do Not Match' anchor='subscriber-subscribe-error-nomatch'>
  1245. <p>If the specified JID is a bare JID or full JID, the service MUST at a minimum check the bare JID portion against the bare JID portion of the 'from' attribute on the received IQ request to make sure that the requesting entity has the same identity as the JID which is being requested to be added to the subscriber list.</p>
  1246. <p>If the bare JID portions of the JIDs do not match as described above and the requesting entity does not have some kind of admin or proxy privilege as defined by the implementation, the service MUST return a &badrequest; error, which SHOULD also include a pubsub-specific error condition of &lt;invalid-jid/&gt;.</p>
  1247. <example caption='JIDs do not match'><![CDATA[
  1248. <iq type='error'
  1249. from='pubsub.shakespeare.lit'
  1250. to='francisco@denmark.lit/barracks'
  1251. id='sub1'>
  1252. <error type='modify'>
  1253. <bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  1254. <invalid-jid xmlns='http://jabber.org/protocol/pubsub#errors'/>
  1255. </error>
  1256. </iq>
  1257. ]]></example>
  1258. <p>Note: An implementation MAY enable the service administrator to configure a list of entities that are excluded from this check; those entities may be considered "trusted proxies" that are allowed to subscribe on behalf of other entities. In the same way, implementations MAY enable blacklisting of entities that are not allowed to perform specific operations (such as subscribing or creating nodes).</p>
  1259. </section4>
  1260. <section4 topic='Presence Subscription Required' anchor='subscriber-subscribe-error-presence'>
  1261. <p>For nodes with an access model of "presence", if the requesting entity is not subscribed to the owner's presence then the pubsub service MUST respond with a &notauthorized; error, which SHOULD also include a pubsub-specific error condition of &lt;presence-subscription-required/&gt;.</p>
  1262. <example caption='Entity is not authorized to create a subscription (presence subscription required)'><![CDATA[
  1263. <iq type='error'
  1264. from='pubsub.shakespeare.lit'
  1265. to='francisco@denmark.lit/barracks'
  1266. id='sub1'>
  1267. <error type='auth'>
  1268. <not-authorized xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  1269. <presence-subscription-required xmlns='http://jabber.org/protocol/pubsub#errors'/>
  1270. </error>
  1271. </iq>
  1272. ]]></example>
  1273. </section4>
  1274. <section4 topic='Not in Roster Group' anchor='subscriber-subscribe-error-rostergroup'>
  1275. <p>For nodes with an access model of "roster", if the requesting entity is not in one of the authorized roster groups then the pubsub service MUST respond with a &notauthorized; error, which SHOULD also include a pubsub-specific error condition of &lt;not-in-roster-group/&gt;.</p>
  1276. <example caption='Entity is not authorized to create a subscription (not in roster group)'><![CDATA[
  1277. <iq type='error'
  1278. from='pubsub.shakespeare.lit'
  1279. to='francisco@denmark.lit/barracks'
  1280. id='sub1'>
  1281. <error type='auth'>
  1282. <not-authorized xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  1283. <not-in-roster-group xmlns='http://jabber.org/protocol/pubsub#errors'/>
  1284. </error>
  1285. </iq>
  1286. ]]></example>
  1287. </section4>
  1288. <section4 topic='Not on Whitelist' anchor='subscriber-subscribe-error-whitelist'>
  1289. <p>For nodes with a node access model of "whitelist", if the requesting entity is not on the whitelist then the service MUST return a &notallowed; error, specifying a pubsub-specific error condition of &lt;closed-node/&gt;.</p>
  1290. <example caption='Node has whitelist access model'><![CDATA[
  1291. <iq type='error'
  1292. from='pubsub.shakespeare.lit'
  1293. to='francisco@denmark.lit/barracks'
  1294. id='sub1'>
  1295. <error type='cancel'>
  1296. <not-allowed xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  1297. <closed-node xmlns='http://jabber.org/protocol/pubsub#errors'/>
  1298. </error>
  1299. </iq>
  1300. ]]></example>
  1301. </section4>
  1302. <section4 topic='Payment Required' anchor='subscriber-subscribe-error-payment'>
  1303. <p>Commercial deployments may wish to link subscribers to a database of paying customers. If the subscriber needs to provide payment in order to subscribe to the node (e.g., if the subscriber is not in the customer database or the customer's account is not paid up), the service SHOULD return a &payment; error to the subscriber.</p>
  1304. <example caption='Payment is required for a subscription'><![CDATA[
  1305. <iq type='error'
  1306. from='pubsub.shakespeare.lit'
  1307. to='francisco@denmark.lit/barracks'
  1308. id='sub1'>
  1309. <error type='auth'>
  1310. <payment-required xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  1311. </error>
  1312. </iq>
  1313. ]]></example>
  1314. </section4>
  1315. <section4 topic='Anonymous Subscriptions Not Allowed' anchor='subscriber-subscribe-error-anonymous'>
  1316. <p>Some XMPP servers may allow authentication using SASL ANONYMOUS; however, because the resulting entity is unstable (the assigned JID may not be owned by the same principal in a persistent manner), a service MAY prevent anonymous entities from subscribing to nodes and SHOULD use service discovery to determine if an entity has an identity of "account/anonymous". If a requesting entity is anonymous but the service does not allow anonymous entities to subscribe, the service SHOULD return a &forbidden; error to the subscriber.</p>
  1317. <example caption='Requesting entity is anonymous'><![CDATA[
  1318. <iq type='error'
  1319. from='pubsub.shakespeare.lit'
  1320. to='anonymous@denmark.lit/foo'
  1321. id='sub1'>
  1322. <error type='cancel'>
  1323. <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  1324. </error>
  1325. </iq>
  1326. ]]></example>
  1327. </section4>
  1328. <section4 topic='Subscription Pending' anchor='subscriber-subscribe-error-pending'>
  1329. <p>If the requesting entity has a pending subscription, the service MUST return a &notauthorized; error to the subscriber, specifying a pubsub-specific error condition of &lt;pending-subscription/&gt;.</p>
  1330. <example caption='Requesting entity has pending subscription'><![CDATA[
  1331. <iq type='error'
  1332. from='pubsub.shakespeare.lit'
  1333. to='francisco@denmark.lit/barracks'
  1334. id='sub1'>
  1335. <error type='auth'>
  1336. <not-authorized xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  1337. <pending-subscription xmlns='http://jabber.org/protocol/pubsub#errors'/>
  1338. </error>
  1339. </iq>
  1340. ]]></example>
  1341. </section4>
  1342. <section4 topic='Blocked' anchor='subscriber-subscribe-error-blocked'>
  1343. <p>If the requesting entity is blocked from subscribing (e.g., because having an affiliation of outcast), the service MUST return a &forbidden; error to the subscriber.</p>
  1344. <example caption='Requesting entity is blocked'><![CDATA[
  1345. <iq type='error'
  1346. from='pubsub.shakespeare.lit'
  1347. to='francisco@denmark.lit/barracks'
  1348. id='sub1'>
  1349. <error type='auth'>
  1350. <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  1351. </error>
  1352. </iq>
  1353. ]]></example>
  1354. </section4>
  1355. <section4 topic='Too Many Subscriptions' anchor='subscriber-subscribe-error-toomany'>
  1356. <p>If the requesting entity has attempted to establish too many subscriptions (where the definition of "too many" is a matter of local service policy), the service MUST return a &policy; error to the subscriber, specifying a pubsub-specific error condition of &lt;too-many-subscriptions/&gt;.</p>
  1357. <example caption='Requesting entity has exceeded limit on number of subscriptions'><![CDATA[
  1358. <iq type='error'
  1359. from='pubsub.shakespeare.lit'
  1360. to='francisco@denmark.lit/barracks'
  1361. id='sub1'>
  1362. <error type='wait'>
  1363. <policy-violation xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  1364. <too-many-subscriptions xmlns='http://jabber.org/protocol/pubsub#errors'/>
  1365. </error>
  1366. </iq>
  1367. ]]></example>
  1368. <p>The service can match on bare JID or full JID in determining which subscribing entities match for the purpose of determining if an entity has requested too many subscriptions.</p>
  1369. </section4>
  1370. <section4 topic='Subscriptions Not Supported' anchor='subscriber-subscribe-error-unsupported'>
  1371. <p>If the node does not allow entities to subscribe, the service SHOULD return a &feature; error to the subscriber, specifying a pubsub-specific error condition of &lt;unsupported/&gt; and a feature of "subscribe".</p>
  1372. <example caption='Subscribing not supported'><![CDATA[
  1373. <iq type='error'
  1374. from='pubsub.shakespeare.lit'
  1375. to='francisco@denmark.lit/barracks'
  1376. id='sub1'>
  1377. <error type='cancel'>
  1378. <feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  1379. <unsupported xmlns='http://jabber.org/protocol/pubsub#errors'
  1380. feature='subscribe'/>
  1381. </error>
  1382. </iq>
  1383. ]]></example>
  1384. </section4>
  1385. <section4 topic='Node Has Moved' anchor='subscriber-subscribe-error-redirect'>
  1386. <p>If the node has, the service SHOULD return a &gone; error (if the node has moved permanently) or a &redirect; error (if the node has moved temporarily).</p>
  1387. <example caption='Node has moved'><![CDATA[
  1388. <iq type='error'
  1389. from='pubsub.shakespeare.lit'
  1390. to='francisco@denmark.lit/barracks'
  1391. id='sub1'>
  1392. <error type='modify'>
  1393. <gone xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'>
  1394. xmpp:pubsub.shakespeare.lit?;node=some-other-node
  1395. </gone>
  1396. </error>
  1397. </iq>
  1398. ]]></example>
  1399. </section4>
  1400. <section4 topic='Node Does Not Exist' anchor='subscriber-subscribe-error-node'>
  1401. <p>If the node does not exist, the service SHOULD return an &notfound; error to the subscriber.</p>
  1402. <example caption='Node does not exist'><![CDATA[
  1403. <iq type='error'
  1404. from='pubsub.shakespeare.lit'
  1405. to='francisco@denmark.lit/barracks'
  1406. id='sub1'>
  1407. <error type='cancel'>
  1408. <item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  1409. </error>
  1410. </iq>
  1411. ]]></example>
  1412. </section4>
  1413. </section3>
  1414. <section3 topic='Approval Required' anchor='subscriber-subscribe-approval'>
  1415. <p>For nodes with an access model of "authorize", subscription requests MUST be approved by one of the node owners unless service policy allows entities with affiliations other than "none" to auto-subscribe (e.g., members and publishers might be allowed to auto-subscribe); therefore the pubsub service sends a message to the node owner(s) requesting authorization (see the <link url='#owner-subreq'>Manage Subscription Requests</link> section of this document). Because the subscription request may or may not be approved, the service MUST return a pending notification to the subscriber.</p>
  1416. <example caption='Service replies with pending'><![CDATA[
  1417. <iq type='result'
  1418. from='pubsub.shakespeare.lit'
  1419. to='francisco@denmark.lit/barracks'
  1420. id='sub1'>
  1421. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  1422. <subscription
  1423. node='princely_musings'
  1424. jid='francisco@denmark.lit'
  1425. subscription='pending'/>
  1426. </pubsub>
  1427. </iq>
  1428. ]]></example>
  1429. </section3>
  1430. <section3 topic='Configuration Required' anchor='subscriber-subscribe-configure'>
  1431. <p>If the entity must configure its subscription options (see the <link url='#subscriber-configure'>Configure Subscription Options</link> section of this document) before receiving event notifications, the service MUST so inform the entity. It SHOULD do so by returning an IQ-result to the requesting entity with a notation that configuration of subscription options is required.</p>
  1432. <example caption='Service replies with success and indicates that subscription configuration is required'><![CDATA[
  1433. <iq type='result'
  1434. from='pubsub.shakespeare.lit'
  1435. to='francisco@denmark.lit/barracks'
  1436. id='sub1'>
  1437. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  1438. <subscription
  1439. node='princely_musings'
  1440. jid='francisco@denmark.lit'
  1441. subscription='unconfigured'>
  1442. <subscribe-options>
  1443. <required/>
  1444. </subscribe-options>
  1445. </subscription>
  1446. </pubsub>
  1447. </iq>
  1448. ]]></example>
  1449. <p>Note: The node shall include the &lt;required/&gt; child element only if the subscriber must configure the subscription before receiving any event notifications. A service MAY time out subscription requests if configuration is required and a configuration request is not submitted within a reasonable amount of time (which shall be determined by the service or node configuration).</p>
  1450. <p>Alternatively, if the service is unable to create the subscription without simultaneous configuration, the service MAY return a &notacceptable; error, specifying a pubsub-specific error condition of &lt;configuration-required/&gt;.</p>
  1451. <example caption='Service returns error specifying that subscription configuration is required'><![CDATA[
  1452. <iq type='error'
  1453. from='pubsub.shakespeare.lit'
  1454. to='francisco@denmark.lit/barracks'
  1455. id='sub1'>
  1456. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  1457. <subscribe
  1458. node='princely_musings'
  1459. jid='francisco@denmark.lit'/>
  1460. <options node='princely_musings' jid='francisco@denmark.lit'>
  1461. <x xmlns='jabber:x:data' type='submit'>
  1462. <field var='FORM_TYPE' type='hidden'>
  1463. <value>http://jabber.org/protocol/pubsub#subscribe_options</value>
  1464. </field>
  1465. <field var='pubsub#deliver'><value>1</value></field>
  1466. <field var='pubsub#digest'><value>0</value></field>
  1467. <field var='pubsub#include_body'><value>false</value></field>
  1468. <field var='pubsub#show-values'>
  1469. <value>chat</value>
  1470. <value>online</value>
  1471. <value>away</value>
  1472. </field>
  1473. </x>
  1474. </options>
  1475. </pubsub>
  1476. <error type='modify'>
  1477. <not-acceptable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  1478. <configuration-required xmlns='http://jabber.org/protocol/pubsub#errors'/>
  1479. </error>
  1480. </iq>
  1481. ]]></example>
  1482. <p>If the &lt;required/&gt; element is not included and no error is returned, the subscription takes effect immediately and the entity may configure the subscription at any time (the service MAY indicate that subscription options are supported by including an empty &lt;subscribe-options/&gt; element in the IQ-result, as shown in the following example).</p>
  1483. <example caption='Service replies with success and indicates that subscription options are supported but not required'><![CDATA[
  1484. <iq type='result'
  1485. from='pubsub.shakespeare.lit'
  1486. to='francisco@denmark.lit/barracks'
  1487. id='sub1'>
  1488. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  1489. <subscription
  1490. node='princely_musings'
  1491. jid='francisco@denmark.lit'
  1492. subscription='unconfigured'>
  1493. <subscribe-options/>
  1494. </subscription>
  1495. </pubsub>
  1496. </iq>
  1497. ]]></example>
  1498. </section3>
  1499. <section3 topic='Multiple Subscriptions' anchor='subscriber-subscribe-multi'>
  1500. <p>An entity may wish to subscribe using different subscription options, which it can do by subscribing multiple times to the same node. Support for this feature ("multi-subscribe") is OPTIONAL.</p>
  1501. <p>If multiple subscriptions for the same JID are allowed, the service MUST use the 'subid' attribute to differentiate between subscriptions for the same entity (therefore the SubID MUST be unique for each node+JID combination and the SubID MUST be present on the entity element any time it is sent to the subscriber). It is NOT RECOMMENDED for clients to generate SubIDs, since collisions might result; therefore a service SHOULD generate the SubID on behalf of the subscriber and MAY overwrite SubIDs if they are provided by subscribers. If the service does not allow multiple subscriptions for the same entity and it receives an additional subscription request, the service MUST return the current subscription state (as if the subscription was just approved).</p>
  1502. <p>When the pubsub service generates event notifications, it SHOULD send only one event notification to an entity that has multiple subscriptions, rather than one event notification for each subscription. By "entity" here is meant the JID specified for the subscription, whether bare JID or full JID; however, if the same bare JID has multiple subscriptions but those subscriptions are for different full JIDs (e.g., one subscription for user@domain.tld./foo and another subscription for user@domain.tld/bar), the service MUST treat those as separate JIDs for the purpose of generating event notifications.</p>
  1503. </section3>
  1504. <section3 topic='Receiving the Last Published Item' anchor='subscriber-subscribe-last'>
  1505. <p>When a subscription request is successfully processed, the service MAY send the last published item to the new subscriber. The message containing this item SHOULD be stamped with extended information qualified by the 'urn:xmpp:delay' namespace (see &xep0203;) to indicate it is sent with delayed delivery. (Note that in this example the event notification is sent to the bare JID since that is the subscribed JID.)</p>
  1506. <example caption='Service sends last published item'><![CDATA[
  1507. <message from='pubsub.shakespeare.lit' to='francisco@denmark.lit'>
  1508. <event xmlns='http://jabber.org/protocol/pubsub#event'>
  1509. <items node='princely_musings'>
  1510. <item id='ae890ac52d0df67ed7cfdf51b644e901'>
  1511. <entry xmlns='http://www.w3.org/2005/Atom'>
  1512. <title>Soliloquy</title>
  1513. <summary>
  1514. To be, or not to be: that is the question:
  1515. Whether 'tis nobler in the mind to suffer
  1516. The slings and arrows of outrageous fortune,
  1517. Or to take arms against a sea of troubles,
  1518. And by opposing end them?
  1519. </summary>
  1520. <link rel='alternate' type='text/html'
  1521. href='http://denmark.lit/2003/12/13/atom03'/>
  1522. <id>tag:denmark.lit,2003:entry-32397</id>
  1523. <published>2003-12-13T18:30:02Z</published>
  1524. <updated>2003-12-13T18:30:02Z</updated>
  1525. </entry>
  1526. </item>
  1527. </items>
  1528. </event>
  1529. <delay xmlns='urn:xmpp:delay' stamp='2003-12-13T23:58:37Z'/>
  1530. </message>
  1531. ]]></example>
  1532. <p>If the service sends the last published item by default for all nodes (subject to overriding by node configuration), it MUST return a feature of "http://jabber.org/protocol/pubsub#last-published" in its responsess to disco#info requests.</p>
  1533. </section3>
  1534. </section2>
  1535. <section2 topic='Unsubscribe from a Node' anchor='subscriber-unsubscribe'>
  1536. <section3 topic='Request' anchor='subscriber-unsubscribe-request'>
  1537. <p>To unsubscribe from a node, the subscriber sends an IQ-set whose &PUBSUB; child contains an &lt;unsubscribe/&gt; element that specifies the node and the subscribed JID.</p>
  1538. <example caption='Entity unsubscribes from a node'><![CDATA[
  1539. <iq type='set'
  1540. from='francisco@denmark.lit/barracks'
  1541. to='pubsub.shakespeare.lit'
  1542. id='unsub1'>
  1543. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  1544. <unsubscribe
  1545. node='princely_musings'
  1546. jid='francisco@denmark.lit'/>
  1547. </pubsub>
  1548. </iq>
  1549. ]]></example>
  1550. </section3>
  1551. <section3 topic='Success Case' anchor='subscriber-unsubscribe-success'>
  1552. <p>If the request can be successfully processed, the service MUST return an IQ result and MAY include a &PUBSUB; child element with the updated &lt;subscription/&gt; element for that node. If subscription identifiers are supported by the service, the 'subid' attribute MUST be present as well.</p>
  1553. <example caption='Service replies with success'><![CDATA[
  1554. <iq type='result'
  1555. from='pubsub.shakespeare.lit'
  1556. to='francisco@denmark.lit/barracks'
  1557. id='unsub1'>
  1558. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  1559. <subscription
  1560. node='princely_musings'
  1561. jid='francisco@denmark.lit'
  1562. subscription='none'
  1563. subid='ba49252aaa4f5d320c24d3766f0bdcade78c78d3'/>
  1564. </pubsub>
  1565. </iq>
  1566. ]]></example>
  1567. </section3>
  1568. <section3 topic='Error Cases' anchor='subscriber-unsubscribe-error'>
  1569. <p>There are several reasons why the unsubscribe request might fail:</p>
  1570. <ol>
  1571. <li>The requesting entity has multiple subscriptions to the node but does not specify a subscription ID.</li>
  1572. <li>The request does not specify an existing subscriber.</li>
  1573. <li>The requesting entity does not have sufficient privileges to unsubscribe the specified JID.</li>
  1574. <li>The node does not exist.</li>
  1575. <li>The request specifies a subscription ID that is not valid or current.</li>
  1576. </ol>
  1577. <p>These error cases are described more fully in the following sections.</p>
  1578. <section4 topic='No Subscription ID' anchor='subscriber-unsubscribe-error-nosubid'>
  1579. <p>If the requesting entity has multiple subscriptions to the node but does not specify a subscription ID, the service MUST return a &badrequest; error, which SHOULD also include a pubsub-specific error condition of &lt;subid-required/&gt;.</p>
  1580. <example caption='Entity did not specify SubID'><![CDATA[
  1581. <iq type='error'
  1582. from='pubsub.shakespeare.lit'
  1583. to='francisco@denmark.lit/barracks'
  1584. id='unsub1'>
  1585. <error type='modify'>
  1586. <bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  1587. <subid-required xmlns='http://jabber.org/protocol/pubsub#errors'/>
  1588. </error>
  1589. </iq>
  1590. ]]></example>
  1591. </section4>
  1592. <section4 topic='No Such Subscriber' anchor='subscriber-unsubscribe-error-nosub'>
  1593. <p>If the value of the 'jid' attribute does not specify an existing subscriber, the pubsub service MUST return an error stanza, which SHOULD be &unexpected; and which SHOULD also include a pubsub-specific error condition of &lt;not-subscribed/&gt;.</p>
  1594. <example caption='Requesting entity is not a subscriber'><![CDATA[
  1595. <iq type='error'
  1596. from='pubsub.shakespeare.lit'
  1597. to='francisco@denmark.lit/barracks'
  1598. id='unsub1'>
  1599. <error type='cancel'>
  1600. <unexpected-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  1601. <not-subscribed xmlns='http://jabber.org/protocol/pubsub#errors'/>
  1602. </error>
  1603. </iq>
  1604. ]]></example>
  1605. </section4>
  1606. <section4 topic='Insufficient Privileges' anchor='subscriber-unsubscribe-error-forbidden'>
  1607. <p>If the requesting entity is prohibited from unsubscribing the specified JID, the service MUST return a &forbidden; error. The service MUST validate that the entity making the request is authorized to unsubscribe the entity. If the subscriber's JID is of the form &FULLJID;, a service MUST perform this check by comparing the &BAREJID; part of the two JIDs to ensure that they match. If the bare JID portions of the JIDs do not match and the requesting entity is not authorized to unsubscribe the JID (e.g., because it is not a service-wide admin or authorized proxy), the service MUST return a &forbidden; error.</p>
  1608. <example caption='Requesting entity is prohibited from unsubscribing entity'><![CDATA[
  1609. <iq type='error'
  1610. from='pubsub.shakespeare.lit'
  1611. to='francisco@denmark.lit/barracks'
  1612. id='unsub1'>
  1613. <error type='auth'>
  1614. <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  1615. </error>
  1616. </iq>
  1617. ]]></example>
  1618. </section4>
  1619. <section4 topic='Node Does Not Exist' anchor='subscriber-unsubscribe-error-node'>
  1620. <p>If the node does not exist, the pubsub service MUST return an &notfound; error.</p>
  1621. <example caption='Node does not exist'><![CDATA[
  1622. <iq type='error'
  1623. from='pubsub.shakespeare.lit'
  1624. to='francisco@denmark.lit/barracks'
  1625. id='unsub1'>
  1626. <error type='cancel'>
  1627. <item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  1628. </error>
  1629. </iq>
  1630. ]]></example>
  1631. </section4>
  1632. <section4 topic='Bad Subscription ID' anchor='subscriber-unsubscribe-error-badsubid'>
  1633. <p>If a subscription identifier is associated with the subscription, the unsubscribe request MUST include an appropriate 'subid' attribute. If the unsubscribe request includes a SubID but SubIDs are not supported for the node (or the subscriber did not subscribe using a SubID in the first place), the service SHOULD ignore the SubID and simply unsubscribe the entity. If the subscriber originally subscribed with a SubID but the unsubscribe request includes a SubID that is not valid or current for the subscriber, the service MUST return a &notacceptable; error, which SHOULD also include a pubsub-specific error condition of &lt;invalid-subid/&gt;.</p>
  1634. <example caption='Invalid subscription identifier'><![CDATA[
  1635. <iq type='error'
  1636. from='pubsub.shakespeare.lit'
  1637. to='francisco@denmark.lit/barracks'
  1638. id='unsub1'>
  1639. <error type='modify'>
  1640. <not-acceptable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  1641. <invalid-subid xmlns='http://jabber.org/protocol/pubsub#errors'/>
  1642. </error>
  1643. </iq>
  1644. ]]></example>
  1645. </section4>
  1646. </section3>
  1647. </section2>
  1648. <section2 topic='Configure Subscription Options' anchor='subscriber-configure'>
  1649. <p>An implementation MAY allow subscribers to configure subscription options. Implementations SHOULD use the <cite>Data Forms</cite> protocol to accomplish this configuration (however, an out-of-band mechanism such as a web interface could be offered as well).</p>
  1650. <section3 topic='Advertising Support' anchor='subscriber-configure-support'>
  1651. <p>If a service supports subscription options it MUST advertise that fact in its response to a "disco#info" query by including a feature whose 'var' attribute is "pubsub#subscription-options".</p>
  1652. <example caption='Pubsub service indicates support for subscription options'><![CDATA[
  1653. <iq type='result'
  1654. from='pubsub.shakespeare.lit'
  1655. to='francisco@denmark.lit/barracks'
  1656. id='feature1'>
  1657. <query xmlns='http://jabber.org/protocol/disco#info'>
  1658. ...
  1659. <feature var='http://jabber.org/protocol/pubsub#subscription-options'/>
  1660. ...
  1661. </query>
  1662. </iq>
  1663. ]]></example>
  1664. </section3>
  1665. <section3 topic='Request' anchor='subscriber-configure-request'>
  1666. <p>A subscriber requests the subscription options by including an &lt;options/&gt; element inside an IQ-get stanza.</p>
  1667. <example caption='Subscriber requests subscription options form'><![CDATA[
  1668. <iq type='get'
  1669. from='francisco@denmark.lit/barracks'
  1670. to='pubsub.shakespeare.lit'
  1671. id='options1'>
  1672. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  1673. <options node='princely_musings' jid='francisco@denmark.lit'/>
  1674. </pubsub>
  1675. </iq>
  1676. ]]></example>
  1677. </section3>
  1678. <section3 topic='Success Case' anchor='subscriber-configure-success'>
  1679. <p>If the request can be successfully processed, the service MUST respond with the options.</p>
  1680. <example caption='Service responds with the options form'><![CDATA[
  1681. <iq type='result'
  1682. from='pubsub.shakespeare.lit'
  1683. to='francisco@denmark.lit/barracks'
  1684. id='options1'>
  1685. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  1686. <options node='princely_musings' jid='francisco@denmark.lit'>
  1687. <x xmlns='jabber:x:data' type='form'>
  1688. <field var='FORM_TYPE' type='hidden'>
  1689. <value>http://jabber.org/protocol/pubsub#subscribe_options</value>
  1690. </field>
  1691. <field var='pubsub#deliver' type='boolean'
  1692. label='Enable delivery?'>
  1693. <value>1</value>
  1694. </field>
  1695. <field var='pubsub#digest' type='boolean'
  1696. label='Receive digest notifications (approx. one per day)?'>
  1697. <value>0</value>
  1698. </field>
  1699. <field var='pubsub#include_body' type='boolean'
  1700. label='Receive message body in addition to payload?'>
  1701. <value>false</value>
  1702. </field>
  1703. <field
  1704. var='pubsub#show-values'
  1705. type='list-multi'
  1706. label='Select the presence types which are
  1707. allowed to receive event notifications'>
  1708. <option label='Want to Chat'><value>chat</value></option>
  1709. <option label='Available'><value>online</value></option>
  1710. <option label='Away'><value>away</value></option>
  1711. <option label='Extended Away'><value>xa</value></option>
  1712. <option label='Do Not Disturb'><value>dnd</value></option>
  1713. <value>chat</value>
  1714. <value>online</value>
  1715. </field>
  1716. </x>
  1717. </options>
  1718. </pubsub>
  1719. </iq>
  1720. ]]></example>
  1721. <p>Note: The foregoing example shows some (but by no means all) of the possible configuration options that MAY be provided. If an implementation provides these options using the <strong>Data Forms</strong> protocol, it MUST use the field variables that are registered with the XMPP Registrar in association with the 'http://jabber.org/protocol/pubsub' namespace (a preliminary representation of those field variables is shown above and in the <link url='#registrar-formtypes-subscribe'>pubsub#subscribe_options FORM_TYPE</link> section of this document, but MUST NOT be construed as canonical since the XMPP Registrar may standardize additional fields at a later date without changes to this document).</p>
  1722. <p>Note: Many of the relevant data form fields are of type "boolean" and MUST be handled accordingly. &BOOLEANNOTE;</p>
  1723. </section3>
  1724. <section3 topic='Error Cases' anchor='subscriber-configure-error'>
  1725. <p>There are several reasons why the options request might fail:</p>
  1726. <ol>
  1727. <li>The requesting entity does not have sufficient privileges to modify subscription options for the specified JID.</li>
  1728. <li>The requesting entity (or specified subscriber) is not subscribed.</li>
  1729. <li>The request does not specify both the NodeID and the subscriber's JID.</li>
  1730. <li>The request does not specify a subscription ID but one is required.</li>
  1731. <li>The request specifies a subscription ID that is not valid or current.</li>
  1732. <li>Subscription options are not supported.</li>
  1733. <li>The node does not exist.</li>
  1734. </ol>
  1735. <p>These error cases are described more fully in the following sections.</p>
  1736. <section4 topic='Insufficient Privileges' anchor='subscriber-configure-error-forbidden'>
  1737. <p>When requesting subscription options, the subscriber MUST specify the JID that is subscribed to the node and SHOULD specify a node (if no node is specified, i.e. via node="", the service MUST assume that the requesting entity wishes to request subscription options for its subscription to the root collection node; refer to <cite>XEP-0248</cite> for details).</p>
  1738. <p>The service MUST validate that the entity making the request is authorized to set the subscription options for the subscribed entity. If the subscriber's JID is of the form &FULLJID;, a service MUST perform this check by comparing the &BAREJID; part of the two JIDs to ensure that they match. If the bare JID portions of the JIDs do not match and the requesting entity is not authorized to modify subscription options for the JID (e.g., because it is not a service-wide admin or authorized proxy), the service MUST return a &forbidden; error.</p>
  1739. <example caption='Requesting entity does not have sufficient privileges to modify subscription options'><![CDATA[
  1740. <iq type='error'
  1741. from='pubsub.shakespeare.lit'
  1742. to='francisco@denmark.lit/barracks'
  1743. id='sub1'>
  1744. <error type='auth'>
  1745. <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  1746. </error>
  1747. </iq>
  1748. ]]></example>
  1749. </section4>
  1750. <section4 topic='No Such Subscriber' anchor='subscriber-configure-error-nosub'>
  1751. <p>If the requesting entity (or specified subscriber, if different) is not subscribed, the service MUST return an &unexpected; error, which SHOULD also include a pubsub-specific error condition of &lt;not-subscribed/&gt;.</p>
  1752. <example caption='No such subscriber'><![CDATA[
  1753. <iq type='error'
  1754. from='pubsub.shakespeare.lit'
  1755. to='francisco@denmark.lit/barracks'
  1756. id='options1'>
  1757. <error type='modify'>
  1758. <unexpected-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  1759. <not-subscribed xmlns='http://jabber.org/protocol/pubsub#errors'/>
  1760. </error>
  1761. </iq>
  1762. ]]></example>
  1763. </section4>
  1764. <section4 topic='Subscriber JID Required' anchor='subscriber-configure-error-jid'>
  1765. <p>If the subscriber does not specify a subscriber JID, the service MUST return a &badrequest; error, which SHOULD also include a pubsub-specific error condition of &lt;jid-required/&gt;.</p>
  1766. <example caption='Subscriber JID not specified'><![CDATA[
  1767. <iq type='error'
  1768. from='pubsub.shakespeare.lit'
  1769. to='francisco@denmark.lit/barracks'
  1770. id='options1'>
  1771. <error type='modify'>
  1772. <bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  1773. <jid-required xmlns='http://jabber.org/protocol/pubsub#errors'/>
  1774. </error>
  1775. </iq>
  1776. ]]></example>
  1777. </section4>
  1778. <section4 topic='Subscription ID Required' anchor='subscriber-configure-error-subid'>
  1779. <p>If a subscription identifier is associated with the subscription, the 'subid' attribute MUST be present on the request in order for the service to differentiate subscriptions for the same entity. If the 'subid' is required but not provided, the service MUST return a &badrequest; error, which SHOULD also include a pubsub-specific error condition of &lt;subid-required/&gt;.</p>
  1780. <example caption='SubID required'><![CDATA[
  1781. <iq type='error'
  1782. from='pubsub.shakespeare.lit'
  1783. to='francisco@denmark.lit/barracks'
  1784. id='sub1'>
  1785. <error type='modify'>
  1786. <bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  1787. <subid-required xmlns='http://jabber.org/protocol/pubsub#errors'/>
  1788. </error>
  1789. </iq>
  1790. ]]></example>
  1791. </section4>
  1792. <section4 topic='Invalid Subscription ID' anchor='subscriber-configure-error-badsubid'>
  1793. <p>If a subscription identifier is associated with the subscription but the request includes a SubID that is not valid or current for the subscriber, the service MUST return a &notacceptable; error, which SHOULD also include a pubsub-specific error condition of &lt;invalid-subid/&gt;.</p>
  1794. <example caption='Invalid subscription identifier'><![CDATA[
  1795. <iq type='error'
  1796. from='pubsub.shakespeare.lit'
  1797. to='francisco@denmark.lit/barracks'
  1798. id='unsub1'>
  1799. <error type='modify'>
  1800. <not-acceptable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  1801. <invalid-subid xmlns='http://jabber.org/protocol/pubsub#errors'/>
  1802. </error>
  1803. </iq>
  1804. ]]></example>
  1805. </section4>
  1806. <section4 topic='Subscription Options Not Supported' anchor='subscriber-configure-error-options'>
  1807. <p>If the node or service does not support subscription options, the service MUST respond with a &feature; error, specifying a pubsub-specific error condition of &lt;unsupported/&gt; and a feature of "subscription-options".</p>
  1808. <example caption='Subscription options not supported'><![CDATA[
  1809. <iq type='error'
  1810. from='pubsub.shakespeare.lit'
  1811. to='francisco@denmark.lit/barracks'
  1812. id='options1'>
  1813. <error type='cancel'>
  1814. <feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  1815. <unsupported xmlns='http://jabber.org/protocol/pubsub#errors'
  1816. feature='subscription-options'/>
  1817. </error>
  1818. </iq>
  1819. ]]></example>
  1820. </section4>
  1821. <section4 topic='Node Does Not Exist' anchor='subscriber-configure-error-node'>
  1822. <p>If the node does not exist, the pubsub service MUST return an &notfound; error.</p>
  1823. <example caption='Node does not exist'><![CDATA[
  1824. <iq type='error'
  1825. from='pubsub.shakespeare.lit'
  1826. to='francisco@denmark.lit/barracks'
  1827. id='options1'>
  1828. <error type='cancel'>
  1829. <item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  1830. </error>
  1831. </iq>
  1832. ]]></example>
  1833. </section4>
  1834. </section3>
  1835. <section3 topic='Form Submission' anchor='subscriber-configure-submit'>
  1836. <p>After receiving the configuration form, the requesting entity SHOULD submit the form in order to update the entity's subscription options for that node.</p>
  1837. <example caption='Subscriber submits completed options form'><![CDATA[
  1838. <iq type='set'
  1839. from='francisco@denmark.lit/barracks'
  1840. to='pubsub.shakespeare.lit'
  1841. id='options2'>
  1842. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  1843. <options node='princely_musings' jid='francisco@denmark.lit'>
  1844. <x xmlns='jabber:x:data' type='submit'>
  1845. <field var='FORM_TYPE' type='hidden'>
  1846. <value>http://jabber.org/protocol/pubsub#subscribe_options</value>
  1847. </field>
  1848. <field var='pubsub#deliver'><value>1</value></field>
  1849. <field var='pubsub#digest'><value>0</value></field>
  1850. <field var='pubsub#include_body'><value>false</value></field>
  1851. <field var='pubsub#show-values'>
  1852. <value>chat</value>
  1853. <value>online</value>
  1854. <value>away</value>
  1855. </field>
  1856. </x>
  1857. </options>
  1858. </pubsub>
  1859. </iq>
  1860. ]]></example>
  1861. </section3>
  1862. <section3 topic='Form Processing' anchor='subscriber-configure-process'>
  1863. <section4 topic='Success' anchor='subscriber-configure-process-success'>
  1864. <p>If the service can successfully process the submission, it MUST respond with success.</p>
  1865. <example caption='Service responds with success'><![CDATA[
  1866. <iq type='result'
  1867. from='pubsub.shakespeare.lit'
  1868. to='francisco@denmark.lit/barracks'
  1869. id='options2'/>
  1870. ]]></example>
  1871. </section4>
  1872. <section4 topic='Failure' anchor='subscriber-configure-process-failure'>
  1873. <p>If the subscriber attempts to set an invalid group of options, the service MUST respond with a &badrequest; error.</p>
  1874. <example caption='Service responds with Bad Request for invalid options'><![CDATA[
  1875. <iq type='error'
  1876. from='pubsub.shakespeare.lit'
  1877. to='francisco@denmark.lit/barracks'
  1878. id='options2'>
  1879. <error type='modify'>
  1880. <bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  1881. <invalid-options xmlns='http://jabber.org/protocol/pubsub#errors'/>
  1882. </error>
  1883. </iq>
  1884. ]]></example>
  1885. <p>The other errors already mentioned for getting subscription options also apply to setting subscription options.</p>
  1886. </section4>
  1887. </section3>
  1888. <section3 topic='Subscribe and Configure' anchor='subscriber-configure-subandconfig'>
  1889. <p>As noted, if a service supports subscription options, an entity MAY subscribe and provide the subscription options in the same stanza.</p>
  1890. <p>Note: The &lt;options/&gt; element MUST follow the &lt;subscribe/&gt; element and MUST NOT possess a 'node' attribute or 'jid' attribute, since the value of the &lt;subscribe/&gt; element's 'node' attribute specifies the desired NodeID and the value of the &lt;subscribe/&gt; element's 'jid' attribute specifies the subscriber's JID; if any of these rules are violated, the service MUST return a &badrequest; error.</p>
  1891. <example caption='Entity subscribes to node and sets configuration options'><![CDATA[
  1892. <iq type='set'
  1893. from='francisco@denmark.lit/barracks'
  1894. to='pubsub.shakespeare.lit'
  1895. id='sub1'>
  1896. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  1897. <subscribe node='princely_musings' jid='francisco@denmark.lit'/>
  1898. <options>
  1899. <x xmlns='jabber:x:data' type='submit'>
  1900. <field var='FORM_TYPE' type='hidden'>
  1901. <value>http://jabber.org/protocol/pubsub#subscribe_options</value>
  1902. </field>
  1903. <field var='pubsub#deliver'><value>1</value></field>
  1904. <field var='pubsub#digest'><value>0</value></field>
  1905. <field var='pubsub#include_body'><value>false</value></field>
  1906. <field var='pubsub#show-values'>
  1907. <value>chat</value>
  1908. <value>online</value>
  1909. <value>away</value>
  1910. </field>
  1911. </x>
  1912. </options>
  1913. </pubsub>
  1914. </iq>
  1915. ]]></example>
  1916. <p>When the service informs the client of success, it SHOULD include a data form of type "result" informing the client of the resulting configuration options.</p>
  1917. <example caption='Service replies with success (including configuration options)'><![CDATA[
  1918. <iq type='result'
  1919. from='pubsub.shakespeare.lit'
  1920. to='francisco@denmark.lit/barracks'
  1921. id='sub1'>
  1922. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  1923. <subscription
  1924. node='princely_musings'
  1925. jid='francisco@denmark.lit'
  1926. subid='ba49252aaa4f5d320c24d3766f0bdcade78c78d3'
  1927. subscription='subscribed'/>
  1928. <options>
  1929. <x xmlns='jabber:x:data' type='result'>
  1930. <field var='FORM_TYPE' type='hidden'>
  1931. <value>http://jabber.org/protocol/pubsub#subscribe_options</value>
  1932. </field>
  1933. <field var='pubsub#deliver'><value>1</value></field>
  1934. <field var='pubsub#digest'><value>0</value></field>
  1935. <field var='pubsub#include_body'><value>false</value></field>
  1936. <field var='pubsub#show-values'>
  1937. <value>chat</value>
  1938. <value>online</value>
  1939. <value>away</value>
  1940. </field>
  1941. </x>
  1942. </options>
  1943. </pubsub>
  1944. </iq>
  1945. ]]></example>
  1946. </section3>
  1947. </section2>
  1948. <section2 topic='Request Default Subscription Configuration Options' anchor='subscribe-default'>
  1949. <p>An entity might want to request information about the default subscription configuration. Support for this feature is OPTIONAL.</p>
  1950. <section3 topic='Request' anchor='subscriber-default-request'>
  1951. <p>To get the default subscription options for a node, the entity MUST send an empty &lt;default/&gt; element to the node; in response, the node SHOULD return the default subscription options.</p>
  1952. <example caption='Entity requests default subscription configuration options'><![CDATA[
  1953. <iq type='get'
  1954. from='francisco@denmark.lit/barracks'
  1955. to='pubsub.shakespeare.lit'
  1956. id='def1'>
  1957. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  1958. <default node='princely_musings'/>
  1959. </pubsub>
  1960. </iq>
  1961. ]]></example>
  1962. <p>Note: Here the namespace is 'http://jabber.org/protocol/pubsub' (not 'http://jabber.org/protocol/pubsub#owner' as for retrieval of the default node configuration options).</p>
  1963. <p>The service itself MAY also have default subscription configuration options. To get the default subscription configuration options all (leaf) nodes at a service, the entity MUST send an empty &lt;default/&gt; element but not specifiy a node; in response, the service SHOULD return the default subscription options.</p>
  1964. <example caption='Entity requests default subscription configuration options'><![CDATA[
  1965. <iq type='get'
  1966. from='francisco@denmark.lit/barracks'
  1967. to='pubsub.shakespeare.lit'
  1968. id='def2'>
  1969. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  1970. <default/>
  1971. </pubsub>
  1972. </iq>
  1973. ]]></example>
  1974. <p>The process for retrieving the default subscription configuration options for collection nodes is described in <cite>XEP-0248</cite>.</p>
  1975. </section3>
  1976. <section3 topic='Success Case' anchor='subscriber-default-success'>
  1977. <p>If no error occurs, the node MUST return the default subscription configuration options.</p>
  1978. <example caption='Service responds with default subscription configuration options'><![CDATA[
  1979. <iq type='result'
  1980. from='pubsub.shakespeare.lit'
  1981. to='francisco@denmark.lit/barracks'
  1982. id='def1'>
  1983. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  1984. <default node='princely_musings'>
  1985. <x xmlns='jabber:x:data' type='result'>
  1986. <field var='FORM_TYPE' type='hidden'>
  1987. <value>http://jabber.org/protocol/pubsub#subscribe_options</value>
  1988. </field>
  1989. <field var='pubsub#deliver'><value>1</value></field>
  1990. <field var='pubsub#digest'><value>0</value></field>
  1991. <field var='pubsub#include_body'><value>false</value></field>
  1992. <field var='pubsub#show-values'>
  1993. <value>chat</value>
  1994. <value>online</value>
  1995. <value>away</value>
  1996. </field>
  1997. </x>
  1998. </default>
  1999. </pubsub>
  2000. </iq>
  2001. ]]></example>
  2002. </section3>
  2003. <section3 topic='Error Cases' anchor='subscriber-default-error'>
  2004. <p>There are several reasons why the default subscription configuration options request might fail:</p>
  2005. <ol>
  2006. <li>The service does not support subscription configuration.</li>
  2007. <li>The service does not support retrieval of default subscription configuration.</li>
  2008. </ol>
  2009. <p>These error cases are described more fully in the following sections.</p>
  2010. <section4 topic='Node Configuration Not Supported' anchor='subscriber-default-error-noconfig'>
  2011. <p>If the node does not support subscription configuration, it MUST return a &feature; error, specifying a pubsub-specific error condition of &lt;unsupported/&gt; and a feature of "subscription-options".</p>
  2012. <example caption='Service does not support subscription configuration'><![CDATA[
  2013. <iq type='error'
  2014. from='pubsub.shakespeare.lit'
  2015. to='francisco@denmark.lit/barracks'
  2016. id='def1'>
  2017. <error type='cancel'>
  2018. <feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  2019. <unsupported xmlns='http://jabber.org/protocol/pubsub#errors'
  2020. feature='subscription-options'/>
  2021. </error>
  2022. </iq>
  2023. ]]></example>
  2024. </section4>
  2025. <section4 topic='Default Subscription Configuration Retrieval Not Supported' anchor='subscriber-default-error-notsupported'>
  2026. <p>If the node does not support retrieval of default subscription configuration options, it MUST return a &feature; error, specifying a pubsub-specific error condition of &lt;unsupported/&gt; and a feature of "retrieve-default-sub".</p>
  2027. <example caption='Service does not support retrieval of default subscription configuration options'><![CDATA[
  2028. <iq type='error'
  2029. from='pubsub.shakespeare.lit'
  2030. to='francisco@denmark.lit/barracks'
  2031. id='def1'>
  2032. <error type='cancel'>
  2033. <feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  2034. <unsupported xmlns='http://jabber.org/protocol/pubsub#errors'
  2035. feature='retrieve-default-sub'/>
  2036. </error>
  2037. </iq>
  2038. ]]></example>
  2039. </section4>
  2040. </section3>
  2041. </section2>
  2042. <section2 topic='Retrieve Items from a Node' anchor='subscriber-retrieve'>
  2043. <p>Implementations of pubsub that choose to persist items MAY allow entities to request existing items from a node (e.g., an entity may wish to do this after successfully subscribing in order to receive all the items in the publishing history for the node).</p>
  2044. <section3 topic='Permissions' anchor='subscriber-retrieve-perms'>
  2045. <p>The service MUST conform to the node's access model in determining whether to return items to the entity that requests them. Specifically:</p>
  2046. <ul>
  2047. <li><p>If the access model is "open", the service SHOULD allow any entity (whether or not it is subscribed) to retrieve items.</p></li>
  2048. <li><p>If the access model is "presence", the service SHOULD allow any entity that is subscribed to the owner's presence to retrieve items.</p></li>
  2049. <li><p>If the access model is "roster", the service SHOULD allow any entity that is subscribed to the owner's presence and contained in the relevant roster group(s) to retrieve items.</p></li>
  2050. <li><p>If the access model is "authorize" or "whitelist", the service MUST allow only subscribed entities to retrieve items.</p></li>
  2051. </ul>
  2052. <p>The only exception foreseen to the SHOULD requirements for the foregoing access models is the enforcement of local privacy and security policies as specified more fully in the <link url='#security'>Security Considerations</link> section of this document. (In addition, a service MUST always allow the node owner to retrieve items from a node and SHOULD always allow a publisher to do so.)</p>
  2053. </section3>
  2054. <section3 topic='Requesting All Items' anchor='subscriber-retrieve-requestall'>
  2055. <p>The subscriber may request all items by specifying only the Node ID without restrictions.</p>
  2056. <example caption='Subscriber requests all items'><![CDATA[
  2057. <iq type='get'
  2058. from='francisco@denmark.lit/barracks'
  2059. to='pubsub.shakespeare.lit'
  2060. id='items1'>
  2061. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  2062. <items node='princely_musings'/>
  2063. </pubsub>
  2064. </iq>
  2065. ]]></example>
  2066. </section3>
  2067. <section3 topic='Returning All Items' anchor='subscriber-retrieve-returnall'>
  2068. <p>The service then SHOULD return all available items at the node, although it MAY truncate the result set if a large number of items has been published (see next section) and naturally it cannot return items that have been deleted, expired, etc.</p>
  2069. <example caption='Service returns all items'><![CDATA[
  2070. <iq type='result'
  2071. from='pubsub.shakespeare.lit'
  2072. to='francisco@denmark.lit/barracks'
  2073. id='items1'>
  2074. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  2075. <items node='princely_musings'>
  2076. <item id='368866411b877c30064a5f62b917cffe'>
  2077. <entry xmlns='http://www.w3.org/2005/Atom'>
  2078. <title>The Uses of This World</title>
  2079. <summary>
  2080. O, that this too too solid flesh would melt
  2081. Thaw and resolve itself into a dew!
  2082. </summary>
  2083. <link rel='alternate' type='text/html'
  2084. href='http://denmark.lit/2003/12/13/atom03'/>
  2085. <id>tag:denmark.lit,2003:entry-32396</id>
  2086. <published>2003-12-12T17:47:23Z</published>
  2087. <updated>2003-12-12T17:47:23Z</updated>
  2088. </entry>
  2089. </item>
  2090. <item id='3300659945416e274474e469a1f0154c'>
  2091. <entry xmlns='http://www.w3.org/2005/Atom'>
  2092. <title>Ghostly Encounters</title>
  2093. <summary>
  2094. O all you host of heaven! O earth! what else?
  2095. And shall I couple hell? O, fie! Hold, hold, my heart;
  2096. And you, my sinews, grow not instant old,
  2097. But bear me stiffly up. Remember thee!
  2098. </summary>
  2099. <link rel='alternate' type='text/html'
  2100. href='http://denmark.lit/2003/12/13/atom03'/>
  2101. <id>tag:denmark.lit,2003:entry-32396</id>
  2102. <published>2003-12-12T23:21:34Z</published>
  2103. <updated>2003-12-12T23:21:34Z</updated>
  2104. </entry>
  2105. </item>
  2106. <item id='4e30f35051b7b8b42abe083742187228'>
  2107. <entry xmlns='http://www.w3.org/2005/Atom'>
  2108. <title>Alone</title>
  2109. <summary>
  2110. Now I am alone.
  2111. O, what a rogue and peasant slave am I!
  2112. </summary>
  2113. <link rel='alternate' type='text/html'
  2114. href='http://denmark.lit/2003/12/13/atom03'/>
  2115. <id>tag:denmark.lit,2003:entry-32396</id>
  2116. <published>2003-12-13T11:09:53Z</published>
  2117. <updated>2003-12-13T11:09:53Z</updated>
  2118. </entry>
  2119. </item>
  2120. <item id='ae890ac52d0df67ed7cfdf51b644e901'>
  2121. <entry xmlns='http://www.w3.org/2005/Atom'>
  2122. <title>Soliloquy</title>
  2123. <summary>
  2124. To be, or not to be: that is the question:
  2125. Whether 'tis nobler in the mind to suffer
  2126. The slings and arrows of outrageous fortune,
  2127. Or to take arms against a sea of troubles,
  2128. And by opposing end them?
  2129. </summary>
  2130. <link rel='alternate' type='text/html'
  2131. href='http://denmark.lit/2003/12/13/atom03'/>
  2132. <id>tag:denmark.lit,2003:entry-32397</id>
  2133. <published>2003-12-13T18:30:02Z</published>
  2134. <updated>2003-12-13T18:30:02Z</updated>
  2135. </entry>
  2136. </item>
  2137. </items>
  2138. </pubsub>
  2139. </iq>
  2140. ]]></example>
  2141. </section3>
  2142. <section3 topic='Returning Some Items' anchor='subscriber-retrieve-returnsome'>
  2143. <p>A node may have a large number of items associated with it, in which case it may be problematic to return all of the items in response to an items request. In this case, the service SHOULD return some of the items and note that the list of items has been truncated by including a &xep0059; notation.</p>
  2144. <example caption='Service returns some items via result set management'><![CDATA[
  2145. <iq type='result'
  2146. from='pubsub.shakespeare.lit'
  2147. to='francisco@denmark.lit/barracks'
  2148. id='items1'>
  2149. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  2150. <items node='princely_musings'>
  2151. <item id='368866411b877c30064a5f62b917cffe'>
  2152. <entry xmlns='http://www.w3.org/2005/Atom'>
  2153. <title>The Uses of This World</title>
  2154. <summary>
  2155. O, that this too too solid flesh would melt
  2156. Thaw and resolve itself into a dew!
  2157. </summary>
  2158. <link rel='alternate' type='text/html'
  2159. href='http://denmark.lit/2003/12/13/atom03'/>
  2160. <id>tag:denmark.lit,2003:entry-32396</id>
  2161. <published>2003-12-12T17:47:23Z</published>
  2162. <updated>2003-12-12T17:47:23Z</updated>
  2163. </entry>
  2164. </item>
  2165. <item id='3300659945416e274474e469a1f0154c'>
  2166. <entry xmlns='http://www.w3.org/2005/Atom'>
  2167. <title>Ghostly Encounters</title>
  2168. <summary>
  2169. O all you host of heaven! O earth! what else?
  2170. And shall I couple hell? O, fie! Hold, hold, my heart;
  2171. And you, my sinews, grow not instant old,
  2172. But bear me stiffly up. Remember thee!
  2173. </summary>
  2174. <link rel='alternate' type='text/html'
  2175. href='http://denmark.lit/2003/12/13/atom03'/>
  2176. <id>tag:denmark.lit,2003:entry-32396</id>
  2177. <published>2003-12-12T23:21:34Z</published>
  2178. <updated>2003-12-12T23:21:34Z</updated>
  2179. </entry>
  2180. </item>
  2181. <item id='4e30f35051b7b8b42abe083742187228'>
  2182. <entry xmlns='http://www.w3.org/2005/Atom'>
  2183. <title>Alone</title>
  2184. <summary>
  2185. Now I am alone.
  2186. O, what a rogue and peasant slave am I!
  2187. </summary>
  2188. <link rel='alternate' type='text/html'
  2189. href='http://denmark.lit/2003/12/13/atom03'/>
  2190. <id>tag:denmark.lit,2003:entry-32396</id>
  2191. <published>2003-12-13T11:09:53Z</published>
  2192. <updated>2003-12-13T11:09:53Z</updated>
  2193. </entry>
  2194. </item>
  2195. </items>
  2196. <set xmlns='http://jabber.org/protocol/rsm'>
  2197. <first index='0'>368866411b877c30064a5f62b917cffe</first>
  2198. <last>4e30f35051b7b8b42abe083742187228</last>
  2199. <count>19</count>
  2200. </set>
  2201. </pubsub>
  2202. </iq>
  2203. ]]></example>
  2204. </section3>
  2205. <section3 topic='Returning the Last Published Item' anchor='subscriber-retrieve-returnlast'>
  2206. <p>Even if the service or node does not support persistent items, it MAY return the last published item.</p>
  2207. <example caption='Service returns last published item'><![CDATA[
  2208. <iq type='result'
  2209. from='pubsub.shakespeare.lit'
  2210. to='francisco@denmark.lit/barracks'
  2211. id='items1'>
  2212. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  2213. <items node='princely_musings'>
  2214. <item id='ae890ac52d0df67ed7cfdf51b644e901'>
  2215. <entry xmlns='http://www.w3.org/2005/Atom'>
  2216. <title>Soliloquy</title>
  2217. <summary>
  2218. To be, or not to be: that is the question:
  2219. Whether 'tis nobler in the mind to suffer
  2220. The slings and arrows of outrageous fortune,
  2221. Or to take arms against a sea of troubles,
  2222. And by opposing end them?
  2223. </summary>
  2224. <link rel='alternate' type='text/html'
  2225. href='http://denmark.lit/2003/12/13/atom03'/>
  2226. <id>tag:denmark.lit,2003:entry-32397</id>
  2227. <published>2003-12-13T18:30:02Z</published>
  2228. <updated>2003-12-13T18:30:02Z</updated>
  2229. </entry>
  2230. </item>
  2231. </items>
  2232. </pubsub>
  2233. </iq>
  2234. ]]></example>
  2235. </section3>
  2236. <section3 topic='Returning Notifications Only' anchor='subscriber-retrieve-returnnotify'>
  2237. <p>A service MAY return event notifications without payloads (e.g., to conserve bandwidth). If so, the client MAY request a specific item (using the ItemID) in order to retrieve the payload. When an entity requests items by ItemID, implementations MUST allow multiple items to be specified in the request.</p>
  2238. <example caption='Subscriber requests specific items by ItemID'><![CDATA[
  2239. <iq type='get'
  2240. from='francisco@denmark.lit/barracks'
  2241. to='pubsub.shakespeare.lit'
  2242. id='items3'>
  2243. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  2244. <items node='princely_musings'>
  2245. <item id='368866411b877c30064a5f62b917cffe'/>
  2246. <item id='4e30f35051b7b8b42abe083742187228'/>
  2247. </items>
  2248. </pubsub>
  2249. </iq>
  2250. ]]></example>
  2251. <example caption='Service sends requested item(s)'><![CDATA[
  2252. <iq type='result'
  2253. from='pubsub.shakespeare.lit'
  2254. id='items3'>
  2255. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  2256. <items node='princely_musings'>
  2257. <item id='368866411b877c30064a5f62b917cffe'>
  2258. <entry xmlns='http://www.w3.org/2005/Atom'>
  2259. <title>The Uses of This World</title>
  2260. <summary>
  2261. O, that this too too solid flesh would melt
  2262. Thaw and resolve itself into a dew!
  2263. </summary>
  2264. <link rel='alternate' type='text/html'
  2265. href='http://denmark.lit/2003/12/13/atom03'/>
  2266. <id>tag:denmark.lit,2003:entry-32396</id>
  2267. <published>2003-12-12T17:47:23Z</published>
  2268. <updated>2003-12-12T17:47:23Z</updated>
  2269. </entry>
  2270. </item>
  2271. <item id='4e30f35051b7b8b42abe083742187228'>
  2272. <entry xmlns='http://www.w3.org/2005/Atom'>
  2273. <title>Alone</title>
  2274. <summary>
  2275. Now I am alone.
  2276. O, what a rogue and peasant slave am I!
  2277. </summary>
  2278. <link rel='alternate' type='text/html'
  2279. href='http://denmark.lit/2003/12/13/atom03'/>
  2280. <id>tag:denmark.lit,2003:entry-32396</id>
  2281. <published>2003-12-13T11:09:53Z</published>
  2282. <updated>2003-12-13T11:09:53Z</updated>
  2283. </entry>
  2284. </item>
  2285. </items>
  2286. </pubsub>
  2287. </iq>
  2288. ]]></example>
  2289. </section3>
  2290. <section3 topic='Requesting the Most Recent Items' anchor='subscriber-retrieve-requestrecent'>
  2291. <p>A service MAY allow entities to request the most recent N items by using the 'max_items' attribute. When max_items is used, implementations SHOULD return the N most recent (as opposed to the N oldest) items. (Note: A future version of this specification may recommend the use of <cite>XEP-0059</cite> instead of the 'max_items' attribute.)</p>
  2292. <example caption='Subscriber requests two most recent items'><![CDATA[
  2293. <iq type='get'
  2294. from='francisco@denmark.lit/barracks'
  2295. to='pubsub.shakespeare.lit'
  2296. id='items2'>
  2297. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  2298. <items node='princely_musings' max_items='2'/>
  2299. </pubsub>
  2300. </iq>
  2301. ]]></example>
  2302. <example caption='Service returns two most recent items'><![CDATA[
  2303. <iq type='result'
  2304. from='pubsub.shakespeare.lit'
  2305. to='francisco@denmark.lit/barracks'
  2306. id='items2'>
  2307. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  2308. <items node='princely_musings'>
  2309. <item id='4e30f35051b7b8b42abe083742187228'>
  2310. <entry xmlns='http://www.w3.org/2005/Atom'>
  2311. <title>Alone</title>
  2312. <summary>
  2313. Now I am alone.
  2314. O, what a rogue and peasant slave am I!
  2315. </summary>
  2316. <link rel='alternate' type='text/html'
  2317. href='http://denmark.lit/2003/12/13/atom03'/>
  2318. <id>tag:denmark.lit,2003:entry-32396</id>
  2319. <published>2003-12-13T11:09:53Z</published>
  2320. <updated>2003-12-13T11:09:53Z</updated>
  2321. </entry>
  2322. </item>
  2323. <item id='ae890ac52d0df67ed7cfdf51b644e901'>
  2324. <entry xmlns='http://www.w3.org/2005/Atom'>
  2325. <title>Soliloquy</title>
  2326. <summary>
  2327. To be, or not to be: that is the question:
  2328. Whether 'tis nobler in the mind to suffer
  2329. The slings and arrows of outrageous fortune,
  2330. Or to take arms against a sea of troubles,
  2331. And by opposing end them?
  2332. </summary>
  2333. <link rel='alternate' type='text/html'
  2334. href='http://denmark.lit/2003/12/13/atom03'/>
  2335. <id>tag:denmark.lit,2003:entry-32397</id>
  2336. <published>2003-12-13T18:30:02Z</published>
  2337. <updated>2003-12-13T18:30:02Z</updated>
  2338. </entry>
  2339. </item>
  2340. </items>
  2341. </pubsub>
  2342. </iq>
  2343. ]]></example>
  2344. </section3>
  2345. <section3 topic='Requesting a Particular Item' anchor='subscriber-retrieve-requestone'>
  2346. <p>The subscriber can request a particular item by specifying the Node ID and the appropriate ItemID.</p>
  2347. <example caption='Subscriber requests a particular item'><![CDATA[
  2348. <iq type='get'
  2349. from='francisco@denmark.lit/barracks'
  2350. to='pubsub.shakespeare.lit'
  2351. id='items3'>
  2352. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  2353. <items node='princely_musings'>
  2354. <item id='ae890ac52d0df67ed7cfdf51b644e901'/>
  2355. </items>
  2356. </pubsub>
  2357. </iq>
  2358. ]]></example>
  2359. <p>The service would then return that specific item, if available.</p>
  2360. </section3>
  2361. <section3 topic='Error Cases' anchor='subscriber-retrieve-error'>
  2362. <p>There are several reasons why the items retrieval request might fail:</p>
  2363. <ol>
  2364. <li>The requesting entity has multiple subscriptions to the node but does not specify a subscription ID.</li>
  2365. <li>The requesting entity is subscribed but specifies an invalid subscription ID.</li>
  2366. <li>The node does not return items to unsubscribed entities and the requesting entity is not subscribed.</li>
  2367. <li>The service or node does not support persistent items and does not return the last published item.</li>
  2368. <li>The service or node does not support item retrieval.</li>
  2369. <li>The node has an access model of "presence" and the requesting entity is not subscribed to the owner's presence.</li>
  2370. <li>The node has an access model of "roster" and the requesting entity is not in one of the authorized roster groups.</li>
  2371. <li>The node has an access model of "whitelist" and the requesting entity is not on the whitelist.</li>
  2372. <li>The service or node requires payment for item retrieval.</li>
  2373. <li>The requesting entity is blocked from retrieving items from the node (e.g., because having an affiliation of outcast).</li>
  2374. <li>The node does not exist.</li>
  2375. </ol>
  2376. <p>These error cases are described more fully in the following sections.</p>
  2377. <section4 topic='Subscription ID Required' anchor='subscriber-retrieve-error-subid'>
  2378. <p>If the requesting entity has multiple subscriptions to the node but does not specify a subscription ID, the service MUST return a &badrequest; error to the subscriber, which SHOULD also include a pubsub-specific error condition of &lt;subid-required/&gt;.</p>
  2379. <example caption='Entity did not specify SubID'><![CDATA[
  2380. <iq type='error'
  2381. from='pubsub.shakespeare.lit'
  2382. to='francisco@denmark.lit/barracks'
  2383. id='items1'>
  2384. <error type='modify'>
  2385. <bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  2386. <subid-required xmlns='http://jabber.org/protocol/pubsub#errors'/>
  2387. </error>
  2388. </iq>
  2389. ]]></example>
  2390. </section4>
  2391. <section4 topic='Invalid Subscription ID' anchor='subscriber-retrieve-error-badsubid'>
  2392. <p>If the requesting entity is subscribed but specifies an invalid subscription ID, the service MUST return a &notacceptable; error to the subscriber, which SHOULD also include a pubsub-specific error condition of &lt;invalid-subid/&gt;.</p>
  2393. <example caption='Entity specified invalid SubID'><![CDATA[
  2394. <iq type='error'
  2395. from='pubsub.shakespeare.lit'
  2396. to='francisco@denmark.lit/barracks'
  2397. id='items1'>
  2398. <error type='modify'>
  2399. <not-acceptable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  2400. <invalid-subid xmlns='http://jabber.org/protocol/pubsub#errors'/>
  2401. </error>
  2402. </iq>
  2403. ]]></example>
  2404. </section4>
  2405. <section4 topic='Entity Not Subscribed' anchor='subscriber-retrieve-error-notsubscribed'>
  2406. <p>If the node does not return items to unsubscribed entities and the requesting entity is not subscribed (which includes having a pending subscription), the service MUST return a &notauthorized; error to the subscriber, which SHOULD also include a pubsub-specific error condition of &lt;not-subscribed/&gt;.</p>
  2407. <example caption='Entity is not subscribed'><![CDATA[
  2408. <iq type='error'
  2409. from='pubsub.shakespeare.lit'
  2410. to='francisco@denmark.lit/barracks'
  2411. id='items1'>
  2412. <error type='auth'>
  2413. <not-authorized xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  2414. <not-subscribed xmlns='http://jabber.org/protocol/pubsub#errors'/>
  2415. </error>
  2416. </iq>
  2417. ]]></example>
  2418. </section4>
  2419. <section4 topic='Persistent Items Not Supported' anchor='subscriber-retrieve-error-persistent'>
  2420. <p>If the service or node does not support persistent items and does not return the last published item, the service MUST return a &feature; error to the subscriber, specifying a pubsub-specific error condition of &lt;unsupported/&gt; and a feature of "persistent-items".</p>
  2421. <example caption='Persistent items not supported'><![CDATA[
  2422. <iq type='error'
  2423. from='pubsub.shakespeare.lit'
  2424. to='francisco@denmark.lit/barracks'
  2425. id='items1'>
  2426. <error type='cancel'>
  2427. <feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  2428. <unsupported xmlns='http://jabber.org/protocol/pubsub#errors'
  2429. feature='persistent-items'/>
  2430. </error>
  2431. </iq>
  2432. ]]></example>
  2433. </section4>
  2434. <section4 topic='Item Retrieval Not Supported' anchor='subscriber-retrieve-error-notsupported'>
  2435. <p>If the service or node does not support item retrieval (e.g., because the node is a collection node as described in <cite>XEP-0248</cite>), the service MUST return a &feature; error to the subscriber, specifying a pubsub-specific error condition of &lt;unsupported/&gt; and a feature of "retrieve-items".</p>
  2436. <example caption='Item retrieval not supported'><![CDATA[
  2437. <iq type='error'
  2438. from='pubsub.shakespeare.lit'
  2439. to='francisco@denmark.lit/barracks'
  2440. id='items1'>
  2441. <error type='cancel'>
  2442. <feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  2443. <unsupported xmlns='http://jabber.org/protocol/pubsub#errors'
  2444. feature='retrieve-items'/>
  2445. </error>
  2446. </iq>
  2447. ]]></example>
  2448. </section4>
  2449. <section4 topic='Presence Subscription Required' anchor='subscriber-retrieve-error-presence'>
  2450. <p>For nodes with an access model of "presence", if the requesting entity is not subscribed to the owner's presence then the pubsub service MUST respond with a &notauthorized; error, which SHOULD also include a pubsub-specific error condition of &lt;presence-subscription-required/&gt;.</p>
  2451. <example caption='Entity is not authorized to retrieve items (presence subscription required)'><![CDATA[
  2452. <iq type='error'
  2453. from='pubsub.shakespeare.lit'
  2454. to='francisco@denmark.lit/barracks'
  2455. id='items1'>
  2456. <error type='auth'>
  2457. <not-authorized xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  2458. <presence-subscription-required xmlns='http://jabber.org/protocol/pubsub#errors'/>
  2459. </error>
  2460. </iq>
  2461. ]]></example>
  2462. </section4>
  2463. <section4 topic='Not in Roster Group' anchor='subscriber-retrieve-error-rostergroup'>
  2464. <p>For nodes with an access model of "roster", if the requesting entity is not in one of the authorized roster groups then the pubsub service MUST respond with a &notauthorized; error, which SHOULD also include a pubsub-specific error condition of &lt;not-in-roster-group/&gt;.</p>
  2465. <example caption='Entity is not authorized to retrieve items (not in roster group)'><![CDATA[
  2466. <iq type='error'
  2467. from='pubsub.shakespeare.lit'
  2468. to='francisco@denmark.lit/barracks'
  2469. id='items1'>
  2470. <error type='auth'>
  2471. <not-authorized xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  2472. <not-in-roster-group xmlns='http://jabber.org/protocol/pubsub#errors'/>
  2473. </error>
  2474. </iq>
  2475. ]]></example>
  2476. </section4>
  2477. <section4 topic='Not on Whitelist' anchor='subscriber-retrieve-error-whitelist'>
  2478. <p>For nodes with a node access model of "whitelist", if the requesting entity is not on the whitelist then the service MUST return a &notallowed; error, specifying a pubsub-specific error condition of &lt;closed-node/&gt;.</p>
  2479. <example caption='Node has whitelist access model'><![CDATA[
  2480. <iq type='error'
  2481. from='pubsub.shakespeare.lit'
  2482. to='francisco@denmark.lit/barracks'
  2483. id='items1'>
  2484. <error type='cancel'>
  2485. <not-allowed xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  2486. <closed-node xmlns='http://jabber.org/protocol/pubsub#errors'/>
  2487. </error>
  2488. </iq>
  2489. ]]></example>
  2490. </section4>
  2491. <section4 topic='Payment Required' anchor='subscriber-retrieve-error-payment'>
  2492. <p>Commercial deployments may wish to link subscribers to a database of paying customers. If the subscriber needs to provide payment in order to retrieve items from the node (e.g., if the subscriber is not in the customer database or the customer's account is not paid up), the service SHOULD return a &payment; error to the subscriber.</p>
  2493. <example caption='Payment is required to retrieve items'><![CDATA[
  2494. <iq type='error'
  2495. from='pubsub.shakespeare.lit'
  2496. to='francisco@denmark.lit/barracks'
  2497. id='items1'>
  2498. <error type='auth'>
  2499. <payment-required xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  2500. </error>
  2501. </iq>
  2502. ]]></example>
  2503. </section4>
  2504. <section4 topic='Blocked' anchor='subscriber-retrieve-error-blocked'>
  2505. <p>If the requesting entity is blocked from retrieving items (e.g., because having an affiliation of outcast), the service MUST return a &forbidden; error to the subscriber.</p>
  2506. <example caption='Requesting entity is blocked'><![CDATA[
  2507. <iq type='error'
  2508. from='pubsub.shakespeare.lit'
  2509. to='francisco@denmark.lit/barracks'
  2510. id='items1'>
  2511. <error type='auth'>
  2512. <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  2513. </error>
  2514. </iq>
  2515. ]]></example>
  2516. </section4>
  2517. <section4 topic='Node Does Not Exist' anchor='subscriber-retrieve-error-node'>
  2518. <p>If the node does not exist, the service SHOULD return an &notfound; error to the subscriber.</p>
  2519. <example caption='Node does not exist'><![CDATA[
  2520. <iq type='error'
  2521. from='pubsub.shakespeare.lit'
  2522. to='francisco@denmark.lit/barracks'
  2523. id='items1'>
  2524. <error type='cancel'>
  2525. <item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  2526. </error>
  2527. </iq>
  2528. ]]></example>
  2529. </section4>
  2530. <section4 topic='No Such Item(s)' anchor='subscriber-retrieve-error-items'>
  2531. <p>If there are no items at the node or the requested items do not exist, the service SHOULD return an IQ stanza of type "result" with an empty &lt;items/&gt; element.</p>
  2532. <example caption='No such item(s)'><![CDATA[
  2533. <iq from='pubsub.shakespeare.lit'
  2534. id='items1'
  2535. to='francisco@denmark.lit/barracks'
  2536. type='result'>
  2537. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  2538. <items node='princely_musings'/>
  2539. </pubsub>
  2540. </iq>
  2541. ]]></example>
  2542. </section4>
  2543. </section3>
  2544. </section2>
  2545. </section1>
  2546. <section1 topic='Publisher Use Cases' anchor='publisher'>
  2547. <section2 topic='Publish an Item to a Node' anchor='publisher-publish'>
  2548. <section3 topic='Request' anchor='publisher-publish-request'>
  2549. <p>Any entity that is allowed to publish items to a node (i.e., a publisher or an owner) may do so at any time by sending an IQ-set to the service containing a pubsub element with a &lt;publish/&gt; child.</p>
  2550. <p>The syntax is as follows:</p>
  2551. <ul>
  2552. <li>The &lt;publish/&gt; element MUST possess a 'node' attribute, specifying the NodeID of the node.</li>
  2553. <li>Depending on the node configuration, the &lt;publish/&gt; element MAY contain no &ITEM; elements or one &ITEM; element. <note>The inclusion of more than one &ITEM; element is no longer allowed, given the removal of batch publishing from version 1.13 of this specification.</note> <note>It is not necessary for a publication request to include a payload or even an &ITEM; element in order to trigger an event notification. For example, the result of publishing to a transient, notification-only node will be an event notification that does not include even an &ITEM; element. However, for the sake of convenience we refer to the act of publication as "publishing an item" (rather than, say, "triggering an event notification") even though a publication request will not always contain an &ITEM; element.</note></li>
  2554. <li>The &lt;item/&gt; element provided by the publisher MAY possess an 'id' attribute, specifying a unique ItemID for the item. If an ItemID is not provided in the publish request, the pubsub service MUST generate one and MUST ensure that it is unique for that node.</li>
  2555. </ul>
  2556. <p>An example follows.</p>
  2557. <example caption='Publisher publishes an item with an ItemID'><![CDATA[
  2558. <iq type='set'
  2559. from='hamlet@denmark.lit/blogbot'
  2560. to='pubsub.shakespeare.lit'
  2561. id='publish1'>
  2562. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  2563. <publish node='princely_musings'>
  2564. <item id='bnd81g37d61f49fgn581'>
  2565. <entry xmlns='http://www.w3.org/2005/Atom'>
  2566. <title>Soliloquy</title>
  2567. <summary>
  2568. To be, or not to be: that is the question:
  2569. Whether 'tis nobler in the mind to suffer
  2570. The slings and arrows of outrageous fortune,
  2571. Or to take arms against a sea of troubles,
  2572. And by opposing end them?
  2573. </summary>
  2574. <link rel='alternate' type='text/html'
  2575. href='http://denmark.lit/2003/12/13/atom03'/>
  2576. <id>tag:denmark.lit,2003:entry-32397</id>
  2577. <published>2003-12-13T18:30:02Z</published>
  2578. <updated>2003-12-13T18:30:02Z</updated>
  2579. </entry>
  2580. </item>
  2581. </publish>
  2582. </pubsub>
  2583. </iq>
  2584. ]]></example>
  2585. </section3>
  2586. <section3 topic='Success Case' anchor='publisher-publish-success'>
  2587. <p>If the pubsub service can successfully process the request, it MUST inform the publisher of success. If the publish request did not include an ItemID, the IQ-result SHOULD include an empty &ITEM; element that specifies the ItemID of the published item.</p>
  2588. <example caption='Service replies with success'><![CDATA[
  2589. <iq type='result'
  2590. from='pubsub.shakespeare.lit'
  2591. to='hamlet@denmark.lit/blogbot'
  2592. id='publish1'>
  2593. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  2594. <publish node='princely_musings'>
  2595. <item id='ae890ac52d0df67ed7cfdf51b644e901'/>
  2596. </publish>
  2597. </pubsub>
  2598. </iq>
  2599. ]]></example>
  2600. <p>Note: If the publisher previously published an item with the same ItemID, successfully processing the request means that the service MUST overwrite the old item with the new item and then proceed as follows.</p>
  2601. <p>The pubsub service MUST then send one event notification to each entity that meets the criteria for receiving an event notification (typically to each approved subscriber, although there are other contexts in which an entity may receive an event notification as summarized under <link url='#impl-notify'>Notification Triggers</link>). Each &MESSAGE; stanza generated by a pubsub service SHOULD possess an 'id' attribute with a unique value so that the service can properly track any notification-related errors that may occur (see the <link url='#impl-bounce'>Handling Notification-Related Errors</link> section of this document). Depending on the node configuration, the event notification either will or will not contain the payload, as shown below.</p>
  2602. <p>Note: In order to facilitate authorization for item removal as described in the <link url='#publisher-delete'>Delete an Item from a Node</link> section of this document, implementations that support persistent items SHOULD store the item (if the node is so configured) and maintain a record of the publisher.</p>
  2603. <p>Note: If the service or node is configured so that there is a maximum number of items cached at the node and the maximum is reached when an item is published, the service MUST delete one of the existing items. It is RECOMMENDED for the service to follow the "first in, first out" rule and delete the oldest item. Depending on node configuration, deletion of an existing item MAY result in sending of a delete notification to the subscribers.</p>
  2604. <section4 topic='Notification With Payload' anchor='publisher-publish-success-withpayload'>
  2605. <p>If the node is configured to include payloads, the subscribers will receive payloads with the event notifications.</p>
  2606. <example caption='Subscribers receive event notifications with payloads'><![CDATA[
  2607. <message from='pubsub.shakespeare.lit' to='francisco@denmark.lit' id='foo'>
  2608. <event xmlns='http://jabber.org/protocol/pubsub#event'>
  2609. <items node='princely_musings'>
  2610. <item id='ae890ac52d0df67ed7cfdf51b644e901'>
  2611. <entry xmlns='http://www.w3.org/2005/Atom'>
  2612. <title>Soliloquy</title>
  2613. <summary>
  2614. To be, or not to be: that is the question:
  2615. Whether 'tis nobler in the mind to suffer
  2616. The slings and arrows of outrageous fortune,
  2617. Or to take arms against a sea of troubles,
  2618. And by opposing end them?
  2619. </summary>
  2620. <link rel='alternate' type='text/html'
  2621. href='http://denmark.lit/2003/12/13/atom03'/>
  2622. <id>tag:denmark.lit,2003:entry-32397</id>
  2623. <published>2003-12-13T18:30:02Z</published>
  2624. <updated>2003-12-13T18:30:02Z</updated>
  2625. </entry>
  2626. </item>
  2627. </items>
  2628. </event>
  2629. </message>
  2630. <message from='pubsub.shakespeare.lit' to='bernardo@denmark.lit' id='bar'>
  2631. <event xmlns='http://jabber.org/protocol/pubsub#event'>
  2632. <items node='princely_musings'>
  2633. <item id='ae890ac52d0df67ed7cfdf51b644e901'>
  2634. <entry xmlns='http://www.w3.org/2005/Atom'>
  2635. <title>Soliloquy</title>
  2636. <summary>
  2637. To be, or not to be: that is the question:
  2638. Whether 'tis nobler in the mind to suffer
  2639. The slings and arrows of outrageous fortune,
  2640. Or to take arms against a sea of troubles,
  2641. And by opposing end them?
  2642. </summary>
  2643. <link rel='alternate' type='text/html'
  2644. href='http://denmark.lit/2003/12/13/atom03'/>
  2645. <id>tag:denmark.lit,2003:entry-32397</id>
  2646. <published>2003-12-13T18:30:02Z</published>
  2647. <updated>2003-12-13T18:30:02Z</updated>
  2648. </entry>
  2649. </item>
  2650. </items>
  2651. </event>
  2652. </message>
  2653. <message from='pubsub.shakespeare.lit' to='horatio@denmark.lit' id='baz'>
  2654. <event xmlns='http://jabber.org/protocol/pubsub#event'>
  2655. <items node='princely_musings'>
  2656. <item id='ae890ac52d0df67ed7cfdf51b644e901'>
  2657. <entry xmlns='http://www.w3.org/2005/Atom'>
  2658. <title>Soliloquy</title>
  2659. <summary>
  2660. To be, or not to be: that is the question:
  2661. Whether 'tis nobler in the mind to suffer
  2662. The slings and arrows of outrageous fortune,
  2663. Or to take arms against a sea of troubles,
  2664. And by opposing end them?
  2665. </summary>
  2666. <link rel='alternate' type='text/html'
  2667. href='http://denmark.lit/2003/12/13/atom03'/>
  2668. <id>tag:denmark.lit,2003:entry-32397</id>
  2669. <published>2003-12-13T18:30:02Z</published>
  2670. <updated>2003-12-13T18:30:02Z</updated>
  2671. </entry>
  2672. </item>
  2673. </items>
  2674. </event>
  2675. </message>
  2676. <message from='pubsub.shakespeare.lit' to='bard@shakespeare.lit' id='fez'>
  2677. <event xmlns='http://jabber.org/protocol/pubsub#event'>
  2678. <items node='princely_musings'>
  2679. <item id='ae890ac52d0df67ed7cfdf51b644e901'>
  2680. <entry xmlns='http://www.w3.org/2005/Atom'>
  2681. <title>Soliloquy</title>
  2682. <summary>
  2683. To be, or not to be: that is the question:
  2684. Whether 'tis nobler in the mind to suffer
  2685. The slings and arrows of outrageous fortune,
  2686. Or to take arms against a sea of troubles,
  2687. And by opposing end them?
  2688. </summary>
  2689. <link rel='alternate' type='text/html'
  2690. href='http://denmark.lit/2003/12/13/atom03'/>
  2691. <id>tag:denmark.lit,2003:entry-32397</id>
  2692. <published>2003-12-13T18:30:02Z</published>
  2693. <updated>2003-12-13T18:30:02Z</updated>
  2694. </entry>
  2695. </item>
  2696. </items>
  2697. </event>
  2698. </message>
  2699. ]]></example>
  2700. </section4>
  2701. <section4 topic='Notification Without Payload' anchor='publisher-publish-success-withoutpayload'>
  2702. <p>If the node is configured to not include payloads, the subscribers will receive event notifications only. (If payloads are not included, subscribers may request the published item via the protocol defined in the <link url='#subscriber-retrieve'>Retrieve Items from a Node</link> section of this document.)</p>
  2703. <example caption='Subscribers receive event notifications only'><![CDATA[
  2704. <message from='pubsub.shakespeare.lit' to='francisco@denmark.lit' id='foo'>
  2705. <event xmlns='http://jabber.org/protocol/pubsub#event'>
  2706. <items node='princely_musings'>
  2707. <item id='ae890ac52d0df67ed7cfdf51b644e901'/>
  2708. </items>
  2709. </event>
  2710. </message>
  2711. <message from='pubsub.shakespeare.lit' to='bernardo@denmark.lit' id='bar'>
  2712. <event xmlns='http://jabber.org/protocol/pubsub#event'>
  2713. <items node='princely_musings'>
  2714. <item id='ae890ac52d0df67ed7cfdf51b644e901'/>
  2715. </items>
  2716. </event>
  2717. </message>
  2718. <message from='pubsub.shakespeare.lit' to='horatio@denmark.lit' id='baz'>
  2719. <event xmlns='http://jabber.org/protocol/pubsub#event'>
  2720. <items node='princely_musings'>
  2721. <item id='ae890ac52d0df67ed7cfdf51b644e901'/>
  2722. </items>
  2723. </event>
  2724. </message>
  2725. <message from='pubsub.shakespeare.lit' to='bard@shakespeare.lit' id='fez'>
  2726. <event xmlns='http://jabber.org/protocol/pubsub#event'>
  2727. <items node='princely_musings'>
  2728. <item id='ae890ac52d0df67ed7cfdf51b644e901'/>
  2729. </items>
  2730. </event>
  2731. </message>
  2732. ]]></example>
  2733. </section4>
  2734. <section4 topic='Item Publisher' anchor='publisher-publish-success-publisher'>
  2735. <p>If configured to do so, the service can include the publisher of the item when it generates event notifications.</p>
  2736. <example caption='Service Notifies Subscribers'><![CDATA[
  2737. <message from='pubsub.shakespeare.lit' to='francisco@denmark.lit' id='foo'>
  2738. <event xmlns='http://jabber.org/protocol/pubsub#event'>
  2739. <items node='princely_musings'>
  2740. <item id='ae890ac52d0df67ed7cfdf51b644e901'
  2741. publisher='hamlet@denmark.lit'>
  2742. [ ... ENTRY ... ]
  2743. </item>
  2744. </items>
  2745. </event>
  2746. </message>
  2747. ]]></example>
  2748. <p>If so, the service MUST also include the publisher with every other form of item retrieval.</p>
  2749. <example caption='Service returns items'><![CDATA[
  2750. <iq type='result'
  2751. from='pubsub.shakespeare.lit'
  2752. to='francisco@denmark.lit/barracks'
  2753. id='items1'>
  2754. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  2755. <items node='princely_musings'>
  2756. <item id='ae890ac52d0df67ed7cfdf51b644e901'
  2757. publisher='hamlet@denmark.lit'>
  2758. [ ... ENTRY ... ]
  2759. </item>
  2760. [ ... MORE ITEMS ... ]
  2761. </items>
  2762. </pubsub>
  2763. </iq>
  2764. ]]></example>
  2765. <p>The value of the 'publisher' attribute MUST be generated by the service, not accepted by the service in the published item, since allowing the publisher to assert its JID would open the possibility of spoofing.</p>
  2766. <p>The JID stamped by the service can be either (1) the full JID &LOCALFULL; of the publisher as taken the 'from' attribute of the IQ-set used to publish the item or (2) the bare JID &LOCALBARE; of the publisher as derived from a formal affiliation in the explicit list of whitelisted publishers.</p>
  2767. </section4>
  2768. <section4 topic='Inclusion of Subscription ID' anchor='publisher-publish-success-subid'>
  2769. <p>If a single entity is subscribed to a node multiple times, the service SHOULD notate the event notification so that the entity can determine which subscription identifier(s) generated this event. If these notations are included, they MUST use the &xep0131; format and SHOULD be included after the event notification information (i.e., as the last child of the &MESSAGE; stanza).</p>
  2770. <example caption='Subscriber receives notated event notification'><![CDATA[
  2771. <message from='pubsub.shakespeare.lit' to='francisco@denmark.lit' id='foo'>
  2772. <event xmlns='http://jabber.org/protocol/pubsub#event'>
  2773. <items node='princely_musings'>
  2774. <item id='ae890ac52d0df67ed7cfdf51b644e901'/>
  2775. </items>
  2776. </event>
  2777. <headers xmlns='http://jabber.org/protocol/shim'>
  2778. <header name='SubID'>123-abc</header>
  2779. <header name='SubID'>004-yyy</header>
  2780. </headers>
  2781. </message>
  2782. ]]></example>
  2783. </section4>
  2784. </section3>
  2785. <section3 topic='Error Cases' anchor='publisher-publish-error'>
  2786. <p>There are several reasons why the publish request might fail:</p>
  2787. <ol>
  2788. <li>The requesting entity does not have sufficient privileges to publish.</li>
  2789. <li>The node does not support item publication.</li>
  2790. <li>The node does not exist.</li>
  2791. <li>The payload size exceeds a service-defined limit.</li>
  2792. <li>The item contains more than one payload element or the namespace of the root payload element does not match the configured namespace for the node.</li>
  2793. <li>The request does not match the node configuration.</li>
  2794. </ol>
  2795. <p>These error cases are described more fully in the following sections.</p>
  2796. <p>Note: If a publisher publishes an item with an Item ID and the ItemID matches that of an existing item, the pubsub service MUST NOT fail the publication but instead MUST overwrite the existing item and generate a new event notification (i.e., re-publication is equivalent to modification).</p>
  2797. <section4 topic='Insufficient Privileges' anchor='publisher-publish-error-forbidden'>
  2798. <p>If the requesting entity does not have sufficient privileges to publish, the service MUST return a &forbidden; error.</p>
  2799. <example caption='Entity does not have sufficient privileges to publish to node'><![CDATA[
  2800. <iq type='error'
  2801. from='pubsub.shakespeare.lit'
  2802. id='publish1'>
  2803. <error type='auth'>
  2804. <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  2805. </error>
  2806. </iq>
  2807. ]]></example>
  2808. </section4>
  2809. <section4 topic='Item Publication Not Supported' anchor='publisher-publish-error-notsupported'>
  2810. <p>If the node does not support item publication (e.g., because it is a collection node as described in <cite>XEP-0248</cite>), the service MUST return a &feature; error, specifying a pubsub-specific error condition of &lt;unsupported/&gt; and a feature of "publish".</p>
  2811. <example caption='Node does not support item publication'><![CDATA[
  2812. <iq type='error'
  2813. from='pubsub.shakespeare.lit'
  2814. to='hamlet@denmark.lit/elsinore'
  2815. id='publish1'>
  2816. <error type='cancel'>
  2817. <feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  2818. <unsupported xmlns='http://jabber.org/protocol/pubsub#errors'
  2819. feature='publish'/>
  2820. </error>
  2821. </iq>
  2822. ]]></example>
  2823. </section4>
  2824. <section4 topic='Node Does Not Exist' anchor='publisher-publish-error-node'>
  2825. <p>If the requesting entity attempts to publish an item to a node that does not exist and the service does not support the "auto-create" feature (see <link url='#publisher-publish-autocreate'>Automatic Node Creation</link>), the service MUST return an &notfound; error.</p>
  2826. <example caption='Entity attempts to publish to a non-existent node'><![CDATA[
  2827. <iq type='error'
  2828. from='pubsub.shakespeare.lit'
  2829. to='hamlet@denmark.lit/elsinore'
  2830. id='publish1'>
  2831. <error type='cancel'>
  2832. <item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  2833. </error>
  2834. </iq>
  2835. ]]></example>
  2836. </section4>
  2837. <section4 topic='Payload Too Big' anchor='publisher-publish-error-bigpayload'>
  2838. <p>If the payload size exceeds a service-defined limit, the service MUST return a &notacceptable; error, which SHOULD also include a pubsub-specific error condition of &lt;payload-too-big/&gt;.</p>
  2839. <example caption='Entity attempts to publish very large payload'><![CDATA[
  2840. <iq type='error'
  2841. from='pubsub.shakespeare.lit'
  2842. to='hamlet@denmark.lit/elsinore'
  2843. id='publish1'>
  2844. <error type='modify'>
  2845. <not-acceptable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  2846. <payload-too-big xmlns='http://jabber.org/protocol/pubsub#errors'/>
  2847. </error>
  2848. </iq>
  2849. ]]></example>
  2850. </section4>
  2851. <section4 topic='Bad Payload' anchor='publisher-publish-error-badpayload'>
  2852. <p>If the &ITEM; element contains more than one payload element or the namespace of the root payload element does not match the configured namespace for the node, the service MUST bounce the request with a &badrequest; error, which SHOULD also include a pubsub-specific error condition of &lt;invalid-payload/&gt;.</p>
  2853. <example caption='Entity attempts to publish item with multiple payload elements or namespace does not match'><![CDATA[
  2854. <iq type='error'
  2855. from='pubsub.shakespeare.lit'
  2856. to='hamlet@denmark.lit/elsinore'
  2857. id='publish1'>
  2858. <error type='modify'>
  2859. <bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  2860. <invalid-payload xmlns='http://jabber.org/protocol/pubsub#errors'/>
  2861. </error>
  2862. </iq>
  2863. ]]></example>
  2864. </section4>
  2865. <section4 topic='Request Does Not Match Configuration' anchor='publisher-publish-error-badrequest'>
  2866. <p>If the request does not conform to the configured <link url='#events'>event type</link> for the node, the service MAY bounce the request with a &badrequest; error, which SHOULD also include a pubsub-specific error condition. The following rules apply:</p>
  2867. <ul>
  2868. <li>If the event type is persistent (either event notification or payload) and the publisher does not specify an ItemID, the service MUST generate the ItemID and MUST NOT bounce the publication request.</li>
  2869. <li>If the event type is persistent (either event notification or payload) and the publisher does not include an item, the service MUST bounce the publication request with a &badrequest; error and a pubsub-specific error condition of &lt;item-required/&gt;.</li>
  2870. <li>If the event type is payload (either persistent or transient) and the publisher does not include a payload, the service SHOULD bounce the publication request with a &badrequest; error and a pubsub-specific error condition of &lt;payload-required/&gt;.</li>
  2871. <li>If the event type is notification + transient and the publisher provides an item, the service MUST bounce the publication request with a &badrequest; error and a pubsub-specific error condition of &lt;item-forbidden/&gt;.</li>
  2872. </ul>
  2873. <p>Examples of these errors are shown below.</p>
  2874. <example caption='Publisher attempts to publish to persistent node with no item'><![CDATA[
  2875. <iq type='error'
  2876. from='pubsub.shakespeare.lit'
  2877. to='hamlet@denmark.lit/elsinore'
  2878. id='publish1'>
  2879. <error type='modify'>
  2880. <bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  2881. <item-required xmlns='http://jabber.org/protocol/pubsub#errors'/>
  2882. </error>
  2883. </iq>
  2884. ]]></example>
  2885. <example caption='Publisher attempts to publish to payload node with no payload'><![CDATA[
  2886. <iq type='error'
  2887. from='pubsub.shakespeare.lit'
  2888. to='hamlet@denmark.lit/elsinore'
  2889. id='publish1'>
  2890. <error type='modify'>
  2891. <bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  2892. <payload-required xmlns='http://jabber.org/protocol/pubsub#errors'/>
  2893. </error>
  2894. </iq>
  2895. ]]></example>
  2896. <example caption='Publisher attempts to publish to transient notification node with item'><![CDATA[
  2897. <iq type='error'
  2898. from='pubsub.shakespeare.lit'
  2899. to='hamlet@denmark.lit/elsinore'
  2900. id='publish1'>
  2901. <error type='modify'>
  2902. <bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  2903. <item-forbidden xmlns='http://jabber.org/protocol/pubsub#errors'/>
  2904. </error>
  2905. </iq>
  2906. ]]></example>
  2907. </section4>
  2908. </section3>
  2909. <section3 topic='Automatic Node Creation' anchor='publisher-publish-autocreate'>
  2910. <p>A pubsub service MAY automatically create a node when it receives a publish request sent to a node that does not exist (instead of returning an &notfound; error). When doing so, the service SHOULD apply the default node configuration. If a service supports this functionality, it MUST advertise that fact by including a feature of "http://jabber.org/protocol/pubsub#auto-create" in its disco#info responses.</p>
  2911. </section3>
  2912. <section3 topic='Publishing Options' anchor='publisher-publish-options'>
  2913. <p>A pubsub service MAY support the ability to specify options along with a publish request (if so, it MUST advertise support for the "http://jabber.org/protocol/pubsub#publish-options" feature). Here is an example:</p>
  2914. <example caption='Publishing with options'><![CDATA[
  2915. <iq type='set'
  2916. from='hamlet@denmark.lit/blogbot'
  2917. to='pubsub.shakespeare.lit'
  2918. id='pub1'>
  2919. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  2920. <publish node='princely_musings'>
  2921. <item id='ae890ac52d0df67ed7cfdf51b644e901'>
  2922. <entry xmlns='http://www.w3.org/2005/Atom'>
  2923. <title>Soliloquy</title>
  2924. <summary>
  2925. To be, or not to be: that is the question:
  2926. Whether 'tis nobler in the mind to suffer
  2927. The slings and arrows of outrageous fortune,
  2928. Or to take arms against a sea of troubles,
  2929. And by opposing end them?
  2930. </summary>
  2931. <link rel='alternate' type='text/html'
  2932. href='http://denmark.lit/2003/12/13/atom03'/>
  2933. <id>tag:denmark.lit,2003:entry-32397</id>
  2934. <published>2003-12-13T18:30:02Z</published>
  2935. <updated>2003-12-13T18:30:02Z</updated>
  2936. </entry>
  2937. </item>
  2938. </publish>
  2939. <publish-options>
  2940. <x xmlns='jabber:x:data' type='submit'>
  2941. <field var='FORM_TYPE' type='hidden'>
  2942. <value>http://jabber.org/protocol/pubsub#publish-options</value>
  2943. </field>
  2944. <field var='pubsub#access_model'>
  2945. <value>presence</value>
  2946. </field>
  2947. </x>
  2948. </publish-options>
  2949. </pubsub>
  2950. </iq>
  2951. ]]></example>
  2952. <p>The &lt;publish-options/&gt; element MUST contain a data form (see <cite>XEP-0004</cite>), whose FORM_TYPE MUST be "http://jabber.org/protocol/pubsub#publish-options" (see <cite>XEP-0068</cite>).</p>
  2953. <p>Each form field denotes a precondition to publishing the request. A pub-sub service advertising support for publishing options MUST check each precondition field against the node configuration of the same name, and it MUST reject the publication upon encountering unknown fields.</p>
  2954. <p>Preconditions MUST be processed as follows:</p>
  2955. <ol>
  2956. <li>If the node exists and the precondition is not met, then the publish MUST fail with a &conflict; error condition and a pubsub-specific condition of &lt;precondition-not-met/&gt;.</li>
  2957. <li>If the node exists and the precondition is met, then the publish succeeds.</li>
  2958. <li>If the node does not exist and the service supports the "auto-create" feature, then the service shall auto-create the node with default configuration in all respects except those specified in the preconditions, and the publish succeeds.</li>
  2959. <li>If the node does not exist and the service does not support the "auto-create" feature, then the publish shall fail.</li>
  2960. </ol>
  2961. </section3>
  2962. </section2>
  2963. <section2 topic='Delete an Item from a Node' anchor='publisher-delete'>
  2964. <p>A publisher might want to delete an item once it has been published to a node that supports persistent items. Support for this feature ("delete-items") is RECOMMENDED.</p>
  2965. <section3 topic='Request' anchor='publisher-delete-request'>
  2966. <p>To delete an item, the publisher sends a retract request as shown in the following examples. The &lt;retract/&gt; element MUST possess a 'node' attribute, MAY possess a 'notify' attribute, and MUST contain one &ITEM; element; the &ITEM; element MUST be empty and MUST possess an 'id' attribute.</p>
  2967. <example caption='Entity deletes an item from a node'><![CDATA[
  2968. <iq type='set'
  2969. from='hamlet@denmark.lit/elsinore'
  2970. to='pubsub.shakespeare.lit'
  2971. id='retract1'>
  2972. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  2973. <retract node='princely_musings'>
  2974. <item id='ae890ac52d0df67ed7cfdf51b644e901'/>
  2975. </retract>
  2976. </pubsub>
  2977. </iq>
  2978. ]]></example>
  2979. </section3>
  2980. <section3 topic='Success Case' anchor='publisher-delete-success'>
  2981. <p>If no error occurs, the service MUST delete the item.</p>
  2982. <example caption='Service replies with success'><![CDATA[
  2983. <iq type='result'
  2984. from='pubsub.shakespeare.lit'
  2985. to='hamlet@denmark.lit/elsinore'
  2986. id='retract1'/>
  2987. ]]></example>
  2988. <section4 topic='Delete And Notify' anchor='publisher-delete-success-notify'>
  2989. <p>If no error occurs and the &lt;retract/&gt; element included a 'notify' attribute with a value of "true" or "1" &BOOLEANNOTE;, then the service MUST delete the item and MUST notify all subscribers as shown below. The syntax is identical to event notifications except that instead of an &ITEM; element, the &ITEMS; element includes a &lt;retract/&gt; element.</p>
  2990. <example caption='Subscribers are notified of deletion'><![CDATA[
  2991. <message from='pubsub.shakespeare.lit' to='francisco@denmark.lit' id='foo'>
  2992. <event xmlns='http://jabber.org/protocol/pubsub#event'>
  2993. <items node='princely_musings'>
  2994. <retract id='ae890ac52d0df67ed7cfdf51b644e901'/>
  2995. </items>
  2996. </event>
  2997. </message>
  2998. <message from='pubsub.shakespeare.lit' to='bernardo@denmark.lit' id='bar'>
  2999. <event xmlns='http://jabber.org/protocol/pubsub#event'>
  3000. <items node='princely_musings'>
  3001. <retract id='ae890ac52d0df67ed7cfdf51b644e901'/>
  3002. </items>
  3003. </event>
  3004. </message>
  3005. ]]></example>
  3006. </section4>
  3007. <section4 topic='Inclusion of Subscription ID' anchor='publisher-delete-success-subid'>
  3008. <p>If a single entity is subscribed to the node multiple times, the service SHOULD notate the item deletion so that the entity can determine which subscription identifier(s) generated this event. As above, if these notations are included, they MUST use the <cite>Stanza Headers and Internet Metadata (SHIM)</cite> protocol and SHOULD be included after the notification data (i.e., as the last child of the &MESSAGE; stanza).</p>
  3009. <example caption='Subscriber receives notated event notification'><![CDATA[
  3010. <message from='pubsub.shakespeare.lit' to='bernardo@denmark.lit' id='bar'>
  3011. <event xmlns='http://jabber.org/protocol/pubsub#event'>
  3012. <items node='princely_musings'>
  3013. <retract id='ae890ac52d0df67ed7cfdf51b644e901'/>
  3014. </items>
  3015. </event>
  3016. <headers xmlns='http://jabber.org/protocol/shim'>
  3017. <header name='SubID'>123-abc</header>
  3018. <header name='SubID'>004-yyy</header>
  3019. </headers>
  3020. </message>
  3021. ]]></example>
  3022. </section4>
  3023. </section3>
  3024. <section3 topic='Error Cases' anchor='publisher-delete-error'>
  3025. <p>There are several reasons why the item retraction request might fail:</p>
  3026. <ol>
  3027. <li>The publisher does not have sufficient privileges to delete the requested item.</li>
  3028. <li>The node or item does not exist.</li>
  3029. <li>The request does not specify a node.</li>
  3030. <li>The request does not include an &ITEM; element or the &ITEM; element does not specify an ItemID.</li>
  3031. <li>The node does not support persistent items.</li>
  3032. <li>The service does not support the deletion of items.</li>
  3033. </ol>
  3034. <p>These error cases are described more fully in the following sections.</p>
  3035. <section4 topic='Insufficient Privileges' anchor='publisher-delete-error-forbidden'>
  3036. <p>If the requesting entity does not have sufficient privileges to delete the item, the service MUST return a &forbidden; error.</p>
  3037. <example caption='Requesting entity does not have sufficient privileges'><![CDATA[
  3038. <iq type='error'
  3039. from='pubsub.shakespeare.lit'
  3040. to='hamlet@denmark.lit/elsinore'
  3041. id='retract1'>
  3042. <error type='auth'>
  3043. <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  3044. </error>
  3045. </iq>
  3046. ]]></example>
  3047. </section4>
  3048. <section4 topic='Node Does Not Exist' anchor='publisher-delete-error-node'>
  3049. <p>If the node or item does not exist, the service MUST return an &notfound; error.</p>
  3050. <example caption='Non-existent node or item'><![CDATA[
  3051. <iq type='error'
  3052. from='pubsub.shakespeare.lit'
  3053. to='hamlet@denmark.lit/elsinore'
  3054. id='retract1'>
  3055. <error type='cancel'>
  3056. <item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  3057. </error>
  3058. </iq>
  3059. ]]></example>
  3060. </section4>
  3061. <section4 topic='NodeID Required' anchor='publisher-delete-error-nodeid'>
  3062. <p>If the request does not specify a node, the service MUST return a &badrequest; error, which SHOULD also include a pubsub-specific error condition of &lt;nodeid-required/&gt;.</p>
  3063. <example caption='Request does not specify a node'><![CDATA[
  3064. <iq type='error'
  3065. from='pubsub.shakespeare.lit'
  3066. to='hamlet@denmark.lit/elsinore'
  3067. id='retract1'>
  3068. <error type='modify'>
  3069. <bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  3070. <nodeid-required xmlns='http://jabber.org/protocol/pubsub#errors'/>
  3071. </error>
  3072. </iq>
  3073. ]]></example>
  3074. </section4>
  3075. <section4 topic='Item or ItemID Required' anchor='publisher-delete-error-itemid'>
  3076. <p>If the request does not include an &ITEM; element or the &ITEM; element does not specify an ItemID, the service MUST return a &badrequest; error, which SHOULD also include a pubsub-specific error condition of &lt;item-required/&gt;.</p>
  3077. <example caption='Request does not specify an item'><![CDATA[
  3078. <iq type='error'
  3079. from='pubsub.shakespeare.lit'
  3080. to='hamlet@denmark.lit/elsinore'
  3081. id='retract1'>
  3082. <error type='modify'>
  3083. <bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  3084. <item-required xmlns='http://jabber.org/protocol/pubsub#errors'/>
  3085. </error>
  3086. </iq>
  3087. ]]></example>
  3088. </section4>
  3089. <section4 topic='Persistent Items Not Supported' anchor='publisher-delete-error-persistent'>
  3090. <p>If the node does not support persistent items (e.g., because it is a collection node or a transient node that does not deliver payloads), the service MUST return a &feature; error, specifying a pubsub-specific error condition of &lt;unsupported/&gt; and a feature of "persistent-items".</p>
  3091. <example caption='Node does not support persistent items'><![CDATA[
  3092. <iq type='error'
  3093. from='pubsub.shakespeare.lit'
  3094. to='hamlet@denmark.lit/elsinore'
  3095. id='retract1'>
  3096. <error type='cancel'>
  3097. <feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  3098. <unsupported xmlns='http://jabber.org/protocol/pubsub#errors'
  3099. feature='persistent-items'/>
  3100. </error>
  3101. </iq>
  3102. ]]></example>
  3103. </section4>
  3104. <section4 topic='Item Deletion Not Supported' anchor='publisher-delete-error-notsupported'>
  3105. <p>If the service does not support item deletion, it MUST return a &feature; error, specifying a pubsub-specific error condition of &lt;unsupported/&gt; and a feature of "delete-items".</p>
  3106. <example caption='Service does not support item deletion'><![CDATA[
  3107. <iq type='error'
  3108. from='pubsub.shakespeare.lit'
  3109. to='hamlet@denmark.lit/elsinore'
  3110. id='retract1'>
  3111. <error type='cancel'>
  3112. <feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  3113. <unsupported xmlns='http://jabber.org/protocol/pubsub#errors'
  3114. feature='delete-items'/>
  3115. </error>
  3116. </iq>
  3117. ]]></example>
  3118. </section4>
  3119. </section3>
  3120. </section2>
  3121. </section1>
  3122. <section1 topic='Owner Use Cases' anchor='owner'>
  3123. <section2 topic='Create a Node' anchor='owner-create'>
  3124. <section3 topic='General Considerations' anchor='owner-create-general'>
  3125. <p>An entity may want to create a new node. Support for this feature ("create-nodes") is RECOMMENDED. However, a service MAY disallow creation of nodes based on the identity of the requesting entity, or MAY disallow node creation altogether (e.g., reserving that privilege to a service-wide administrator).</p>
  3126. <p>There are two ways to create a node:</p>
  3127. <ol>
  3128. <li>Create a node with default configuration for the specified node type.</li>
  3129. <li>Create and configure a node simultaneously.</li>
  3130. </ol>
  3131. <example caption='Request to create a node'><![CDATA[
  3132. <iq type='set'
  3133. from='hamlet@denmark.lit/elsinore'
  3134. to='pubsub.shakespeare.lit'
  3135. id='create1'>
  3136. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  3137. <create node='princely_musings'/>
  3138. </pubsub>
  3139. </iq>
  3140. ]]></example>
  3141. <p>These methods, along with method-specific error conditions, are explained more fully in the following sections.</p>
  3142. <p>In addition to method-specific error conditions, there are several general reasons why the node creation request might fail:</p>
  3143. <ul>
  3144. <li>The service does not support node creation.</li>
  3145. <li>Only entities that are registered with the service are allowed to create nodes but the requesting entity is not registered.</li>
  3146. <li>The requesting entity does not have sufficient privileges to create nodes.</li>
  3147. <li>The requested NodeID already exists.</li>
  3148. <li>The request did not include a NodeID and "instant nodes" are not supported.</li>
  3149. </ul>
  3150. <p>These general error cases are described more fully below.</p>
  3151. <p>If the service does not support node creation, it MUST respond with a &feature; error, specifying a pubsub-specific error condition of &lt;unsupported/&gt; and a feature of "create-nodes".</p>
  3152. <example caption='Service does not support node creation'><![CDATA[
  3153. <iq type='error'
  3154. from='pubsub.shakespeare.lit'
  3155. to='hamlet@denmark.lit/elsinore'
  3156. id='create1'>
  3157. <error type='cancel'>
  3158. <feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  3159. <unsupported xmlns='http://jabber.org/protocol/pubsub#errors'
  3160. feature='create-nodes'/>
  3161. </error>
  3162. </iq>
  3163. ]]></example>
  3164. <p>If only entities that are registered with the service may create nodes but the requesting entity has not yet registered, the service MUST respond with a &registration; error.</p>
  3165. <example caption='Service requires registration'><![CDATA[
  3166. <iq type='error'
  3167. from='pubsub.shakespeare.lit'
  3168. to='hamlet@denmark.lit/elsinore'
  3169. id='create1'>
  3170. <error type='auth'>
  3171. <registration-required xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  3172. </error>
  3173. </iq>
  3174. ]]></example>
  3175. <p>If the requesting entity does not have sufficient privileges to create nodes, the service MUST respond with a &forbidden; error.</p>
  3176. <example caption='Requesting entity is prohibited from creating nodes'><![CDATA[
  3177. <iq type='error'
  3178. from='pubsub.shakespeare.lit'
  3179. to='hamlet@denmark.lit/elsinore'
  3180. id='create1'>
  3181. <error type='auth'>
  3182. <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  3183. </error>
  3184. </iq>
  3185. ]]></example>
  3186. <p>If the requested NodeID already exists, the service MUST respond with a &conflict; error.</p>
  3187. <example caption='NodeID already exists'><![CDATA[
  3188. <iq type='error'
  3189. from='pubsub.shakespeare.lit'
  3190. to='hamlet@denmark.lit/elsinore'
  3191. id='create1'>
  3192. <error type='cancel'>
  3193. <conflict xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  3194. </error>
  3195. </iq>
  3196. ]]></example>
  3197. <p>If the node creator does not specify a NodeID but the service does not support instant nodes, the service MUST return a &notacceptable; error, specifying a pubsub-specific error condition of &lt;nodeid-required/&gt;.</p>
  3198. <example caption='Service does not support instant nodes'><![CDATA[
  3199. <iq type='error'
  3200. from='pubsub.shakespeare.lit'
  3201. to='hamlet@denmark.lit/elsinore'
  3202. id='create2'>
  3203. <error type='modify'>
  3204. <not-acceptable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  3205. <nodeid-required xmlns='http://jabber.org/protocol/pubsub#errors'/>
  3206. </error>
  3207. </iq>
  3208. ]]></example>
  3209. <p>If the node creator does not specify a NodeID but the service supports instant nodes, the service SHOULD generate a NodeID that is unique within the context of the service on behalf of the node creator.</p>
  3210. <example caption='Entity requests an instant node'><![CDATA[
  3211. <iq type='set'
  3212. from='hamlet@denmark.lit/elsinore'
  3213. to='pubsub.shakespeare.lit'
  3214. id='create2'>
  3215. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  3216. <create/>
  3217. </pubsub>
  3218. </iq>
  3219. ]]></example>
  3220. <p>If no error occurs, the pubsub service SHOULD create the node, generate a NodeID that is unique within the context of that service, and inform the user of success (including the NodeID in the response).</p>
  3221. <example caption='Service replies with success and generated NodeID'><![CDATA[
  3222. <iq type='result'
  3223. from='pubsub.shakespeare.lit'
  3224. to='hamlet@denmark.lit/elsinore'
  3225. id='create2'>
  3226. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  3227. <create node='25e3d37dabbab9541f7523321421edc5bfeb2dae'/>
  3228. </pubsub>
  3229. </iq>
  3230. ]]></example>
  3231. <p>Note: When a service successfully creates a node on behalf of the requesting entity, it MUST return an IQ result (in accordance with XMPP Core). If the node creation request did not specify a NodeID and the service supports creation of instant nodes, the service MUST specify the created NodeID in the IQ result. Similarly, if the node creation request specified a NodeID but the service modified the NodeID before creating the node, the service MUST also specify the modified node in the IQ result. In all other cases, the service MAY specify the NodeID in the IQ result but the node creator MUST NOT depend on receiving it from the service (since the node creator can determine which node was created by tracking the 'id' attribute that it specified for the IQ-set).</p>
  3232. </section3>
  3233. <section3 topic='Create a Node With Default Configuration' anchor='owner-create-default'>
  3234. <p>As explained above, each node type has its own default configuration. By asking the service to create a node with default configuration, the node creator accepts the default configuration. If the service allows node configuration, the owner may reconfigure the node after creating the node (as described in the <link url='#owner-configure'>Configure a Node</link> section of this document). In addition, a service MAY allow entities to determine the default configuration options for a given node type before creating a node (as described in the <link url='#owner-default'>Request Default Node Configurations</link> section of this document).</p>
  3235. <p>In order to create a node with default configuration, the node creator can simply include an empty &lt;create/&gt; child element.</p>
  3236. <p>In the following example, the node creator requests a leaf node (the default type) with an open access model (assumed to be the default type for this service).</p>
  3237. <example caption='Entity requests leaf node with (default) open access model'><![CDATA[
  3238. <iq type='set'
  3239. from='hamlet@denmark.lit/elsinore'
  3240. to='pubsub.shakespeare.lit'
  3241. id='create1'>
  3242. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  3243. <create node='princely_musings'/>
  3244. </pubsub>
  3245. </iq>
  3246. ]]></example>
  3247. <p>Note: The default setting for the 'pubsub#node_type' configuration field is "leaf".</p>
  3248. <p>In order to request an access model other than the default for the service, the node creator MUST include a Data Form in the node creation request that specifies a non-default value for the 'pubsub#access_model' field.</p>
  3249. <example caption='Entity requests leaf node with non-default access model'><![CDATA[
  3250. <iq type='set'
  3251. from='hamlet@denmark.lit/elsinore'
  3252. to='pubsub.shakespeare.lit'
  3253. id='create2'>
  3254. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  3255. <create node='princely_musings'/>
  3256. <configure>
  3257. <x xmlns='jabber:x:data' type='submit'>
  3258. <field var='FORM_TYPE' type='hidden'>
  3259. <value>http://jabber.org/protocol/pubsub#node_config</value>
  3260. </field>
  3261. <field var='pubsub#access_model'><value>whitelist</value></field>
  3262. </x>
  3263. </configure>
  3264. </pubsub>
  3265. </iq>
  3266. ]]></example>
  3267. <p>If the access model is supported and none of the general or method-specific errors has occurred, the service SHOULD create the node and inform the requesting entity of success.</p>
  3268. <example caption='Service informs requesting entity of success'><![CDATA[
  3269. <iq type='result'
  3270. from='pubsub.shakespeare.lit'
  3271. to='hamlet@denmark.lit/elsinore'
  3272. id='create1'/>
  3273. ]]></example>
  3274. <p>If service does not support the specified access model, it MUST return a &notacceptable; error, specifying a pubsub-specific error condition of &lt;unsupported-access-model/&gt;.</p>
  3275. <example caption='Service does not support specified access model'><![CDATA[
  3276. <iq type='error'
  3277. from='pubsub.shakespeare.lit'
  3278. to='hamlet@denmark.lit/elsinore'
  3279. id='create2'>
  3280. <error type='modify'>
  3281. <not-acceptable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  3282. <unsupported-access-model xmlns='http://jabber.org/protocol/pubsub#errors'/>
  3283. </error>
  3284. </iq>
  3285. ]]></example>
  3286. <p>(For error handling if the service does not support the specified node type, refer to <cite>XEP-0248</cite>.)</p>
  3287. </section3>
  3288. <section3 topic='Create and Configure a Node' anchor='owner-create-and-configure'>
  3289. <p>If an implementation allows node configuration (see the <link url='#owner-configure'>Configure a Node</link> section of this document), it SHOULD allow node creation requests to contain the desired node configuration in the node creation request.</p>
  3290. <p>Note: The &lt;configure/&gt; element MUST follow the &lt;create/&gt; element and MUST NOT possess a 'node' attribute, since the value of the &lt;create/&gt; element's 'node' attribute specifies the desired NodeID; if any of these rules are violated, the service MUST return a &badrequest; error.</p>
  3291. <example caption='Entity requests a new node with non-default configuration.'><![CDATA[
  3292. <iq type='set'
  3293. from='hamlet@denmark.lit/elsinore'
  3294. to='pubsub.shakespeare.lit'
  3295. id='create1'>
  3296. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  3297. <create node='princely_musings'/>
  3298. <configure>
  3299. <x xmlns='jabber:x:data' type='submit'>
  3300. <field var='FORM_TYPE' type='hidden'>
  3301. <value>http://jabber.org/protocol/pubsub#node_config</value>
  3302. </field>
  3303. <field var='pubsub#title'><value>Princely Musings (Atom)</value></field>
  3304. <field var='pubsub#deliver_notifications'><value>1</value></field>
  3305. <field var='pubsub#deliver_payloads'><value>1</value></field>
  3306. <field var='pubsub#persist_items'><value>1</value></field>
  3307. <field var='pubsub#max_items'><value>10</value></field>
  3308. <field var='pubsub#item_expire'><value>604800</value></field>
  3309. <field var='pubsub#access_model'><value>open</value></field>
  3310. <field var='pubsub#publish_model'><value>publishers</value></field>
  3311. <field var='pubsub#purge_offline'><value>0</value></field>
  3312. <field var='pubsub#send_last_published_item'><value>never</value></field>
  3313. <field var='pubsub#presence_based_delivery'><value>false</value></field>
  3314. <field var='pubsub#notification_type'><value>headline</value></field>
  3315. <field var='pubsub#notify_config'><value>0</value></field>
  3316. <field var='pubsub#notify_delete'><value>0</value></field>
  3317. <field var='pubsub#notify_retract'><value>0</value></field>
  3318. <field var='pubsub#notify_sub'><value>0</value></field>
  3319. <field var='pubsub#max_payload_size'><value>1028</value></field>
  3320. <field var='pubsub#type'><value>http://www.w3.org/2005/Atom</value></field>
  3321. <field var='pubsub#body_xslt'>
  3322. <value>http://jabxslt.jabberstudio.org/atom_body.xslt</value>
  3323. </field>
  3324. </x>
  3325. </configure>
  3326. </pubsub>
  3327. </iq>
  3328. ]]></example>
  3329. <example caption='Service replies with success'><![CDATA[
  3330. <iq type='result'
  3331. from='pubsub.shakespeare.lit'
  3332. to='hamlet@denmark.lit/elsinore'
  3333. id='create1'/>
  3334. ]]></example>
  3335. <p>If a service supports this "create-and-configure" feature, it MUST advertise that fact by returning a feature of "http://jabber.org/protocol/pubsub#create-and-configure" in response to service discovery information requests. If the create-and-configure option is not supported but the requesting entity sends such a request anyway, the service SHOULD ignore the configuration part of the request and proceed as if it had not been included.</p>
  3336. </section3>
  3337. </section2>
  3338. <section2 topic='Configure a Node' anchor='owner-configure'>
  3339. <p>After creating a new node, the node owner may want to modify the node configuration. Support for this feature is RECOMMENDED.</p>
  3340. <section3 topic='Request' anchor='owner-configure-request'>
  3341. <example caption='Owner requests configuration form'><![CDATA[
  3342. <iq type='get'
  3343. from='hamlet@denmark.lit/elsinore'
  3344. to='pubsub.shakespeare.lit'
  3345. id='config1'>
  3346. <pubsub xmlns='http://jabber.org/protocol/pubsub#owner'>
  3347. <configure node='princely_musings'/>
  3348. </pubsub>
  3349. </iq>
  3350. ]]></example>
  3351. </section3>
  3352. <section3 topic='Success Case' anchor='owner-configure-success'>
  3353. <p>If no error occurs, the server MUST return a configuration form to the node owner, which SHOULD contain the current node configuration as the default values.</p>
  3354. <p>Note: The following example shows some of the possible configuration options that MAY be provided. If an implementation implements these features using the <strong>Data Forms</strong> protocol, that implementation MUST use the fields that are registered with the XMPP Registrar in association with the 'http://jabber.org/protocol/pubsub' namespace (a preliminary representation of those field variables is shown below and in the <link url='#registrar-formtypes-config'>pubsub#node_config FORM_TYPE</link> section of this document, but MUST NOT be construed as canonical, since the XMPP Registrar may standardize additional fields at a later date without changes to this document). An implementation MAY choose to specify different labels, values, and even field types, but MUST conform to the defined variable naming scheme.</p>
  3355. <example caption='Service responds with configuration form'><![CDATA[
  3356. <iq type='result'
  3357. from='pubsub.shakespeare.lit'
  3358. to='hamlet@denmark.lit/elsinore'
  3359. id='config1'>
  3360. <pubsub xmlns='http://jabber.org/protocol/pubsub#owner'>
  3361. <configure node='princely_musings'>
  3362. <x xmlns='jabber:x:data' type='form'>
  3363. <field var='FORM_TYPE' type='hidden'>
  3364. <value>http://jabber.org/protocol/pubsub#node_config</value>
  3365. </field>
  3366. <field var='pubsub#title' type='text-single'
  3367. label='A friendly name for the node'/>
  3368. <field var='pubsub#deliver_notifications' type='boolean'
  3369. label='Whether to deliver event notifications'>
  3370. <value>true</value>
  3371. </field>
  3372. <field var='pubsub#deliver_payloads' type='boolean'
  3373. label='Whether to deliver payloads with event notifications'>
  3374. <value>true</value>
  3375. </field>
  3376. <field var='pubsub#notify_config' type='boolean'
  3377. label='Notify subscribers when the node configuration changes'>
  3378. <value>0</value>
  3379. </field>
  3380. <field var='pubsub#notify_delete' type='boolean'
  3381. label='Notify subscribers when the node is deleted'>
  3382. <value>false</value>
  3383. </field>
  3384. <field var='pubsub#notify_retract' type='boolean'
  3385. label='Notify subscribers when items are removed from the node'>
  3386. <value>false</value>
  3387. </field>
  3388. <field var='pubsub#notify_sub' type='boolean'
  3389. label='Notify owners about new subscribers and unsubscribes'>
  3390. <value>0</value>
  3391. </field>
  3392. <field var='pubsub#persist_items' type='boolean'
  3393. label='Persist items to storage'>
  3394. <value>1</value>
  3395. </field>
  3396. <field var='pubsub#max_items' type='text-single'
  3397. label='Max # of items to persist'>
  3398. <value>10</value>
  3399. </field>
  3400. <field var='pubsub#item_expire' type='text-single'
  3401. label='Time after which to automatically purge items'>
  3402. <value>604800</value>
  3403. </field>
  3404. <field var='pubsub#subscribe' type='boolean'
  3405. label='Whether to allow subscriptions'>
  3406. <value>1</value>
  3407. </field>
  3408. <field var='pubsub#access_model' type='list-single'
  3409. label='Specify the subscriber model'>
  3410. <option><value>authorize</value></option>
  3411. <option><value>open</value></option>
  3412. <option><value>presence</value></option>
  3413. <option><value>roster</value></option>
  3414. <option><value>whitelist</value></option>
  3415. <value>open</value>
  3416. </field>
  3417. <field var='pubsub#roster_groups_allowed' type='list-multi'
  3418. label='Roster groups allowed to subscribe'>
  3419. <option><value>friends</value></option>
  3420. <option><value>courtiers</value></option>
  3421. <option><value>servants</value></option>
  3422. <option><value>enemies</value></option>
  3423. </field>
  3424. <field var='pubsub#publish_model' type='list-single'
  3425. label='Specify the publisher model'>
  3426. <option><value>publishers</value></option>
  3427. <option><value>subscribers</value></option>
  3428. <option><value>open</value></option>
  3429. <value>publishers</value>
  3430. </field>
  3431. <field var='pubsub#purge_offline' type='boolean'
  3432. label='Purge all items when the relevant publisher goes offline?'>
  3433. <value>0</value>
  3434. </field>
  3435. <field var='pubsub#max_payload_size' type='text-single'
  3436. label='Max Payload size in bytes'>
  3437. <value>1028</value>
  3438. </field>
  3439. <field var='pubsub#send_last_published_item' type='list-single'
  3440. label='When to send the last published item'>
  3441. <option label='Never'><value>never</value></option>
  3442. <option label='When a new subscription is processed'><value>on_sub</value></option>
  3443. <option label='When a new subscription is processed and whenever a subscriber comes online'>
  3444. <value>on_sub_and_presence</value>
  3445. </option>
  3446. <value>never</value>
  3447. </field>
  3448. <field var='pubsub#presence_based_delivery' type='boolean'
  3449. label='Deliver event notifications only to available users'>
  3450. <value>0</value>
  3451. </field>
  3452. <field var='pubsub#notification_type' type='list-single'
  3453. label='Specify the delivery style for event notifications'>
  3454. <option><value>normal</value></option>
  3455. <option><value>headline</value></option>
  3456. <value>headline</value>
  3457. </field>
  3458. <field var='pubsub#type' type='text-single'
  3459. label='Specify the type of payload data to be provided at this node'>
  3460. <value>http://www.w3.org/2005/Atom</value>
  3461. </field>
  3462. <field var='pubsub#dataform_xslt' type='text-single'
  3463. label='Payload XSLT'/>
  3464. </x>
  3465. </configure>
  3466. </pubsub>
  3467. </iq>
  3468. ]]></example>
  3469. </section3>
  3470. <section3 topic='Error Cases' anchor='owner-configure-error'>
  3471. <p>There are several reasons why the node configuration request might fail:</p>
  3472. <ol>
  3473. <li>The service does not support node configuration.</li>
  3474. <li>The requesting entity does not have sufficient privileges to configure the node.</li>
  3475. <li>The request did not specify a node.</li>
  3476. <li>The node has no configuration options.</li>
  3477. <li>The specified node does not exist.</li>
  3478. </ol>
  3479. <p>These error cases are described more fully in the following sections.</p>
  3480. <section4 topic='Node Configuration Not Supported' anchor='owner-configure-error-notsupported'>
  3481. <p>If the service does not support node configuration, the service MUST return a &feature; error, specifying a pubsub-specific error condition of &lt;unsupported/&gt; and a feature of "config-node".</p>
  3482. <example caption='Service does not support node configuration'><![CDATA[
  3483. <iq type='error'
  3484. from='hamlet@denmark.lit/elsinore'
  3485. to='pubsub.shakespeare.lit'
  3486. id='config1'>
  3487. <error type='cancel'>
  3488. <feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  3489. <unsupported xmlns='http://jabber.org/protocol/pubsub#errors'
  3490. feature='config-node'/>
  3491. </error>
  3492. </iq>
  3493. ]]></example>
  3494. </section4>
  3495. <section4 topic='Insufficient Privileges' anchor='owner-configure-error-forbidden'>
  3496. <p>If the requesting entity does not have sufficient privileges to configure the node, the service MUST respond with a &forbidden; error.</p>
  3497. <example caption='Requesting entity is prohibited from configuring this node'><![CDATA[
  3498. <iq type='error'
  3499. from='pubsub.shakespeare.lit'
  3500. to='hamlet@denmark.lit/elsinore'
  3501. id='config1'>
  3502. <error type='auth'>
  3503. <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  3504. </error>
  3505. </iq>
  3506. ]]></example>
  3507. </section4>
  3508. <section4 topic='NodeID Required' anchor='owner-configure-error-nodeid'>
  3509. <p>If the request did not specify a node, the service SHOULD return a &badrequest; error. It is possible that by not including a NodeID, the requesting entity is asking to configure the root node; however, if the requesting entity is not a service-level admin, it makes sense to return &badrequest; instead of &forbidden;.</p>
  3510. <example caption='Request did not specify a node'><![CDATA[
  3511. <iq type='error'
  3512. from='hamlet@denmark.lit/elsinore'
  3513. to='pubsub.shakespeare.lit'
  3514. id='config1'>
  3515. <error type='modify'>
  3516. <bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  3517. <nodeid-required xmlns='http://jabber.org/protocol/pubsub#errors'/>
  3518. </error>
  3519. </iq>
  3520. ]]></example>
  3521. </section4>
  3522. <section4 topic='No Configuration Options' anchor='owner-configure-error-options'>
  3523. <p>If no configuration options are available (e.g., because node configuration is "locked down"), the service MUST return a &notallowed; error to the owner.</p>
  3524. <example caption='Node has no configuration options'><![CDATA[
  3525. <iq type='error'
  3526. from='hamlet@denmark.lit/elsinore'
  3527. to='pubsub.shakespeare.lit'
  3528. id='config1'>
  3529. <error type='cancel'>
  3530. <not-allowed xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  3531. </error>
  3532. </iq>
  3533. ]]></example>
  3534. </section4>
  3535. <section4 topic='Node Does Not Exist' anchor='owner-configure-error-node'>
  3536. <p>If the node does not exist, the service MUST return an &notfound; error.</p>
  3537. <example caption='Node does not exist'><![CDATA[
  3538. <iq type='error'
  3539. from='pubsub.shakespeare.lit'
  3540. to='hamlet@denmark.lit/elsinore'
  3541. id='config1'>
  3542. <error type='cancel'>
  3543. <item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  3544. </error>
  3545. </iq>
  3546. ]]></example>
  3547. </section4>
  3548. </section3>
  3549. <section3 topic='Form Submission' anchor='owner-configure-submit'>
  3550. <p>After receiving the configuration form, the owner SHOULD submit a completed configuration form.</p>
  3551. <example caption='Owner submits node configuration form'><![CDATA[
  3552. <iq type='set'
  3553. from='hamlet@denmark.lit/elsinore'
  3554. to='pubsub.shakespeare.lit'
  3555. id='config2'>
  3556. <pubsub xmlns='http://jabber.org/protocol/pubsub#owner'>
  3557. <configure node='princely_musings'>
  3558. <x xmlns='jabber:x:data' type='submit'>
  3559. <field var='FORM_TYPE' type='hidden'>
  3560. <value>http://jabber.org/protocol/pubsub#node_config</value>
  3561. </field>
  3562. <field var='pubsub#title'><value>Princely Musings (Atom)</value></field>
  3563. <field var='pubsub#deliver_notifications'><value>1</value></field>
  3564. <field var='pubsub#deliver_payloads'><value>1</value></field>
  3565. <field var='pubsub#persist_items'><value>1</value></field>
  3566. <field var='pubsub#max_items'><value>10</value></field>
  3567. <field var='pubsub#item_expire'><value>604800</value></field>
  3568. <field var='pubsub#access_model'><value>roster</value></field>
  3569. <field var='pubsub#roster_groups_allowed'>
  3570. <value>friends</value>
  3571. <value>servants</value>
  3572. <value>courtiers</value>
  3573. </field>
  3574. <field var='pubsub#publish_model'><value>publishers</value></field>
  3575. <field var='pubsub#purge_offline'><value>0</value></field>
  3576. <field var='pubsub#send_last_published_item'><value>never</value></field>
  3577. <field var='pubsub#presence_based_delivery'><value>false</value></field>
  3578. <field var='pubsub#notification_type'><value>headline</value></field>
  3579. <field var='pubsub#notify_config'><value>0</value></field>
  3580. <field var='pubsub#notify_delete'><value>0</value></field>
  3581. <field var='pubsub#notify_retract'><value>0</value></field>
  3582. <field var='pubsub#notify_sub'><value>0</value></field>
  3583. <field var='pubsub#max_payload_size'><value>1028</value></field>
  3584. <field var='pubsub#type'><value>http://www.w3.org/2005/Atom</value></field>
  3585. <field var='pubsub#body_xslt'>
  3586. <value>http://jabxslt.jabberstudio.org/atom_body.xslt</value>
  3587. </field>
  3588. </x>
  3589. </configure>
  3590. </pubsub>
  3591. </iq>
  3592. ]]></example>
  3593. <p>Alternatively, the owner MAY cancel the configuration process, in which case the existing configuration MUST be applied.</p>
  3594. <example caption='Owner cancels configuration process'><![CDATA[
  3595. <iq type='set'
  3596. from='hamlet@denmark.lit/elsinore'
  3597. to='pubsub.shakespeare.lit'
  3598. id='config2'>
  3599. <pubsub xmlns='http://jabber.org/protocol/pubsub#owner'>
  3600. <configure node='princely_musings'>
  3601. <x xmlns='jabber:x:data' type='cancel'/>
  3602. </configure>
  3603. </pubsub>
  3604. </iq>
  3605. ]]></example>
  3606. </section3>
  3607. <section3 topic='Form Processing' anchor='owner-configure-process'>
  3608. <section4 topic='Success' anchor='owner-configure-process-success'>
  3609. <p>If the form can be successfully processed, the service MUST return an IQ-result.</p>
  3610. <example caption='Service replies with success'><![CDATA[
  3611. <iq type='result'
  3612. from='pubsub.shakespeare.lit'
  3613. to='hamlet@denmark.lit/elsinore'
  3614. id='config2'/>
  3615. ]]></example>
  3616. <p>Note: If the node type was changed from leaf to collection and there are items associated with the node, the service MUST purge the node of all items (with or without notifying the subscribers).</p>
  3617. </section4>
  3618. <section4 topic='Failure' anchor='owner-configure-process-failure'>
  3619. <p>If the requested node configuration change cannot be processed (e.g., because the node owner has attempted to change the configuration so that there are no node owners), the service MUST return a &notacceptable; error to the owner.</p>
  3620. <example caption='Configuration change cannot be processed'><![CDATA[
  3621. <iq type='error'
  3622. from='pubsub.shakespeare.lit'
  3623. to='hamlet@denmark.lit/elsinore'
  3624. id='config2'>
  3625. <error type='modify'>
  3626. <not-acceptable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  3627. </error>
  3628. </iq>
  3629. ]]></example>
  3630. </section4>
  3631. <section4 topic='Success With Notifications' anchor='owner-configure-process-notify'>
  3632. <p>If the "pubsub#notify_config" option is set to true, the service MUST notify subscribers of the configuration change. (A service SHOULD support this option for leaf nodes and MUST support it for collection nodes as described in <cite>XEP-0248</cite>.) If the node configuration is set to notification-only, the notification MUST consist of an empty &lt;configuration/&gt; element whose 'node' attribute is set to the NodeID of the node; if the node configuration is set to full payloads, the &lt;configuration/&gt; element MUST in addition contain the node configuration as represented via the <strong>Data Forms</strong> protocol.</p>
  3633. <example caption='Service sends configuration change notification (event notification only)'><![CDATA[
  3634. <message from='pubsub.shakespeare.lit' to='francisco@denmark.lit' id='foo'>
  3635. <event xmlns='http://jabber.org/protocol/pubsub#event'>
  3636. <configuration node='princely_musings'/>
  3637. </event>
  3638. </message>
  3639. ]]></example>
  3640. <example caption='Service sends configuration change notification (full payload)'><![CDATA[
  3641. <message from='pubsub.shakespeare.lit' to='francisco@denmark.lit' id='foo'>
  3642. <event xmlns='http://jabber.org/protocol/pubsub#event'>
  3643. <configuration node='princely_musings'>
  3644. <x xmlns='jabber:x:data' type='result'>
  3645. <field var='FORM_TYPE' type='hidden'>
  3646. <value>http://jabber.org/protocol/pubsub#node_config</value>
  3647. </field>
  3648. <field var='pubsub#title'><value>Princely Musings (Atom)</value></field>
  3649. <field var='pubsub#deliver_notifications'><value>1</value></field>
  3650. <field var='pubsub#deliver_payloads'><value>1</value></field>
  3651. <field var='pubsub#notify_config'><value>0</value></field>
  3652. <field var='pubsub#notify_delete'><value>0</value></field>
  3653. <field var='pubsub#notify_retract'><value>0</value></field>
  3654. <field var='pubsub#notify_sub'><value>0</value></field>
  3655. <field var='pubsub#persist_items'><value>1</value></field>
  3656. <field var='pubsub#max_items'><value>10</value></field>
  3657. <field var='pubsub#item_expire'><value>604800</value></field>
  3658. <field var='pubsub#subscribe'><value>1</value></field>
  3659. <field var='pubsub#access_model'><value>open</value></field>
  3660. <field var='pubsub#publish_model'><value>publishers</value></field>
  3661. <field var='pubsub#purge_offline'><value>0</value></field>
  3662. <field var='pubsub#max_payload_size'><value>9216</value></field>
  3663. <field var='pubsub#send_last_published_item'><value>never</value></field>
  3664. <field var='pubsub#presence_based_delivery'><value>0</value></field>
  3665. <field var='pubsub#notification_type'><value>headline</value></field>
  3666. <field var='pubsub#type'><value>http://www.w3.org/2005/Atom</value></field>
  3667. <field var='pubsub#body_xslt'>
  3668. <value>http://jabxslt.jabberstudio.org/atom_body.xslt</value>
  3669. </field>
  3670. </x>
  3671. </configuration>
  3672. </event>
  3673. </message>
  3674. ]]></example>
  3675. </section4>
  3676. </section3>
  3677. </section2>
  3678. <section2 topic='Request Default Node Configuration Options' anchor='owner-default'>
  3679. <p>An entity may want to request information about the default node configuration, e.g. in order to determine whether to perform create-and-configure as previously described. Support for this feature is OPTIONAL.</p>
  3680. <section3 topic='Request' anchor='owner-default-request'>
  3681. <p>To get the node options, the entity MUST send an empty &lt;default/&gt; element to the service with no NodeID; in response, the service SHOULD return the default node options.</p>
  3682. <example caption='Entity requests default node configuration options'><![CDATA[
  3683. <iq type='get'
  3684. from='hamlet@denmark.lit/elsinore'
  3685. to='pubsub.shakespeare.lit'
  3686. id='def1'>
  3687. <pubsub xmlns='http://jabber.org/protocol/pubsub#owner'>
  3688. <default/>
  3689. </pubsub>
  3690. </iq>
  3691. ]]></example>
  3692. </section3>
  3693. <section3 topic='Success Case' anchor='owner-default-success'>
  3694. <p>If no error occurs, the service MUST return the default node configuration options.</p>
  3695. <example caption='Service responds with default node configuration options'><![CDATA[
  3696. <iq type='result'
  3697. from='pubsub.shakespeare.lit'
  3698. to='hamlet@denmark.lit/elsinore'
  3699. id='def1'>
  3700. <pubsub xmlns='http://jabber.org/protocol/pubsub#owner'>
  3701. <default>
  3702. <x xmlns='jabber:x:data' type='form'>
  3703. <field var='FORM_TYPE' type='hidden'>
  3704. <value>http://jabber.org/protocol/pubsub#node_config</value>
  3705. </field>
  3706. <field var='pubsub#title' type='text-single'
  3707. label='A friendly name for the node'/>
  3708. <field var='pubsub#deliver_notifications' type='boolean'
  3709. label='Deliver event notifications'>
  3710. <value>true</value>
  3711. </field>
  3712. <field var='pubsub#deliver_payloads' type='boolean'
  3713. label='Deliver payloads with event notifications'>
  3714. <value>1</value>
  3715. </field>
  3716. <field var='pubsub#description' type='text-single'
  3717. label='A description of the node'/>
  3718. <field var='pubsub#notify_config' type='boolean'
  3719. label='Notify subscribers when the node configuration changes'>
  3720. <value>0</value>
  3721. </field>
  3722. <field var='pubsub#notify_delete' type='boolean'
  3723. label='Notify subscribers when the node is deleted'>
  3724. <value>0</value>
  3725. </field>
  3726. <field var='pubsub#notify_retract' type='boolean'
  3727. label='Notify subscribers when items are removed from the node'>
  3728. <value>0</value>
  3729. </field>
  3730. <field var='pubsub#notify_sub' type='boolean'
  3731. label='Notify owners about new subscribers and unsubscribes'>
  3732. <value>0</value>
  3733. </field>
  3734. <field var='pubsub#persist_items' type='boolean'
  3735. label='Persist items to storage'>
  3736. <value>1</value>
  3737. </field>
  3738. <field var='pubsub#max_items' type='text-single'
  3739. label='Max # of items to persist'>
  3740. <value>10</value>
  3741. </field>
  3742. <field var='pubsub#item_expire' type='text-single'
  3743. label='Time after which to automatically purge items'>
  3744. <value>604800</value>
  3745. </field>
  3746. <field var='pubsub#subscribe' type='boolean'
  3747. label='Whether to allow subscriptions'>
  3748. <value>1</value>
  3749. </field>
  3750. <field var='pubsub#access_model' type='list-single'
  3751. label='Specify the subscriber model'>
  3752. <option><value>authorize</value></option>
  3753. <option><value>open</value></option>
  3754. <option><value>presence</value></option>
  3755. <option><value>roster</value></option>
  3756. <option><value>whitelist</value></option>
  3757. <value>open</value>
  3758. </field>
  3759. <field var='pubsub#roster_groups_allowed' type='list-multi'
  3760. label='Roster groups allowed to subscribe'>
  3761. <option><value>friends</value></option>
  3762. <option><value>courtiers</value></option>
  3763. <option><value>servants</value></option>
  3764. <option><value>enemies</value></option>
  3765. </field>
  3766. <field var='pubsub#publish_model' type='list-single'
  3767. label='Specify the publisher model'>
  3768. <option><value>publishers</value></option>
  3769. <option><value>subscribers</value></option>
  3770. <option><value>open</value></option>
  3771. <value>publishers</value>
  3772. </field>
  3773. <field var='pubsub#purge_offline' type='boolean'
  3774. label='Purge all items when the relevant publisher goes offline?'>
  3775. <value>0</value>
  3776. </field>
  3777. <field var='pubsub#max_payload_size' type='text-single'
  3778. label='Max payload size in bytes'>
  3779. <value>9216</value>
  3780. </field>
  3781. <field var='pubsub#send_last_published_item' type='list-single'
  3782. label='When to send the last published item'>
  3783. <option label='Never'><value>never</value></option>
  3784. <option label='When a new subscription is processed'><value>on_sub</value></option>
  3785. <option label='When a new subscription is processed and whenever a subscriber comes online'>
  3786. <value>on_sub_and_presence</value>
  3787. </option>
  3788. <value>never</value>
  3789. </field>
  3790. <field var='pubsub#presence_based_delivery' type='boolean'
  3791. label='Deliver notifications only to available users'>
  3792. <value>0</value>
  3793. </field>
  3794. <field var='pubsub#notification_type' type='list-single'
  3795. label='Specify the delivery style for notifications'>
  3796. <option><value>normal</value></option>
  3797. <option><value>headline</value></option>
  3798. <value>headline</value>
  3799. </field>
  3800. </x>
  3801. </default>
  3802. </pubsub>
  3803. </iq>
  3804. ]]></example>
  3805. </section3>
  3806. <section3 topic='Error Cases' anchor='owner-default-error'>
  3807. <p>There are several reasons why the default node configuration options request might fail:</p>
  3808. <ol>
  3809. <li>The service does not support node configuration.</li>
  3810. <li>The service does not support retrieval of default node configuration.</li>
  3811. </ol>
  3812. <p>These error cases are described more fully in the following sections.</p>
  3813. <section4 topic='Node Configuration Not Supported' anchor='owner-default-error-noconfig'>
  3814. <p>If the service does not support node configuration, it MUST return a &feature; error, specifying a pubsub-specific error condition of &lt;unsupported/&gt; and a feature of "config-node".</p>
  3815. <example caption='Service does not support node configuration'><![CDATA[
  3816. <iq type='error'
  3817. from='pubsub.shakespeare.lit'
  3818. to='hamlet@denmark.lit/elsinore'
  3819. id='def1'>
  3820. <error type='cancel'>
  3821. <feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  3822. <unsupported xmlns='http://jabber.org/protocol/pubsub#errors'
  3823. feature='config-node'/>
  3824. </error>
  3825. </iq>
  3826. ]]></example>
  3827. </section4>
  3828. <section4 topic='Default Node Configuration Retrieval Not Supported' anchor='owner-default-error-notsupported'>
  3829. <p>If the service does not support retrieval of default node configuration options, it MUST return a &feature; error, specifying a pubsub-specific error condition of &lt;unsupported/&gt; and a feature of "retrieve-default".</p>
  3830. <example caption='Service does not support retrieval of default node configuration options'><![CDATA[
  3831. <iq type='error'
  3832. from='pubsub.shakespeare.lit'
  3833. to='hamlet@denmark.lit/elsinore'
  3834. id='def1'>
  3835. <error type='cancel'>
  3836. <feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  3837. <unsupported xmlns='http://jabber.org/protocol/pubsub#errors'
  3838. feature='retrieve-default'/>
  3839. </error>
  3840. </iq>
  3841. ]]></example>
  3842. </section4>
  3843. </section3>
  3844. </section2>
  3845. <section2 topic='Delete a Node' anchor='owner-delete'>
  3846. <p>If a service supports node creation, it MUST support node deletion. If an implementation persists items, it MUST remove all items from persistent storage before the node itself is deleted.</p>
  3847. <section3 topic='Request' anchor='owner-delete-request'>
  3848. <p>In order to delete a node, a node owner MUST send a node deletion request, consisting of a &lt;delete/&gt; element whose 'node' attribute specifies the NodeID of the node to be deleted.</p>
  3849. <example caption='Owner deletes a node'><![CDATA[
  3850. <iq type='set'
  3851. from='hamlet@denmark.lit/elsinore'
  3852. to='pubsub.shakespeare.lit'
  3853. id='delete1'>
  3854. <pubsub xmlns='http://jabber.org/protocol/pubsub#owner'>
  3855. <delete node='princely_musings'/>
  3856. </pubsub>
  3857. </iq>
  3858. ]]></example>
  3859. <p>The deletion request MAY include the URI of a replacement node to which requests might be redirected. Typically this is an XMPP URI or IRI as described under <link url='#impl-uri'>PubSub URIs</link>, but it can be an HTTP URI or any other scheme.</p>
  3860. <example caption='Owner deletes a node with redirection'><![CDATA[
  3861. <iq type='set'
  3862. from='hamlet@denmark.lit/elsinore'
  3863. to='pubsub.shakespeare.lit'
  3864. id='delete1'>
  3865. <pubsub xmlns='http://jabber.org/protocol/pubsub#owner'>
  3866. <delete node='princely_musings'>
  3867. <redirect uri='xmpp:hamlet@denmark.lit?;node=blog'/>
  3868. </delete>
  3869. </pubsub>
  3870. </iq>
  3871. ]]></example>
  3872. <p>Support for redirection is OPTIONAL on the part of pubsub services.</p>
  3873. </section3>
  3874. <section3 topic='Success Case' anchor='owner-delete-success'>
  3875. <p>If no error occurs, the service MUST inform the owner of success.</p>
  3876. <example caption='Service replies with success'><![CDATA[
  3877. <iq type='result'
  3878. from='pubsub.shakespeare.lit'
  3879. id='delete1'/>
  3880. ]]></example>
  3881. <p>In addition, the service MUST also send notification of node deletion to all subscribers (which SHOULD include pending and unconfigured subscriptions).</p>
  3882. <example caption='Subscribers are notified of node deletion'><![CDATA[
  3883. <message from='pubsub.shakespeare.lit' to='francisco@denmark.lit' id='foo'>
  3884. <event xmlns='http://jabber.org/protocol/pubsub#event'>
  3885. <delete node='princely_musings'>
  3886. <redirect uri='xmpp:hamlet@denmark.lit?;node=blog'/>
  3887. </delete>
  3888. </event>
  3889. </message>
  3890. <message from='pubsub.shakespeare.lit' to='bernardo@denmark.lit' id='bar'>
  3891. <event xmlns='http://jabber.org/protocol/pubsub#event'>
  3892. <delete node='princely_musings'>
  3893. <redirect uri='xmpp:hamlet@denmark.lit?;node=blog'/>
  3894. </delete>
  3895. </event>
  3896. </message>
  3897. ]]></example>
  3898. </section3>
  3899. <section3 topic='Error Cases' anchor='owner-delete-error'>
  3900. <p>There are several reasons why the node deletion request might fail:</p>
  3901. <ol>
  3902. <li>The requesting entity does not have sufficient privileges to delete the node.</li>
  3903. <li>The node is the root collection node, which cannot be deleted (see <cite>XEP-0248</cite>).</li>
  3904. <li>The specified node does not exist.</li>
  3905. </ol>
  3906. <p>These error cases are described more fully in the following sections.</p>
  3907. <section4 topic='Insufficient Privileges' anchor='owner-delete-error-forbidden'>
  3908. <p>If the requesting entity does not have sufficient privileges to delete the node (e.g., is not an owner), the service MUST return a &forbidden; error.</p>
  3909. <example caption='Entity is not an owner'><![CDATA[
  3910. <iq type='error'
  3911. from='pubsub.shakespeare.lit'
  3912. to='hamlet@denmark.lit/elsinore'
  3913. id='delete1'>
  3914. <error type='auth'>
  3915. <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  3916. </error>
  3917. </iq>
  3918. ]]></example>
  3919. </section4>
  3920. <section4 topic='Node Does Not Exist' anchor='owner-delete-error-node'>
  3921. <p>If the requesting entity attempts to delete a node that does not exist, the service MUST return an &notfound; error.</p>
  3922. <example caption='Owner attempts to delete a non-existent node'><![CDATA[
  3923. <iq type='error'
  3924. from='pubsub.shakespeare.lit'
  3925. to='hamlet@denmark.lit/elsinore'
  3926. id='delete1'>
  3927. <error type='cancel'>
  3928. <item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  3929. </error>
  3930. </iq>
  3931. ]]></example>
  3932. </section4>
  3933. </section3>
  3934. </section2>
  3935. <section2 topic='Purge All Node Items' anchor='owner-purge'>
  3936. <p>If a service persists published items, a node owner may want to purge the node of all published items (thus removing all items from the persistent store, with the exception of the last published item, which MAY be cached). It is OPTIONAL for a service to implement this feature.</p>
  3937. <section3 topic='Request' anchor='owner-purge-request'>
  3938. <p>In order to purge a node of all items, a node owner sends a node purge request consisting of a &lt;purge/&gt; element whose 'node' attribute specifies the NodeID of the node to be purged.</p>
  3939. <example caption='Owner purges all items from a node'><![CDATA[
  3940. <iq type='set'
  3941. from='hamlet@denmark.lit/elsinore'
  3942. to='pubsub.shakespeare.lit'
  3943. id='purge1'>
  3944. <pubsub xmlns='http://jabber.org/protocol/pubsub#owner'>
  3945. <purge node='princely_musings'/>
  3946. </pubsub>
  3947. </iq>
  3948. ]]></example>
  3949. </section3>
  3950. <section3 topic='Success Case' anchor='owner-purge-success'>
  3951. <p>If no error occurs, the service MUST purge the node and inform the owner of success.</p>
  3952. <example caption='Service replies with success'><![CDATA[
  3953. <iq type='result'
  3954. from='pubsub.shakespeare.lit'
  3955. id='purge1'/>
  3956. ]]></example>
  3957. <p>If the node or service has been configured to notify subscribers on deletion of items, a purge request MUST NOT result in sending the same notifications as are sent when deleting items (since purging a node with many persisted items could result in a large number of notifications); instead, the node MUST send a single notification to each subscriber, containing an empty &lt;purge/&gt; child element.</p>
  3958. <example caption='Subscribers are notified of node purge'><![CDATA[
  3959. <message from='pubsub.shakespeare.lit' to='francisco@denmark.lit' id='foo'>
  3960. <event xmlns='http://jabber.org/protocol/pubsub#event'>
  3961. <purge node='princely_musings'/>
  3962. </event>
  3963. </message>
  3964. <message from='pubsub.shakespeare.lit' to='bernardo@denmark.lit' id='bar'>
  3965. <event xmlns='http://jabber.org/protocol/pubsub#event'>
  3966. <purge node='princely_musings'/>
  3967. </event>
  3968. </message>
  3969. ]]></example>
  3970. </section3>
  3971. <section3 topic='Error Cases' anchor='owner-purge-error'>
  3972. <p>There are several reasons why the node purge request might fail:</p>
  3973. <ol>
  3974. <li>The node or service does not support node purging.</li>
  3975. <li>The requesting entity does not have sufficient privileges to purge the node.</li>
  3976. <li>The node is not configured to persist items.</li>
  3977. <li>The specified node does not exist.</li>
  3978. </ol>
  3979. <p>These error cases are described more fully in the following sections.</p>
  3980. <section4 topic='Node Purging Not Supported' anchor='owner-purge-error-notsupported'>
  3981. <p>If the node or service does not support node purging, it MUST return a &feature; error, specifying a pubsub-specific error condition of &lt;unsupported/&gt; and a feature of "purge-nodes".</p>
  3982. <example caption='Service does not support node purging'><![CDATA[
  3983. <iq type='error'
  3984. from='pubsub.shakespeare.lit'
  3985. to='hamlet@denmark.lit/elsinore'
  3986. id='purge1'>
  3987. <error type='cancel'>
  3988. <feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  3989. <unsupported xmlns='http://jabber.org/protocol/pubsub#errors'
  3990. feature='purge-nodes'/>
  3991. </error>
  3992. </iq>
  3993. ]]></example>
  3994. </section4>
  3995. <section4 topic='Insufficient Privileges' anchor='owner-purge-error-forbidden'>
  3996. <p>If the requesting entity does not have sufficient privileges to purge the node (e.g., because it is not a node owner), the service MUST return a &forbidden; error.</p>
  3997. <example caption='Entity is not an owner'><![CDATA[
  3998. <iq type='error'
  3999. from='pubsub.shakespeare.lit'
  4000. id='purge1'>
  4001. <error type='auth'>
  4002. <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  4003. </error>
  4004. </iq>
  4005. ]]></example>
  4006. </section4>
  4007. <section4 topic='Node Does Not Persist Items' anchor='owner-purge-error-nopersist'>
  4008. <p>If the service or node does not persist items (e.g., because the node is a collection node as described in <cite>XEP-0248</cite>), it MUST return a &feature; error, specifying a pubsub-specific error condition of &lt;unsupported/&gt; and a feature of "persistent-items".</p>
  4009. <example caption='Node is not configured for persistent items'><![CDATA[
  4010. <iq type='error'
  4011. from='pubsub.shakespeare.lit'
  4012. id='purge1'>
  4013. <error type='cancel'>
  4014. <feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  4015. <unsupported xmlns='http://jabber.org/protocol/pubsub#errors'
  4016. feature='persistent-items'/>
  4017. </error>
  4018. </iq>
  4019. ]]></example>
  4020. </section4>
  4021. <section4 topic='Node Does Not Exist' anchor='owner-purge-error-node'>
  4022. <p>If the node does not exist, the service MUST return an &notfound; error.</p>
  4023. <example caption='Node does not exist'><![CDATA[
  4024. <iq type='error'
  4025. from='pubsub.shakespeare.lit'
  4026. id='purge1'>
  4027. <error type='cancel'>
  4028. <item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  4029. </error>
  4030. </iq>
  4031. ]]></example>
  4032. </section4>
  4033. </section3>
  4034. </section2>
  4035. <section2 topic='Manage Subscription Requests' anchor='owner-subreq'>
  4036. <p>A service MAY send subscription approval requests to the node owner(s) at any time. An approval request consists of a message stanza containing a Data Form scoped by the "http://jabber.org/protocol/pubsub#subscribe_authorization" FORM_TYPE. The form MUST contain a boolean field that has a 'var' attribute of "pubsub#allow", which is the field that designates whether or not to allow the subscription request. The form SHOULD include fields that specify the node identifier and the JID of the pending subscriber. The message MAY include a &BODY; element that contains natural-language text explaining that the message contains a pending subscription form.</p>
  4037. <example caption='Service sends authorization request to node owner'><![CDATA[
  4038. <message to='hamlet@denmark.lit' from='pubsub.shakespeare.lit' id='approve1'>
  4039. <x xmlns='jabber:x:data' type='form'>
  4040. <title>PubSub subscriber request</title>
  4041. <instructions>
  4042. To approve this entity&apos;s subscription request,
  4043. click the OK button. To deny the request, click the
  4044. cancel button.
  4045. </instructions>
  4046. <field var='FORM_TYPE' type='hidden'>
  4047. <value>http://jabber.org/protocol/pubsub#subscribe_authorization</value>
  4048. </field>
  4049. <field var='pubsub#subid' type='hidden'><value>123-abc</value></field>
  4050. <field var='pubsub#node' type='text-single' label='Node ID'>
  4051. <value>princely_musings</value>
  4052. </field>
  4053. <field var='pusub#subscriber_jid' type='jid-single' label='Subscriber Address'>
  4054. <value>horatio@denmark.lit</value>
  4055. </field>
  4056. <field var='pubsub#allow' type='boolean'
  4057. label='Allow this JID to subscribe to this pubsub node?'>
  4058. <value>false</value>
  4059. </field>
  4060. </x>
  4061. </message>
  4062. ]]></example>
  4063. <p>In order to approve the request, the owner shall submit the form and set the "pubsub#allow" field to a value of "1" or "true"; for tracking purposes the message MUST reflect the 'id' attribute originally provided.</p>
  4064. <example caption='Owner approves subscription request'><![CDATA[
  4065. <message from='hamlet@denmark.lit/elsinore' to='pubsub.shakespeare.lit' id='approve1'>
  4066. <x xmlns='jabber:x:data' type='submit'>
  4067. <field var='FORM_TYPE' type='hidden'>
  4068. <value>http://jabber.org/protocol/pubsub#subscribe_authorization</value>
  4069. </field>
  4070. <field var='pubsub#subid'>
  4071. <value>123-abc</value>
  4072. </field>
  4073. <field var='pubsub#node'>
  4074. <value>princely_musings</value>
  4075. </field>
  4076. <field var='pubsub#subscriber_jid'>
  4077. <value>horatio@denmark.lit</value>
  4078. </field>
  4079. <field var='pubsub#allow'>
  4080. <value>true</value>
  4081. </field>
  4082. </x>
  4083. </message>
  4084. ]]></example>
  4085. <p>The service then SHOULD notify the approved subscriber (see the <link url='#impl-subchange'>Notification of Subscription State Changes</link> section of this document).</p>
  4086. <example caption='Subscription approval notification'><![CDATA[
  4087. <message
  4088. from='pubsub.shakespeare.lit'
  4089. to='horatio@denmark.lit'
  4090. id='approvalnotify1'>
  4091. <event xmlns='http://jabber.org/protocol/pubsub#event'>
  4092. <subscription node='princely_musings' jid='horatio@denmark.lit' subscription='subscribed'/>
  4093. </event>
  4094. </message>
  4095. ]]></example>
  4096. <p>In order to deny the request, the owner shall submit the form and set the "pubsub#allow" field to a value of "0" or "false"; as above, the message MUST reflect the 'id' attribute originally provided.</p>
  4097. <example caption='Owner denies subscription request'><![CDATA[
  4098. <message from='hamlet@denmark.lit/elsinore' to='pubsub.shakespeare.lit' id='approve1'>
  4099. <x xmlns='jabber:x:data' type='submit'>
  4100. <field var='FORM_TYPE' type='hidden'>
  4101. <value>http://jabber.org/protocol/pubsub#subscribe_authorization</value>
  4102. </field>
  4103. <field var='pubsub#subid'>
  4104. <value>123-abc</value>
  4105. </field>
  4106. <field var='pubsub#node'>
  4107. <value>princely_musings</value>
  4108. </field>
  4109. <field var='pubsub#subscriber_jid'>
  4110. <value>horatio@denmark.lit</value>
  4111. </field>
  4112. <field var='pubsub#allow'>
  4113. <value>false</value>
  4114. </field>
  4115. </x>
  4116. </message>
  4117. ]]></example>
  4118. <p>The service then SHOULD notify the denied subscriber (see the <link url='#impl-subchange'>Notification of Subscription State Changes</link> section of this document).</p>
  4119. <example caption='Subscription cancellation / denial notification'><![CDATA[
  4120. <message
  4121. from='pubsub.shakespeare.lit'
  4122. to='horatio@denmark.lit'
  4123. id='unsubnotify1'>
  4124. <event xmlns='http://jabber.org/protocol/pubsub#event'>
  4125. <subscription node='princely_musings' jid='horatio@denmark.lit' subscription='none'/>
  4126. </event>
  4127. </message>
  4128. ]]></example>
  4129. <p>In order to cancel the form submission, the owner shall reply with the form's 'type' attribute set to "cancel".</p>
  4130. <example caption='Owner cancels form submission'><![CDATA[
  4131. <message from='hamlet@denmark.lit/elsinore' to='pubsub.shakespeare.lit' id='approve1'>
  4132. <x xmlns='jabber:x:data' type='cancel'>
  4133. <field var='FORM_TYPE' type='hidden'>
  4134. <value>http://jabber.org/protocol/pubsub#subscribe_authorization</value>
  4135. </field>
  4136. </x>
  4137. </message>
  4138. ]]></example>
  4139. <p>The service MUST check the "pubsub#allow" field to see if the subscription should be allowed or denied. If the owner cancels the Data Form, then the subscription request MUST remain in the pending state.</p>
  4140. </section2>
  4141. <section2 topic='Process Pending Subscription Requests' anchor='owner-subreq-process'>
  4142. <p>A node owner may want to request all of the pending subscription requests for all of their nodes at a service. It is OPTIONAL for a service to implement this feature.</p>
  4143. <p>This feature MUST be implemented using the &xep0050; protocol, where the command name ('node' attribute of the command element) MUST have a value of "http://jabber.org/protocol/pubsub#get-pending".</p>
  4144. <section3 topic='Request' anchor='owner-subreq-request'>
  4145. <example caption='Owner requests pending subscription requests'><![CDATA[
  4146. <iq type='set'
  4147. from='hamlet@denmark.lit/elsinore'
  4148. to='pubsub.shakespeare.lit'
  4149. id='pending1'>
  4150. <command xmlns='http://jabber.org/protocol/commands'
  4151. node='http://jabber.org/protocol/pubsub#get-pending'
  4152. action='execute'/>
  4153. </iq>
  4154. ]]></example>
  4155. </section3>
  4156. <section3 topic='Success Case' anchor='owner-subreq-success'>
  4157. <p>If no error occurs, the service SHOULD return a data form for managing subscription requests, which MUST contain a single field with a 'var' attribute value of "pubsub#node" whose &lt;option/&gt; elements specify the nodes for which the requesting entity has subscription approval privileges (as an optimization, the service MAY specify only the nodes that have subscription requests pending).</p>
  4158. <example caption='Service responds with data form to be populated'><![CDATA[
  4159. <iq type='result'
  4160. from='pubsub.shakespeare.lit'
  4161. to='hamlet@denmark.lit/elsinore'
  4162. id='pending1'>
  4163. <command xmlns='http://jabber.org/protocol/commands'
  4164. sessionid='pubsub-get-pending:20031021T150901Z-600'
  4165. node='http://jabber.org/protocol/pubsub#get-pending'
  4166. status='executing'
  4167. action='execute'>
  4168. <x xmlns='jabber:x:data' type='form'>
  4169. <field var='FORM_TYPE' type='hidden'>
  4170. <value>http://jabber.org/protocol/pubsub#subscribe_authorization</value>
  4171. </field>
  4172. <field type='list-single' var='pubsub#node'>
  4173. <option><value>princely_musings</value></option>
  4174. <option><value>news_from_elsinore</value></option>
  4175. </field>
  4176. </x>
  4177. </command>
  4178. </iq>
  4179. ]]></example>
  4180. </section3>
  4181. <section3 topic='Error Cases' anchor='owner-subreq-error'>
  4182. <p>There are several reasons why the pending subscription approval request might fail:</p>
  4183. <ol>
  4184. <li>The service does not support the ad-hoc commands protocol.</li>
  4185. <li>The service supports ad-hoc commands but does not support the "get-pending" feature.</li>
  4186. <li>The requesting entity does not have sufficient privileges to approve subscription requests.</li>
  4187. <li>The specified node does not exist.</li>
  4188. </ol>
  4189. <p>These error cases are described more fully in the following sections.</p>
  4190. <section4 topic='Ad-Hoc Commands Not Supported' anchor='owner-subreq-error-adhoc'>
  4191. <p>If the service does not support the ad-hoc commands protocol, it MUST respond with a &unavailable; error.</p>
  4192. <example caption='Service responds with node not found'><![CDATA[
  4193. <iq type='error'
  4194. from='pubsub.shakespeare.lit'
  4195. to='hamlet@denmark.lit/elsinore'
  4196. id='pending1'>
  4197. <error type='cancel'>
  4198. <service-unavailable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  4199. </error>
  4200. </iq>
  4201. ]]></example>
  4202. </section4>
  4203. <section4 topic='Get-Pending Not Supported' anchor='owner-subreq-error-getpending'>
  4204. <p>If the service does not support the "get-pending" feature, it MUST respond with a &feature; error, specifying a pubsub-specific error condition of &lt;unsupported/&gt; and a feature of "get-pending".</p>
  4205. <example caption='Service responds with node not found'><![CDATA[
  4206. <iq type='error'
  4207. from='pubsub.shakespeare.lit'
  4208. to='hamlet@denmark.lit/elsinore'
  4209. id='pending1'>
  4210. <error type='cancel'>
  4211. <feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  4212. <unsupported xmlns='http://jabber.org/protocol/pubsub#errors'
  4213. feature='get-pending'/>
  4214. </error>
  4215. </iq>
  4216. ]]></example>
  4217. </section4>
  4218. <section4 topic='Insufficient Privileges' anchor='owner-subreq-error-forbidden'>
  4219. <p>If the requesting entity does not have sufficient privileges to approve subscription requests, the service MUST respond with a &forbidden; error.</p>
  4220. <example caption='Entity does not have sufficient privileges to approve subscription requests'><![CDATA[
  4221. <iq type='error'
  4222. from='pubsub.shakespeare.lit'
  4223. to='hamlet@denmark.lit/elsinore'
  4224. id='pending1'>
  4225. <error type='cancel'>
  4226. <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  4227. </error>
  4228. </iq>
  4229. ]]></example>
  4230. </section4>
  4231. <section4 topic='Node Does Not Exist' anchor='owner-subreq-error-node'>
  4232. <p>If the requested node does not exist, the service MUST respond with an &notfound; error.</p>
  4233. <example caption='Service responds with node not found'><![CDATA[
  4234. <iq type='error'
  4235. from='pubsub.shakespeare.lit'
  4236. to='hamlet@denmark.lit/elsinore'
  4237. id='pending1'>
  4238. <error type='cancel'>
  4239. <item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  4240. </error>
  4241. </iq>
  4242. ]]></example>
  4243. </section4>
  4244. </section3>
  4245. <section3 topic='Per-Node Request' anchor='owner-subreq-pernode'>
  4246. <p>Upon receiving the data form for managing subscription requests, the owner then MAY request pending subscription approval requests for a given node.</p>
  4247. <example caption='Owner requests all pending subscription requests for a node'><![CDATA[
  4248. <iq type='set' to='pubsub.shakespeare.lit' id='pending2'>
  4249. <command xmlns='http://jabber.org/protocol/commands'
  4250. sessionid='pubsub-get-pending:20031021T150901Z-600'
  4251. node='http://jabber.org/protocol/pubsub#get-pending'
  4252. action='execute'>
  4253. <x xmlns='jabber:x:data' type='submit'>
  4254. <field var='pubsub#node'>
  4255. <value>princely_musings</value>
  4256. </field>
  4257. </x>
  4258. </command>
  4259. </iq>
  4260. ]]></example>
  4261. <p>If no error occurs, the service shall respond with success.</p>
  4262. <example caption='Service responds with success'><![CDATA[
  4263. <iq from='pubsub.shakespeare.lit'
  4264. id='pending2'
  4265. to='hamlet@denmark.lit/elsinore'
  4266. type='result'>
  4267. <command xmlns='http://jabber.org/protocol/commands'
  4268. sessionid='pubsub-get-pending:20031021T150901Z-600'
  4269. node='http://jabber.org/protocol/pubsub#get-pending'
  4270. action='completed'/>
  4271. </iq>
  4272. ]]></example>
  4273. <p>The service shall then send one subscription approval message for each pending subscription request, as shown above for a single pending subscription request.</p>
  4274. <p>Note: A service SHOULD conform to its affiliation policies in maintaining the list of pending subscriptions. In particular, if the affiliation of an entity with a pending subscription is modified to owner or publisher, the service SHOULD automatically approve the subscription request and remove the entity's previous request from the pending list. Similarly, if the affiliation of an entity with a pending subscription is modified to outcast, the service SHOULD automatically reject the subscription request and remove the entity's previous request from the pending list. (If an entity's subscription request is denied, the service SHOULD send a &MESSAGE; to the entity, where the message conforms to the format described in the <link url='#impl-subchange'>Notification of Subscription State Changes</link> section of this document.)</p>
  4275. </section3>
  4276. </section2>
  4277. <section2 topic='Manage Subscriptions' anchor='owner-subscriptions'>
  4278. <p>A node owner may want to edit the list of subscriptions associated with a given node. Support for this feature ("pubsub#manage-subscriptions") is OPTIONAL.</p>
  4279. <section3 topic='Retrieve Subscriptions List' anchor='owner-subscriptions-retrieve'>
  4280. <p>First the owner retrieves the subscriptions list.</p>
  4281. <section4 topic='Request' anchor='owner-subscriptions-retrieve-request'>
  4282. <p>In order to request a list of all subscriptions, a node owner MUST send a subscriptions request, consisting of a &lt;subscriptions/&gt; element whose 'node' attribute specifies the NodeID of the relevant node.</p>
  4283. <example caption='Owner requests all subscriptions'><![CDATA[
  4284. <iq type='get'
  4285. from='hamlet@denmark.lit/elsinore'
  4286. to='pubsub.shakespeare.lit'
  4287. id='subman1'>
  4288. <pubsub xmlns='http://jabber.org/protocol/pubsub#owner'>
  4289. <subscriptions node='princely_musings'/>
  4290. </pubsub>
  4291. </iq>
  4292. ]]></example>
  4293. </section4>
  4294. <section4 topic='Success Case' anchor='owner-subscriptions-retrieve-success'>
  4295. <p>If no error occurs, the service MUST return the list of subscriptions for entities whose subscription state is "subscribed" or "unconfigured" (it MUST NOT return entities whose subscription state is "none" and SHOULD NOT return entities whose subscription state is "pending"). The result MAY specify multiple &lt;subscription/&gt; elements for the same entity (JID), but each element MUST possess a distinct value of the 'subid' attribute (as shown below).</p>
  4296. <example caption='Service returns list of subscriptions'><![CDATA[
  4297. <iq type='result'
  4298. from='pubsub.shakespeare.lit'
  4299. to='hamlet@denmark.lit/elsinore'
  4300. id='subman1'>
  4301. <pubsub xmlns='http://jabber.org/protocol/pubsub#owner'>
  4302. <subscriptions node='princely_musings'>
  4303. <subscription jid='hamlet@denmark.lit' subscription='subscribed'/>
  4304. <subscription jid='polonius@denmark.lit' subscription='unconfigured'/>
  4305. <subscription jid='bernardo@denmark.lit' subscription='subscribed' subid='123-abc'/>
  4306. <subscription jid='bernardo@denmark.lit' subscription='subscribed' subid='004-yyy'/>
  4307. </subscriptions>
  4308. </pubsub>
  4309. </iq>
  4310. ]]></example>
  4311. </section4>
  4312. <section4 topic='Error Cases' anchor='owner-subscriptions-retrieve-error'>
  4313. <p>There are several reasons why the manage subscriptions request might fail:</p>
  4314. <ol>
  4315. <li>The service does not support subscription management.</li>
  4316. <li>The requesting entity does not have sufficient privileges to manage subscriptions.</li>
  4317. <li>The specified node does not exist.</li>
  4318. </ol>
  4319. <p>These error cases are described more fully in the following sections.</p>
  4320. <section5 topic='Subscription Management Not Supported' anchor='owner-subscriptions-retrieve-error-notsupported'>
  4321. <p>If an implementation does not support subscription management, it MUST return a &feature; error, specifying a pubsub-specific error condition of &lt;unsupported/&gt; and a feature of "manage-subscriptions".</p>
  4322. <example caption='Node or service does not support subscription management'><![CDATA[
  4323. <iq type='error'
  4324. from='pubsub.shakespeare.lit'
  4325. id='subman1'>
  4326. <error type='cancel'>
  4327. <feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  4328. <unsupported xmlns='http://jabber.org/protocol/pubsub#errors'
  4329. feature='manage-subscriptions'/>
  4330. </error>
  4331. </iq>
  4332. ]]></example>
  4333. </section5>
  4334. <section5 topic='Insufficient Privileges' anchor='owner-subscriptions-retrieve-error-forbidden'>
  4335. <p>If the requesting entity is not a node owner, the service MUST return a &forbidden; error.</p>
  4336. <example caption='Entity is not an owner'><![CDATA[
  4337. <iq type='error'
  4338. from='pubsub.shakespeare.lit'
  4339. id='subman1'>
  4340. <error type='auth'>
  4341. <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  4342. </error>
  4343. </iq>
  4344. ]]></example>
  4345. </section5>
  4346. <section5 topic='Node Does Not Exist' anchor='owner-subscriptions-retrieve-error-node'>
  4347. <p>If the node does not exist, the service MUST return an &notfound; error.</p>
  4348. <example caption='Node does not exist'><![CDATA[
  4349. <iq type='error'
  4350. from='pubsub.shakespeare.lit'
  4351. id='subman1'>
  4352. <error type='cancel'>
  4353. <item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  4354. </error>
  4355. </iq>
  4356. ]]></example>
  4357. </section5>
  4358. </section4>
  4359. </section3>
  4360. <section3 topic='Modify Subscriptions' anchor='owner-subscriptions-modify'>
  4361. <section4 topic='Request' anchor='owner-subscriptions-modify-request'>
  4362. <p>Upon receiving the subscriptions list, the node owner MAY modify subscription states. The owner MUST send only modified subscription states (i.e., a "delta"), not the complete list. (Note: If the 'subscription' attribute is not specified in a modification request, then the value MUST NOT be changed.)</p>
  4363. <example caption='Owner modifies subscriptions'><![CDATA[
  4364. <iq type='set'
  4365. from='hamlet@denmark.lit/elsinore'
  4366. to='pubsub.shakespeare.lit'
  4367. id='subman2'>
  4368. <pubsub xmlns='http://jabber.org/protocol/pubsub#owner'>
  4369. <subscriptions node='princely_musings'>
  4370. <subscription jid='bard@shakespeare.lit' subscription='subscribed'/>
  4371. </subscriptions>
  4372. </pubsub>
  4373. </iq>
  4374. ]]></example>
  4375. </section4>
  4376. <section4 topic='Success Case' anchor='owner-subscriptions-modify-success'>
  4377. <example caption='Service responds with success'><![CDATA[
  4378. <iq type='result'
  4379. from='pubsub.shakespeare.lit'
  4380. id='subman2'/>
  4381. ]]></example>
  4382. </section4>
  4383. <section4 topic='Error Cases' anchor='owner-subscriptions-modify-error'>
  4384. <p>There are several reasons why the modify subscriptions request might fail:</p>
  4385. <ol>
  4386. <li>The service does not support subscription management.</li>
  4387. <li>The requesting entity does not have sufficient privileges to manage subscriptions.</li>
  4388. <li>The specified node does not exist.</li>
  4389. </ol>
  4390. <p>These error cases are described more fully in the following sections.</p>
  4391. <section5 topic='Subscription Management Not Supported' anchor='owner-subscriptions-modify-error-notsupported'>
  4392. <p>If an implementation does not support subscription management, it MUST return a &feature; error, specifying a pubsub-specific error condition of &lt;unsupported/&gt; and a feature of "manage-subscriptions".</p>
  4393. <example caption='Node or service does not support subscription management'><![CDATA[
  4394. <iq type='error'
  4395. from='pubsub.shakespeare.lit'
  4396. id='subman2'>
  4397. <error type='cancel'>
  4398. <feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  4399. <unsupported xmlns='http://jabber.org/protocol/pubsub#errors'
  4400. feature='manage-subscriptions'/>
  4401. </error>
  4402. </iq>
  4403. ]]></example>
  4404. </section5>
  4405. <section5 topic='Insufficient Privileges' anchor='owner-subscriptions-retrieve-error-forbidden'>
  4406. <p>If the requesting entity is not a node owner, the service MUST return a &forbidden; error.</p>
  4407. <example caption='Entity is not an owner'><![CDATA[
  4408. <iq type='error'
  4409. from='pubsub.shakespeare.lit'
  4410. id='subman1'>
  4411. <error type='auth'>
  4412. <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  4413. </error>
  4414. </iq>
  4415. ]]></example>
  4416. </section5>
  4417. <section5 topic='Node Does Not Exist' anchor='owner-subscriptions-retrieve-error-node'>
  4418. <p>If the node does not exist, the service MUST return an &notfound; error.</p>
  4419. <example caption='Node does not exist'><![CDATA[
  4420. <iq type='error'
  4421. from='pubsub.shakespeare.lit'
  4422. id='subman2'>
  4423. <error type='cancel'>
  4424. <item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  4425. </error>
  4426. </iq>
  4427. ]]></example>
  4428. </section5>
  4429. </section4>
  4430. <section4 topic='Multiple Simultaneous Modifications' anchor='owner-subscriptions-multi'>
  4431. <p>The owner MAY change multiple subscriptions in a single request. If one of the entity elements specified is invalid, the service MUST return an IQ error (which SHOULD be &notacceptable;) with the invalid entries, where the subscription returned is the original, un-altered subscription.</p>
  4432. <example caption='Owner sets subscription for multiple entities'><![CDATA[
  4433. <iq type='set'
  4434. from='hamlet@denmark.lit/elsinore'
  4435. to='pubsub.shakespeare.lit'
  4436. id='subman3'>
  4437. <pubsub xmlns='http://jabber.org/protocol/pubsub#owner'>
  4438. <subscriptions node='princely_musings'>
  4439. <subscription jid='polonius@denmark.lit' subscription='none'/>
  4440. <subscription jid='bard@shakespeare.lit' subscription='subscribed'/>
  4441. </subscriptions>
  4442. </pubsub>
  4443. </iq>
  4444. ]]></example>
  4445. <example caption='Service responds with an error'><![CDATA[
  4446. <iq type='error'
  4447. from='pubsub.shakespeare.lit'
  4448. to='hamlet@denmark.lit/elsinore'
  4449. id='subman3'>
  4450. <pubsub xmlns='http://jabber.org/protocol/pubsub#owner'>
  4451. <subscriptions node='princely_musings'>
  4452. <subscription jid='polonius@denmark.lit' subscription='subscribed'/>
  4453. </subscriptions>
  4454. </pubsub>
  4455. <error type='modify'>
  4456. <not-acceptable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  4457. </error>
  4458. </iq>
  4459. ]]></example>
  4460. <p>If errors occur during a modification request for multiple entities, the pubsub service MUST return any &lt;subscription/&gt; element(s) which caused the error. Returned entities which failed to be modified MUST include the existing 'subscription' attribute. Any entity elements which are not returned in an IQ error case MUST be treated as successful modifications. The owner MAY specify multiple &lt;subscription/&gt; elements for the same entity, but each element MUST possess a distinct value of the 'subid' attribute.</p>
  4461. </section4>
  4462. </section3>
  4463. <section3 topic='Delete a Subscriber' anchor='owner-subscriptions-delete'>
  4464. <p>In order to remove an entity from the subscriptions list, the owner MUST set the value of the 'subscription' attribute to "none" and the service MUST remove that entity from the subscriptions list and not return it in response to future list requests.</p>
  4465. </section3>
  4466. <section3 topic='Notifying Subscribers' anchor='owner-subscriptions-notifysub'>
  4467. <p>An implementation SHOULD notify an entity whose subscription has changed (see the <link url='#impl-subchange'>Notification of Subscription State Changes</link> section of this document).</p>
  4468. <example caption='Service sends notification of subscription change'><![CDATA[
  4469. <message from='pubsub.shakespeare.lit' to='polonius@denmark.lit'>
  4470. <event xmlns='http://jabber.org/protocol/pubsub#event'>
  4471. <subscription node='princely_musings' jid='polonius@denmark.lit' subscription='none'/>
  4472. </event>
  4473. </message>
  4474. ]]></example>
  4475. </section3>
  4476. </section2>
  4477. <section2 topic='Manage Affiliations' anchor='owner-affiliations'>
  4478. <p>A node owner may want to manage the affiliations of entities associated with a given node and to set affiliations for new entities. Support for this feature ("pubsub#modify-affiliations") is OPTIONAL.</p>
  4479. <section3 topic='Retrieve Affiliations List' anchor='owner-affiliations-retrieve'>
  4480. <p>First the owner retrieves the affiliation list.</p>
  4481. <section4 topic='Request' anchor='owner-affiliations-retrieve-request'>
  4482. <p>In order to request a list of all affiliated entities, a node owner MUST send an affiliations request, consisting of an &lt;affiliations/&gt; element whose 'node' attribute specifies the NodeID of the relevant node.</p>
  4483. <example caption='Owner requests all affiliated entities'><![CDATA[
  4484. <iq type='get'
  4485. from='hamlet@denmark.lit/elsinore'
  4486. to='pubsub.shakespeare.lit'
  4487. id='ent1'>
  4488. <pubsub xmlns='http://jabber.org/protocol/pubsub#owner'>
  4489. <affiliations node='princely_musings'/>
  4490. </pubsub>
  4491. </iq>
  4492. ]]></example>
  4493. </section4>
  4494. <section4 topic='Success Case' anchor='owner-affiliations-retrieve-success'>
  4495. <p>If no error occurs, the service MUST return the list of entities whose affiliation is "owner", "member", "publisher", "publish-only", or "outcast" (it MUST NOT return entities whose affiliation is "none").</p>
  4496. <example caption='Service returns list of affiliated entities'><![CDATA[
  4497. <iq type='result'
  4498. from='pubsub.shakespeare.lit'
  4499. to='hamlet@denmark.lit/elsinore'
  4500. id='ent1'>
  4501. <pubsub xmlns='http://jabber.org/protocol/pubsub#owner'>
  4502. <affiliations node='princely_musings'>
  4503. <affiliation jid='hamlet@denmark.lit' affiliation='owner'/>
  4504. <affiliation jid='polonius@denmark.lit' affiliation='outcast'/>
  4505. </affiliations>
  4506. </pubsub>
  4507. </iq>
  4508. ]]></example>
  4509. </section4>
  4510. <section4 topic='Error Cases' anchor='owner-affiliations-retrieve-error'>
  4511. <p>There are several reasons why the affiliated entities request might fail:</p>
  4512. <ol>
  4513. <li>The service does not support modification of affiliations.</li>
  4514. <li>The requesting entity does not have sufficient privileges to modify affiliations.</li>
  4515. <li>The specified node does not exist.</li>
  4516. </ol>
  4517. <p>These error cases are described more fully in the following sections.</p>
  4518. <section5 topic='Affiliation Modification Not Supported' anchor='owner-affiliations-retrieve-notsupported'>
  4519. <p>If an implementation does not support modification of affiliations, it MUST return a &feature; error, specifying a pubsub-specific error condition of &lt;unsupported/&gt; and a feature of "modify-affiliations".</p>
  4520. <example caption='Node or service does not support affiliation management'><![CDATA[
  4521. <iq type='error'
  4522. from='pubsub.shakespeare.lit'
  4523. id='ent1'>
  4524. <error type='cancel'>
  4525. <feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  4526. <unsupported xmlns='http://jabber.org/protocol/pubsub#errors'
  4527. feature='modify-affiliations'/>
  4528. </error>
  4529. </iq>
  4530. ]]></example>
  4531. </section5>
  4532. <section5 topic='Insufficient Privileges' anchor='owner-affiliations-retrieve-forbidden'>
  4533. <p>If the requesting entity is not a node owner, the service MUST return a &forbidden; error.</p>
  4534. <example caption='Entity is not an owner'><![CDATA[
  4535. <iq type='error'
  4536. from='pubsub.shakespeare.lit'
  4537. id='ent1'>
  4538. <error type='auth'>
  4539. <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  4540. </error>
  4541. </iq>
  4542. ]]></example>
  4543. </section5>
  4544. <section5 topic='Node Does Not Exist' anchor='owner-affiliations-retrieve-node'>
  4545. <p>If the node does not exist, the service MUST return an &notfound; error.</p>
  4546. <example caption='Node does not exist'><![CDATA[
  4547. <iq type='error'
  4548. from='pubsub.shakespeare.lit'
  4549. id='ent1'>
  4550. <error type='cancel'>
  4551. <item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  4552. </error>
  4553. </iq>
  4554. ]]></example>
  4555. </section5>
  4556. </section4>
  4557. </section3>
  4558. <section3 topic='Modify Affiliation' anchor='owner-affiliations-modify'>
  4559. <p>A node owner may want to edit the affiliation of an entity associated with a given node or to set the affiliation for a new entity.</p>
  4560. <section4 topic='Request' anchor='owner-affiliations-modify-request'>
  4561. <p>In order to modify an affiliation, a node owner MUST send an IQ set containing the modified affiliation or affiliations. The owner MUST send only modified affiliations (i.e., a "delta"), not the complete list. (Note: If the 'affiliation' attribute is not specified in a modification request, then the value MUST NOT be changed.)</p>
  4562. <example caption='Owner modifies affiliation'><![CDATA[
  4563. <iq type='set'
  4564. from='hamlet@denmark.lit/elsinore'
  4565. to='pubsub.shakespeare.lit'
  4566. id='ent2'>
  4567. <pubsub xmlns='http://jabber.org/protocol/pubsub#owner'>
  4568. <affiliations node='princely_musings'>
  4569. <affiliation jid='bard@shakespeare.lit' affiliation='publisher'/>
  4570. </affiliations>
  4571. </pubsub>
  4572. </iq>
  4573. ]]></example>
  4574. </section4>
  4575. <section4 topic='Success Case' anchor='owner-affiliations-modify-success'>
  4576. <example caption='Service responds with success'><![CDATA[
  4577. <iq type='result'
  4578. from='pubsub.shakespeare.lit'
  4579. id='ent2'/>
  4580. ]]></example>
  4581. </section4>
  4582. <section4 topic='Error Cases' anchor='owner-affiliations-modify-error'>
  4583. <p>There are several reasons why the modify-affiliations request might fail:</p>
  4584. <ol>
  4585. <li>The requested affiliation is not supported by the node or service.</li>
  4586. <li>The service does not support modification of affiliations.</li>
  4587. <li>The requesting entity does not have sufficient privileges to modify affiliations.</li>
  4588. <li>The specified node does not exist.</li>
  4589. </ol>
  4590. <p>These error cases are described more fully in the following sections.</p>
  4591. <section5 topic='Affiliation Modification Not Supported' anchor='owner-affiliations-retrieve-notsupported'>
  4592. <p>If an implementation does not support modification of affiliations, it MUST return a &feature; error, specifying a pubsub-specific error condition of &lt;unsupported/&gt; and a feature of "modify-affiliations".</p>
  4593. <example caption='Node or service does not support affiliation management'><![CDATA[
  4594. <iq type='error'
  4595. from='pubsub.shakespeare.lit'
  4596. id='ent1'>
  4597. <error type='cancel'>
  4598. <feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  4599. <unsupported xmlns='http://jabber.org/protocol/pubsub#errors'
  4600. feature='modify-affiliations'/>
  4601. </error>
  4602. </iq>
  4603. ]]></example>
  4604. </section5>
  4605. <section5 topic='Affiliation Not Supported' anchor='owner-affiliations-nosuchaffil'>
  4606. <p>If the node or service does not support the requested affiliation, it MUST return a &feature; error, specifying a pubsub-specific error condition of &lt;unsupported/&gt; and a feature of "member-affiliation", "outcast-affiliation", "publisher-affiliation", or "publish-only-affiliation" as appropriate.</p>
  4607. <example caption='Node or service does not support the requested affiliation'><![CDATA[
  4608. <iq type='error'
  4609. from='pubsub.shakespeare.lit'
  4610. id='ent1'>
  4611. <error type='cancel'>
  4612. <feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  4613. <unsupported xmlns='http://jabber.org/protocol/pubsub#errors'
  4614. feature='member-affiliation'/>
  4615. </error>
  4616. </iq>
  4617. ]]></example>
  4618. </section5>
  4619. <section5 topic='Insufficient Privileges' anchor='owner-affiliations-retrieve-forbidden'>
  4620. <p>If the requesting entity is not a node owner, the service MUST return a &forbidden; error.</p>
  4621. <example caption='Entity is not an owner'><![CDATA[
  4622. <iq type='error'
  4623. from='pubsub.shakespeare.lit'
  4624. id='ent1'>
  4625. <error type='auth'>
  4626. <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  4627. </error>
  4628. </iq>
  4629. ]]></example>
  4630. </section5>
  4631. <section5 topic='Node Does Not Exist' anchor='owner-affiliations-retrieve-node'>
  4632. <p>If the node does not exist, the service MUST return an &notfound; error.</p>
  4633. <example caption='Node does not exist'><![CDATA[
  4634. <iq type='error'
  4635. from='pubsub.shakespeare.lit'
  4636. id='ent1'>
  4637. <error type='cancel'>
  4638. <item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  4639. </error>
  4640. </iq>
  4641. ]]></example>
  4642. </section5>
  4643. </section4>
  4644. <section4 topic='Multiple Simultaneous Modifications' anchor='owner-affiliations-multi'>
  4645. <p>The owner MAY change multiple affiliations in a single request. If one of the entity elements specified is invalid, the service MUST return an IQ error (which SHOULD be &notacceptable;) with the invalid entries, where the affiliation returned is the original, un-altered affiliation.</p>
  4646. <p>The following example shows an entity attempting to make the owner something other than an affiliation of "owner", an action which MUST NOT be allowed if there is only one owner.</p>
  4647. <example caption='Owner sets affiliation for multiple entities'><![CDATA[
  4648. <iq type='set'
  4649. from='hamlet@denmark.lit/elsinore'
  4650. to='pubsub.shakespeare.lit'
  4651. id='ent3'>
  4652. <pubsub xmlns='http://jabber.org/protocol/pubsub#owner'>
  4653. <affiliations node='princely_musings'>
  4654. <affiliation jid='hamlet@denmark.lit' affiliation='none'/>
  4655. <affiliation jid='polonius@denmark.lit' affiliation='none'/>
  4656. <affiliation jid='bard@shakespeare.lit' affiliation='publisher'/>
  4657. </affiliations>
  4658. </pubsub>
  4659. </iq>
  4660. ]]></example>
  4661. <example caption='Service responds with an error'><![CDATA[
  4662. <iq type='error'
  4663. from='pubsub.shakespeare.lit'
  4664. to='hamlet@denmark.lit/elsinore'
  4665. id='ent3'>
  4666. <pubsub xmlns='http://jabber.org/protocol/pubsub#owner'>
  4667. <affiliations node='princely_musings'>
  4668. <affiliation jid='hamlet@denmark.lit' affiliation='owner'/>
  4669. </affiliations>
  4670. </pubsub>
  4671. <error type='modify'>
  4672. <not-acceptable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  4673. </error>
  4674. </iq>
  4675. ]]></example>
  4676. <p>The state chart at the beginning of this document is a MUST-IMPLEMENT set of rules for checking possible state transitions. Implementations MAY enforce other (more strict) rules. If errors occur during a modification request for multiple entities, the pubsub service MUST return any &lt;affiliation/&gt; element(s) which caused the error. Returned entities which failed to be modified MUST include the existing 'affiliation' attribute. Any entity elements which are not returned in an IQ error case MUST be treated as successful modifications. The owner MUST NOT specify multiple &lt;affiliation/&gt; elements for the same entity; otherwise the service MUST return a &badrequest; error.</p>
  4677. </section4>
  4678. </section3>
  4679. <section3 topic='Delete an Entity' anchor='owner-affiliations-delete'>
  4680. <p>In order to remove an entity from the affiliations list, the owner MUST set the value of the 'affiliation' attribute to "none" and the service MUST remove that entity from the affiliations list and not return it in response to future list requests.</p>
  4681. </section3>
  4682. <section3 topic='Notifying Entities' anchor='owner-affiliations-notify'>
  4683. <p>An implementation MAY send an event notification to an entity whose affiliation has changed, which MAY contain a &BODY; element specifying natural-language text regarding the affiliation change and which SHOULD contain the modified affiliation data.</p>
  4684. <example caption='Service sends notification of affiliation change'><![CDATA[
  4685. <message from='pubsub.shakespeare.lit' to='polonius@denmark.lit'>
  4686. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  4687. <affiliations node='princely_musings'>
  4688. <affilation jid='polonius@denmark.lit' affiliation='none'/>
  4689. </affiliations>
  4690. </pubsub>
  4691. </message>
  4692. ]]></example>
  4693. </section3>
  4694. </section2>
  4695. </section1>
  4696. <section1 topic='IM Account Integration' anchor='presence'>
  4697. <p>Publish-subscribe functionality can be integrated into existing instant messaging and presence services (see <cite>RFC 3921</cite>), such that each registered account functions as a virtual pubsub service (sometimes called "pubsub-on-a-JID"). In such deployments, the root pubsub node for each virtual pubsub service has the same address as the bare JID &BAREJID; of the account, which is typically associated with an IM user (e.g., &lt;hamlet@denmark.lit&gt;). Since an IM user typically has a roster of "buddies" and shares presence information with those buddies, the virtual pubsub service can use roster and presence information to provide some helpful shortcuts for subscribers, in particular the auto-subscribe and filtered-notifications features described in this section.</p>
  4698. <p class='box'>Note: PEP ties the receipt of PEP notifications to the subscriber's presence, but does not tie the generation of PEP notifications to the publisher's presence. If the publisher wishes to stop generating PEP events (or to generate an "empty" event as can be done for some PEP payloads) before ending its presence session, the publisher MUST direct its client to do so and MUST NOT depend on the PEP service to automatically "zero out" its PEP information when the PEP service receives unavailable presence from the publisher.</p>
  4699. <p>If an instant messaging and presence account is also a virtual pubsub service, service discovery information ("disco#info") responses from the bare JID of the account MUST include a feature of "http:/jabber.org/protocol/pubsub#pubsub-on-a-jid":</p>
  4700. <example caption='IM server returns supported features on behalf of IM account'><![CDATA[
  4701. <iq from='hamlet@denmark.lit'
  4702. id='bvg194j7'
  4703. to='francisco@denmark.lit/barracks'
  4704. type='result'>
  4705. <query xmlns='http://jabber.org/protocol/disco#info'>
  4706. <identity category='account' type='registered'/>
  4707. <feature var='http://jabber.org/protocol/pubsub#pubsub-on-a-jid'/>
  4708. </query>
  4709. </iq>
  4710. ]]></example>
  4711. <p>Note: Because the account owner's bare JID is the default destination address for any stanzas a client generates, clients often omit the "to" attribute on such stanzas; on this point, see <cite>RFC 6120</cite> and (with regard to rosters) <cite>RFC 6121</cite>.</p>
  4712. <section2 topic='Auto-Subscribe' anchor='auto-subscribe'>
  4713. <p>When a contact is affiliated with the account owner through sharing of XMPP presence, the "auto-subscribe" feature greatly simplifies the subscription process. In particular, support for the "auto-subscribe" has the following implications:</p>
  4714. <section3 topic='Account Owner' anchor='auto-subscribe-owner'>
  4715. <p>Because the account owner itself is implicitly subscribed to its own XMPP presence (e.g., each XMPP resource receives presence information from all of the account owner's resources), a service MUST consider the account owner to have a pubsub subscription to the account owner's root collection node with a subscription_type of "items" and a subscription_depth of "all". This is true for all access models.</p>
  4716. </section3>
  4717. <section3 topic='Presence Subscriber' anchor='auto-subscribe-contact'>
  4718. <p>If an entity (i.e., an IM contact) has an XMPP presence subscription to the account owner's bare JID &BAREJID;, a service MUST consider the contact to have a pubsub subscription to the account owner's root collection node with a subscription_type of "items" and a subscription_depth of "all" if:</p>
  4719. <ol>
  4720. <li>The node has an access model of "open".</li>
  4721. <li>The node has an access model of "presence".</li>
  4722. <li>The node has an access model of "roster" and the contact is in the specified roster group.</li>
  4723. </ol>
  4724. <p>If the contact does not have permission to receive information from any of the account owner's particular nodes below the level of the root collection node (e.g., because a particular node has an access model of "roster" but the contact is not in the specified roster group), the service MUST NOT send notifications regarding that node to the contact and also MUST NOT return any errors to the contact regarding a potential implicit subscription to that node (e.g., the service MUST NOT return a pubsub subscription error to the contact when the contact sends presence to the account owner).</p>
  4725. <p>Note: When an IM contact has a subscription to the account owner's presence, the automated pubsub subscription MUST be based on the JID contained in the 'from' address of the presence subscription request, which for an IM contact will be a bare JID &BAREJID;.</p>
  4726. </section3>
  4727. <section3 topic='Presence Sharer' anchor='auto-subscribe-directed'>
  4728. <p>If the node has an open access model, the pubsub service SHOULD also consider an entity to be temporarily and implicitly subscribed to the node if the entity has sent presence to the account owner in the absence of a presence subscription. In this case, the subscription SHOULD be based on the 'from' address of the presence stanza, which will be a full JID &FULLJID;. When the service receives unavailable presence from the full JID, it MUST cancel the temporary subscription.</p>
  4729. </section3>
  4730. </section2>
  4731. <section2 topic='Filtered Notifications' anchor='filtered-notifications'>
  4732. <p>A contact might not want to receive notifications for all the nodes hosted at a user's virtual pubsub service. A contact SHOULD signal its preferences to the account owner's server by including <cite>XEP-0115</cite> information that specifies the NodeIDs for which the contact wishes to receive notifications (if any). This information is used by a pubsub service that supports the "filtered-notifications" feature to send notifications only from those NodeIDs that match the subscriber's preferences.</p>
  4733. <p>In order to make this possible, all possible NodeIDs can be appended with the string "+notify" to indicate that the contact wishes to receive notifications for the specified NodeID. Thus if Romeo wants to receive notifications for location data (&xep0080;) and tune data (&xep0118;) but not activity data (&xep0108;), his client would advertise support for the following strings in the disco#info results it sends: <note>Including, say, the 'http://jabber.org/protocol/geoloc' NodeID indicates that the client understands the geolocation namespace described in <cite>XEP-0080</cite>, whereas including the 'http://jabber.org/protocol/geoloc+notify' namespace indicates that the client wishes to receive notifications related to geolocation, where the NodeID is the same as the geolocation namespace 'http://jabber.org/protocol/geoloc' (in this case there is a one-to-one correspondence between the namespace name and the NodeID).</note></p>
  4734. <ul>
  4735. <li>http://jabber.org/protocol/geoloc+notify</li>
  4736. <li>http://jabber.org/protocol/tune+notify</li>
  4737. </ul>
  4738. <p>This set of strings would then be advertised by including them in the identity+features hash encapsulated via the 'ver' attribute as described in <cite>XEP-0115</cite>.</p>
  4739. <example caption='Contact sends presence with caps'><![CDATA[
  4740. <presence from='romeo@montague.lit/orchard'>
  4741. <c xmlns='http://jabber.org/protocol/caps'
  4742. node='http://www.chatopus.com/#2.2'
  4743. ver='AFBT0mPr29zQE5aGtCJp97CIS6E='/>
  4744. </presence>
  4745. ]]></example>
  4746. <p>It is the responsibility of the account owner's server to cache <cite>XEP-0115</cite> information. When the server receives presence from a contact, it MUST check that presence information for entity capabilities data and correlate that data with the desired NodeIDs for the contact's client. The server MUST NOT send notifications related to any NodeIDs that the contact's client has not asked for via the relevant "NodeID+notify" disco#info feature. This enables a client to turn off all notifications (e.g., because of bandwidth restrictions) and to easily receive all desired data formats simply by adding support for the appropriate "NodeID+notify" combination in its disco#info results and client capabililies. However, it also implies that a client can request notifications only on a global basis and cannot request, say, mood information only from certain contacts in the user's roster. Community consensus is that this is an acceptable tradeoff. Also, note that this works only if the account owner has a presence subscription to the contact and the contact has a presence subscription to the account owner.</p>
  4747. <p>Some examples may help to illustrate the concept of notification filtering. Here we show presence generated by two of the contacts listed above (benvolio@montague.lit does not have any presence subscriptions to or from juliet@capulet.lit and therefore is not involved in these protocol flows).</p>
  4748. <example caption='Presence with caps'><![CDATA[
  4749. <presence from='nurse@capulet.lit/chamber'>
  4750. <c xmlns='http://jabber.org/protocol/caps'
  4751. node='http://exodus.jabberstudio.org/#0.9.1'
  4752. ver='wXj6c5xhT9frdqhvTSjkdejUUP8='/>
  4753. </presence>
  4754. <presence from='romeo@montague.lit/orchard'>
  4755. <c xmlns='http://jabber.org/protocol/caps'
  4756. node='http://www.chatopus.com/#2.2'
  4757. ver='1FDrLLbYMpzvcI95jgSHABSWDRY='/>
  4758. </presence>
  4759. ]]></example>
  4760. <p>We assume that Juliet's server doesn't know anything about these capabilities, so it sends service discovery information requests to each of the clients on Juliet's behalf (realistically, the capulet.lit server will quickly build up a cache of client capabilities, with the result that it will not need to send these service discovery requests):</p>
  4761. <example caption='Account server queries contact'><![CDATA[
  4762. <iq from='juliet@capulet.lit'
  4763. to='nurse@capulet.lit/chamber'
  4764. type='get'
  4765. id='disco123'>
  4766. <query xmlns='http://jabber.org/protocol/disco#info'/>
  4767. </iq>
  4768. <iq from='nurse@capulet.lit/chamber'
  4769. to='juliet@capulet.lit'
  4770. type='result'
  4771. id='disco123'>
  4772. <query xmlns='http://jabber.org/protocol/disco#info'>
  4773. <identity category='client' type='pc'/>
  4774. <feature var='http://jabber.org/protocol/activity'/>
  4775. <feature var='http://jabber.org/protocol/activity+notify'/>
  4776. <feature var='http://jabber.org/protocol/geoloc'/>
  4777. <feature var='http://jabber.org/protocol/geoloc+notify'/>
  4778. <feature var='http://jabber.org/protocol/muc'/>
  4779. <feature var='http://jabber.org/protocol/tune'/>
  4780. <feature var='http://jabber.org/protocol/tune+notify'/>
  4781. </query>
  4782. </iq>
  4783. ]]></example>
  4784. <p>The server shall also query the identity+features for &lt;romeo@montague.lit&gt;:</p>
  4785. <example caption='Account server queries contact'><![CDATA[
  4786. <iq from='juliet@capulet.lit'
  4787. to='romeo@montague.lit/orchard'
  4788. type='get'
  4789. id='disco234'>
  4790. <query xmlns='http://jabber.org/protocol/disco#info'/>
  4791. </iq>
  4792. <iq from='romeo@montague.lit/orchard'
  4793. to='juliet@capulet.lit'
  4794. type='result'
  4795. id='disco234'>
  4796. <query xmlns='http://jabber.org/protocol/disco#info'>
  4797. <identity category='client' type='pda'/>
  4798. <feature var='http://jabber.org/protocol/geoloc'/>
  4799. <feature var='http://jabber.org/protocol/geoloc+notify'/>
  4800. <feature var='http://jabber.org/protocol/tune'/>
  4801. <feature var='http://jabber.org/protocol/tune+notify'/>
  4802. </query>
  4803. </iq>
  4804. ]]></example>
  4805. <p>(As noted in <cite>XEP-0115</cite>, the server MUST check the hash provided in the 'ver' attribute against the generation method to ensure that no poisoning has occurred.)</p>
  4806. <p>Now we revisit account owner publication and server generation of notifications, with filtering enabled because the server has caps information:</p>
  4807. <ul>
  4808. <li><p>If Juliet publishes a tune item to the presence-access "http://jabber.org/protocol/tune" node, her server will send notifications to &lt;nurse@capulet.lit/chamber&gt; and &lt;romeo@montague.lit/orchard&gt; (full JIDs).</p></li>
  4809. <li><p>If Juliet publishes an activity item to the presence-access "http://jabber.org/protocol/activity" node, her server will send notifications only to &lt;nurse@capulet.lit/chamber&gt;.</p></li>
  4810. <li><p>If Juliet publishes a geolocation item to the roster-access "http://jabber.org/protocol/geoloc" node with the "pubsub#roster_groups_allowed" variable set to a value of "Friends", her server will send notifications only to &lt;romeo@montague.lit/orchard&gt; because the nurse is not in that roster group.</p></li>
  4811. </ul>
  4812. </section2>
  4813. </section1>
  4814. <!-- REMOVED PENDING FURTHER DISCUSSION
  4815. <section1 topic='Data Versioning' anchor='versioning'>
  4816. <p>A service MAY track the "version" of data published at a node, in the form of the version across all published items ("node-level versioning"), the version of each particular item ("item-level versioning"), or both. The version is tracked using the 'ver' attribute, which is included on the &lt;items/&gt; element for node-level versioning and on the &lt;item/&gt; element for item-level versioning.</p>
  4817. <p class='def'><strong>Definition:</strong> The <strong>'ver' attribute</strong> is a string that identifies a given version of the collective items published at a node, or of a particular item. The value of a node-level version identifier MUST be generated only by the service, MUST NOT be accepted by the service from a publisher. The value of an item-level version identifier MAY be accepted by a service from a publisher, but if not included SHOULD be generated by the service. Version identifiers MUST be treated by subscribers as opaque, but MAY have meaning to publishers. Any appropriate method can be used for generating version identifiers, such as a hash of the published data or a strictly-increasing sequence number.</p>
  4818. <p>Note: The value of the 'ver' attribute is conceptually equivalent to the 'ver' attribute from &xep0237;.</p>
  4819. <p>If a service supports data versioning, it MUST advertise a feature of "http://jabber.org/protocol/pubsub#versioning".</p>
  4820. <section2 topic='Versioning of All Items' anchor='versioning-items'>
  4821. <p>The service can include the version of the collective items when it generates notifications.</p>
  4822. <example caption='Notification with Version of All Items'><![CDATA[
  4823. <message from='pubsub.shakespeare.lit' to='francisco@denmark.lit' id='foo'>
  4824. <event xmlns='http://jabber.org/protocol/pubsub#event'>
  4825. <items node='princely_musings'
  4826. ver='v103'>
  4827. <item id='ae890ac52d0df67ed7cfdf51b644e901'
  4828. publisher='hamlet@denmark.lit'>
  4829. [ ... ENTRY ... ]
  4830. </item>
  4831. </items>
  4832. </event>
  4833. </message>
  4834. ]]></example>
  4835. <p>If any items are subsequently published to or deleted from the node (thus overwriting the old version), the service would change the version.</p>
  4836. <example caption='Subsequent Notification with Item Version'><![CDATA[
  4837. <message from='pubsub.shakespeare.lit' to='francisco@denmark.lit' id='bar'>
  4838. <event xmlns='http://jabber.org/protocol/pubsub#event'>
  4839. <items node='princely_musings'
  4840. ver='v110'>
  4841. <item id='ae890ac52d0df67ed7cfdf51b644e901'
  4842. publisher='hamlet@denmark.lit'>
  4843. [ ... ENTRY ... ]
  4844. </item>
  4845. </items>
  4846. </event>
  4847. </message>
  4848. ]]></example>
  4849. </section2>
  4850. <section2 topic='Versioning of a Particular Item' anchor='versioning-item'>
  4851. <p>The service can include the version of a particular item when it generates notifications.</p>
  4852. <example caption='Notification with Item Version'><![CDATA[
  4853. <message from='pubsub.shakespeare.lit' to='francisco@denmark.lit' id='foo'>
  4854. <event xmlns='http://jabber.org/protocol/pubsub#event'>
  4855. <items node='princely_musings'>
  4856. <item id='ae890ac52d0df67ed7cfdf51b644e901'
  4857. publisher='hamlet@denmark.lit'
  4858. ver='v50'>
  4859. [ ... ENTRY ... ]
  4860. </item>
  4861. </items>
  4862. </event>
  4863. </message>
  4864. ]]></example>
  4865. <p>If an item with the same ItemID is subsequently published to the node (thus overwriting the old version), the service would change the version.</p>
  4866. <example caption='Subsequent Notification with Item Version'><![CDATA[
  4867. <message from='pubsub.shakespeare.lit' to='francisco@denmark.lit' id='bar'>
  4868. <event xmlns='http://jabber.org/protocol/pubsub#event'>
  4869. <items node='princely_musings'>
  4870. <item id='ae890ac52d0df67ed7cfdf51b644e901'
  4871. publisher='hamlet@denmark.lit'
  4872. ver='v59'>
  4873. [ ... ENTRY ... ]
  4874. </item>
  4875. </items>
  4876. </event>
  4877. </message>
  4878. ]]></example>
  4879. </section2>
  4880. <section2 topic='Versioning on Publish or Delete' anchor='versioning-publish'>
  4881. <p>If the service supports data versioning, it MUST inform the publisher of the latest version when returning an IQ-result after a publishing request or item deletion is processed.</p>
  4882. <example caption='Success with version'><![CDATA[
  4883. <iq type='result'
  4884. from='pubsub.shakespeare.lit'
  4885. to='hamlet@denmark.lit/blogbot'
  4886. id='publish1'>
  4887. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  4888. <publish node='princely_musings'
  4889. ver='v110'>
  4890. <item id='ae890ac52d0df67ed7cfdf51b644e901'
  4891. ver='v59'/>
  4892. </publish>
  4893. </pubsub>
  4894. </iq>
  4895. ]]></example>
  4896. </section2>
  4897. <section2 topic='Retrieving All Items Since a Given Version' anchor='versioning-retrieve'>
  4898. <p>If the service supports data versioning, the subscriber can request all items published since a particular version of the published data by specifying both the Node ID and 'ver' attribute on the &lt;items/&gt; element.</p>
  4899. <example caption='Subscriber Requests Items Since a Given Version'><![CDATA[
  4900. <iq type='get'
  4901. from='francisco@denmark.lit/barracks'
  4902. to='pubsub.shakespeare.lit'
  4903. id='items3'>
  4904. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  4905. <items node='princely_musings'
  4906. ver='v103'/>
  4907. </pubsub>
  4908. </iq>
  4909. ]]></example>
  4910. <p>The service would then return all the items published since that version of the data published at the node, as well as notice of any item deletions (if configured to send notifications on delete). If no items have been published or deleted, the service would return an empty IQ-result.</p>
  4911. </section2>
  4912. </section1>
  4913. -->
  4914. <section1 topic='Feature Summary' anchor='features'>
  4915. <p>This section summarizes the features described herein, specifies the appropriate requirements level for each feature (REQUIRED, RECOMMENDED, or OPTIONAL), and provides cross-references to the section of this document in which each feature is described.</p>
  4916. <p>Note: The feature names are all of the form "http://jabber.org/protocol/pubsub#name", where "name" is the text specified in the first column below.</p>
  4917. <table caption='Service Discovery Features'>
  4918. <tr>
  4919. <th>Name</th>
  4920. <th>Description</th>
  4921. <th>Support</th>
  4922. <th>Section</th>
  4923. </tr>
  4924. <tr>
  4925. <td>access-authorize</td>
  4926. <td>The default access model is "authorize".</td>
  4927. <td>OPTIONAL</td>
  4928. <td><link url='#accessmodels'>Nodes Access Models</link></td>
  4929. </tr>
  4930. <tr>
  4931. <td>access-open</td>
  4932. <td>The default access model is "open".</td>
  4933. <td>OPTIONAL</td>
  4934. <td><link url='#accessmodels'>Nodes Access Models</link></td>
  4935. </tr>
  4936. <tr>
  4937. <td>access-presence</td>
  4938. <td>The default access model is "presence".</td>
  4939. <td>OPTIONAL</td>
  4940. <td><link url='#accessmodels'>Nodes Access Models</link></td>
  4941. </tr>
  4942. <tr>
  4943. <td>access-roster</td>
  4944. <td>The default access model is "roster".</td>
  4945. <td>OPTIONAL</td>
  4946. <td><link url='#accessmodels'>Nodes Access Models</link></td>
  4947. </tr>
  4948. <tr>
  4949. <td>access-whitelist</td>
  4950. <td>The default access model is "whitelist".</td>
  4951. <td>OPTIONAL</td>
  4952. <td><link url='#accessmodels'>Nodes Access Models</link></td>
  4953. </tr>
  4954. <tr>
  4955. <td>auto-create</td>
  4956. <td>The service supports auto-creation of nodes on publish to a non-existent node.</td>
  4957. <td>OPTIONAL</td>
  4958. <td><link url='#publisher-publish-autocreate'>Automatic Node Creation</link></td>
  4959. </tr>
  4960. <tr>
  4961. <td>auto-subscribe</td>
  4962. <td>The service supports auto-subscription to a nodes based on presence subscription.</td>
  4963. <td>RECOMMENDED</td>
  4964. <td><link url='#auto-subscribe'>Auto-Subscribe</link></td>
  4965. </tr>
  4966. <tr>
  4967. <td>collections</td>
  4968. <td>Collection nodes are supported.</td>
  4969. <td>OPTIONAL</td>
  4970. <td>Refer to <cite>XEP-0248</cite></td>
  4971. </tr>
  4972. <tr>
  4973. <td>config-node</td>
  4974. <td>Configuration of node options is supported.</td>
  4975. <td>RECOMMENDED</td>
  4976. <td><link url='#owner-configure'>Configure a Node</link></td>
  4977. </tr>
  4978. <tr>
  4979. <td>create-and-configure</td>
  4980. <td>Simultaneous creation and configuration of nodes is supported.</td>
  4981. <td>RECOMMENDED</td>
  4982. <td><link url='#owner-create-and-configure'>Create and Configure a Node</link></td>
  4983. </tr>
  4984. <tr>
  4985. <td>create-nodes</td>
  4986. <td>Creation of nodes is supported.</td>
  4987. <td>RECOMMENDED</td>
  4988. <td><link url='#owner-create'>Create a Node</link></td>
  4989. </tr>
  4990. <tr>
  4991. <td>delete-items</td>
  4992. <td>Deletion of items is supported.</td>
  4993. <td>RECOMMENDED</td>
  4994. <td><link url='#publisher-delete'>Delete an Item from a Node</link></td>
  4995. </tr>
  4996. <tr>
  4997. <td>delete-nodes</td>
  4998. <td>Deletion of nodes is supported.</td>
  4999. <td>RECOMMENDED</td>
  5000. <td><link url='#owner-delete'>Delete a Node</link></td>
  5001. </tr>
  5002. <tr>
  5003. <td>filtered-notifications</td>
  5004. <td>Notifications are filtered based on Entity Capabilities data.</td>
  5005. <td>RECOMMENDED</td>
  5006. <td><link url='#filtered-notifications'>Filtered Notifications</link></td>
  5007. </tr>
  5008. <tr>
  5009. <td>get-pending</td>
  5010. <td>Retrieval of pending subscription approvals is supported.</td>
  5011. <td>OPTIONAL</td>
  5012. <td><link url='#owner-subreq'>Manage Subscription Requests</link></td>
  5013. </tr>
  5014. <tr>
  5015. <td>instant-nodes</td>
  5016. <td>Creation of instant nodes is supported.</td>
  5017. <td>RECOMMENDED</td>
  5018. <td><link url='#owner-create'>Create a Node</link></td>
  5019. </tr>
  5020. <tr>
  5021. <td>item-ids</td>
  5022. <td>Publishers may specify item identifiers.</td>
  5023. <td>RECOMMENDED</td>
  5024. <td>&#160;</td>
  5025. </tr>
  5026. <tr>
  5027. <td>last-published</td>
  5028. <td>By default the last published item is sent to new subscribers and on receipt of available presence from existing subscribers.</td>
  5029. <td>RECOMMENDED</td>
  5030. <td><link url='#events'>Event Types</link></td>
  5031. </tr>
  5032. <tr>
  5033. <td>leased-subscription</td>
  5034. <td>Time-based subscriptions are supported.</td>
  5035. <td>OPTIONAL</td>
  5036. <td><link url='#impl-leases'>Time-Based Subscriptions (Leases)</link></td>
  5037. </tr>
  5038. <tr>
  5039. <td>manage-subscriptions</td>
  5040. <td>Node owners may manage subscriptions.</td>
  5041. <td>OPTIONAL</td>
  5042. <td><link url='#owner-subscriptions'>Manage Subscriptions</link></td>
  5043. </tr>
  5044. <tr>
  5045. <td>member-affiliation</td>
  5046. <td>The member affiliation is supported.</td>
  5047. <td>RECOMMENDED</td>
  5048. <td><link url='#affiliations'>Affiliations</link></td>
  5049. </tr>
  5050. <tr>
  5051. <td>meta-data</td>
  5052. <td>Node meta-data is supported.</td>
  5053. <td>RECOMMENDED</td>
  5054. <td>&#160;</td>
  5055. </tr>
  5056. <tr>
  5057. <td>modify-affiliations</td>
  5058. <td>Node owners may modify affiliations.</td>
  5059. <td>OPTIONAL</td>
  5060. <td><link url='#owner-affiliations'>Manage Affiliations</link></td>
  5061. </tr>
  5062. <tr>
  5063. <td>multi-collection</td>
  5064. <td>A single leaf node can be associated with multiple collections.</td>
  5065. <td>OPTIONAL</td>
  5066. <td>Refer to <cite>XEP-0248</cite></td>
  5067. </tr>
  5068. <tr>
  5069. <td>multi-items</td>
  5070. <td>The service supports the storage of multiple items per node. It requires the pubsub#max_items configuration item to be exposed to the user and allow sensible values (higher than one) to be set in <link url='#owner-configure'>Configure a Node</link>.</td>
  5071. <td>OPTIONAL</td>
  5072. <td>&#160;</td>
  5073. </tr>
  5074. <tr>
  5075. <td>multi-subscribe</td>
  5076. <td>A single entity may subscribe to a node multiple times.</td>
  5077. <td>OPTIONAL</td>
  5078. <td><link url='#subscriber-subscribe-multi'>Multiple Subscriptions</link></td>
  5079. </tr>
  5080. <tr>
  5081. <td>outcast-affiliation</td>
  5082. <td>The outcast affiliation is supported.</td>
  5083. <td>RECOMMENDED</td>
  5084. <td><link url='#affiliations'>Affiliations</link></td>
  5085. </tr>
  5086. <tr>
  5087. <td>persistent-items</td>
  5088. <td>Persistent items are supported.</td>
  5089. <td>RECOMMENDED</td>
  5090. <td>&#160;</td>
  5091. </tr>
  5092. <tr>
  5093. <td>presence-notifications</td>
  5094. <td>Presence-based delivery of event notifications is supported.</td>
  5095. <td>OPTIONAL</td>
  5096. <td>&#160;</td>
  5097. </tr>
  5098. <tr>
  5099. <td>presence-subscribe</td>
  5100. <td>Authorized contacts are automatically subscribed to a user's virtual pubsub service.</td>
  5101. <td>RECOMMENDED</td>
  5102. <td><link url='#auto-subscribe'>Auto-Subscribe</link></td>
  5103. </tr>
  5104. <tr>
  5105. <td>publish</td>
  5106. <td>Publishing items is supported.</td>
  5107. <td>REQUIRED</td>
  5108. <td><link url='#publisher-publish'>Publish an Item to a Node</link></td>
  5109. </tr>
  5110. <tr>
  5111. <td>publish-options</td>
  5112. <td>Publishing an item with options is supported.</td>
  5113. <td>OPTIONAL</td>
  5114. <td><link url='#publisher-publish-options'>Publishing Options</link></td>
  5115. </tr>
  5116. <tr>
  5117. <td>publish-only-affiliation</td>
  5118. <td>The publish-only affiliation is supported.</td>
  5119. <td>OPTIONAL</td>
  5120. <td><link url='#affiliations'>Affiliations</link></td>
  5121. </tr>
  5122. <tr>
  5123. <td>publisher-affiliation</td>
  5124. <td>The publisher affiliation is supported.</td>
  5125. <td>RECOMMENDED</td>
  5126. <td><link url='#affiliations'>Affiliations</link></td>
  5127. </tr>
  5128. <tr>
  5129. <td>purge-nodes</td>
  5130. <td>Purging of nodes is supported.</td>
  5131. <td>OPTIONAL</td>
  5132. <td><link url='#owner-purge'>Purge All Node Items</link></td>
  5133. </tr>
  5134. <tr>
  5135. <td>retract-items</td>
  5136. <td>Item retraction is supported.</td>
  5137. <td>OPTIONAL</td>
  5138. <td><link url='#publisher-delete'>Delete an Item from a Node</link></td>
  5139. </tr>
  5140. <tr>
  5141. <td>retrieve-affiliations</td>
  5142. <td>Retrieval of current affiliations is supported.</td>
  5143. <td>RECOMMENDED</td>
  5144. <td><link url='#entity-affiliations'>Retrieve Affiliations</link></td>
  5145. </tr>
  5146. <tr>
  5147. <td>retrieve-default</td>
  5148. <td>Retrieval of default node configuration is supported.</td>
  5149. <td>RECOMMENDED</td>
  5150. <td><link url='#owner-default'>Request Default Node Configuration Options</link></td>
  5151. </tr>
  5152. <tr>
  5153. <td>retrieve-default-sub</td>
  5154. <td>Retrieval of default subscription configuration is supported.</td>
  5155. <td>OPTIONAL</td>
  5156. <td><link url='#subscribe-default'>Request Default Subscription Configuration Options</link></td>
  5157. </tr>
  5158. <tr>
  5159. <td>retrieve-items</td>
  5160. <td>Item retrieval is supported.</td>
  5161. <td>RECOMMENDED</td>
  5162. <td><link url='#subscriber-retrieve'>Retrieve Items from a Node</link></td>
  5163. </tr>
  5164. <tr>
  5165. <td>retrieve-subscriptions</td>
  5166. <td>Retrieval of current subscriptions is supported.</td>
  5167. <td>RECOMMENDED</td>
  5168. <td><link url='#entity-subscriptions'>Retrieve Subscriptions</link></td>
  5169. </tr>
  5170. <tr>
  5171. <td>subscribe</td>
  5172. <td>Subscribing and unsubscribing are supported.</td>
  5173. <td>REQUIRED</td>
  5174. <td><link url='#subscriber-subscribe'>Subscribe to a Node</link> and <link url='#subscriber-unsubscribe'>Unsubscribe from a Node</link></td>
  5175. </tr>
  5176. <tr>
  5177. <td>subscription-options</td>
  5178. <td>Configuration of subscription options is supported.</td>
  5179. <td>OPTIONAL</td>
  5180. <td><link url='#subscriber-configure'>Configure Subscription Options</link></td>
  5181. </tr>
  5182. <tr>
  5183. <td>subscription-notifications</td>
  5184. <td>Notification of subscription state changes is supported.</td>
  5185. <td>OPTIONAL</td>
  5186. <td><link url='#impl-subchange'>Notification of Subscription State Changes</link></td>
  5187. </tr>
  5188. </table>
  5189. </section1>
  5190. <section1 topic='Error Conditions' anchor='errors'>
  5191. <table caption='Error conditions and typical causes'>
  5192. <tr>
  5193. <th>Condition</th>
  5194. <th>Description</th>
  5195. </tr>
  5196. <tr>
  5197. <td>&conflict;</td>
  5198. <td>The node already exists.</td>
  5199. </tr>
  5200. <tr>
  5201. <td>&feature;</td>
  5202. <td>The operation being attempted on a node (or the system) has failed because the service or node does not support the operation; the error SHOULD also specify which feature is unsupported.</td>
  5203. </tr>
  5204. <tr>
  5205. <td>&forbidden;</td>
  5206. <td>An entity does not have sufficient privileges to perform the action, is requesting an operation for another Jabber ID (e.g., francisco@denmark.lit attempts to subscribe bernardo@denmark.lit to a node), or the requesting entity has an affiliation of "outcast".</td>
  5207. </tr>
  5208. <tr>
  5209. <td>&notfound;</td>
  5210. <td>The node or item specified for some operation does not exist.</td>
  5211. </tr>
  5212. <tr>
  5213. <td>&notallowed;</td>
  5214. <td>An entity has attempted to perform an action which the service implements; however the service-wide admin or the node owner has disabled the action for that service or node.</td>
  5215. </tr>
  5216. <tr>
  5217. <td>&notauthorized;</td>
  5218. <td>An entity has attempted to subscribe to or retrieve items from a node but is not authorized to see the account owner's presence, is not in the appropriate roster group, or is not on the whitelist for subscriptions.</td>
  5219. </tr>
  5220. <tr>
  5221. <td>&payment;</td>
  5222. <td>Subscriptions and item retrieval are based on some kind payment service. Payments would be done out-of-band using some agreed-upon method (not defined herein).</td>
  5223. </tr>
  5224. <tr>
  5225. <td>&registration;</td>
  5226. <td>Entities are required to register before node creation is allowed.</td>
  5227. </tr>
  5228. </table>
  5229. <p>Note: Refer to &xep0086; for more information regarding error syntax.</p>
  5230. </section1>
  5231. <section1 topic='Implementation Notes' anchor='impl'>
  5232. <section2 topic='Notification Triggers' anchor='impl-notify'>
  5233. <p>There are many possible triggers for sending an event notification to an entity for the currently published item or the last published item, as summarized below:</p>
  5234. <ol>
  5235. <li>The entity explicitly requests one or more items from the node and is authorized to retrieve items; when the service receives such a request, it sends the items to the entity.</li>
  5236. <li>The entity is an authorized subscriber to the node (explicitly via subscription or implicitly based on a role of owner or publisher); when the publisher sends a publish request, the service sends the currently published item to the entity (subject to presence checks and notification filtering if appropriate).</li>
  5237. <li>The entity is not subscribed but is eligible to do so and has sent presence containing appropriate entity capabilities data to a service that supports filtered notifications (effectively establishing a "temporary subscription" based on an expressed notification interest); when the service first receives such presence, it sends the last published item to the entity (sending it only once upon first receiving such presence, not on subsequent presence updates that contain the same notification interest).</li>
  5238. <li>The entity is not subscribed but is eligible to do so and has sent presence containing appropriate entity capabilities data to a service that supports filtered notifications (effectively establishing a "temporary subscription"); when the publisher sends a publish request that matches the entity's expressed notification interest, the service sends the currently published item to the entity.</li>
  5239. <li>The entity gains access to the node because of a change to the node access model; as a result, the service sends the last published item to the entity.</li>
  5240. <li>The entity is added to the roster group associated with a node access model of "roster"; as a result, the service sends the last published item to the entity.</li>
  5241. </ol>
  5242. </section2>
  5243. <section2 topic='Intended Recipients for Notifications' anchor='impl-recipients'>
  5244. <p>When a pubsub service generates notifications, it MUST adhere to the delivery rules implicit in the subscription option configuration for each subscriber. In particular, the 'to' address SHOULD be that of the subscribed JID only. The service SHOULD NOT attempt to guess at the most available resource associated with the subscribed JID (e.g., in the context of instant messaging systems).</p>
  5245. </section2>
  5246. <section2 topic='Handling Notification-Related Errors' anchor='impl-bounce'>
  5247. <p>As noted above, a pubsub service SHOULD ensure that the &MESSAGE; stanza for each event notification it generates possesses an 'id' attribute with a value. (This notification ID is not to be confused with either the node ID or the item ID.) This ID MUST be unique within the context of the pubsub service in order to ensure proper tracking of any delivery-related errors.</p>
  5248. <p>Exactly how a service shall handle delivery-related errors is a matter of implementation. In general, such handling is effectively similar to the bounce processing performed by other message delivery systems, such as mail transfer agents and mailing list software. The following are some suggested guidelines regarding the handling of XMPP-specific error conditions in relation to pubsub event notifications (see <cite>RFC 3920</cite> and <cite>XEP-0086</cite> regarding XMPP error condition semantics):</p>
  5249. <ul>
  5250. <li>If the XMPP error is of type "cancel" (e.g., &notfound;), or the error condition is &gone;, the pubsub service SHOULD terminate the subscription of the entity to that node and MAY terminate the subscription of that entity to all nodes hosted at the service.</li>
  5251. <li>If the XMPP error is of type "auth" (e.g., &registration;) or "wait" (e.g., &timeout;), or the error condition is &badrequest;, &redirect;, or &notacceptable;, the pubsub service SHOULD increment a bounce counter for that entity and MAY attempt to resend the event notification after some configurable amount of time. The service MAY terminate the subscription of the entity to that node if the bounce counter has reached some configurable limit.</li>
  5252. </ul>
  5253. </section2>
  5254. <section2 topic='Temporary Subscriptions' anchor='impl-tempsub'>
  5255. <p>An implementation MAY enable an entity to subscribe to a node temporarily, i.e., only for as long as the subscriber is online in its current presence session. To subscribe temporarily, the subscriber MUST set the "pubsub#expire" subscription configuration option to a literal value of "presence".</p>
  5256. <example caption='A Temporary Subscription'><![CDATA[
  5257. <iq type='set'
  5258. from='francisco@denmark.lit/barracks'
  5259. to='pubsub.shakespeare.lit'
  5260. id='lease3'>
  5261. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  5262. <options node='princely_musings' jid='francisco@denmark.lit'>
  5263. <x xmlns='jabber:x:data' type='submit'>
  5264. <field var='FORM_TYPE' type='hidden'>
  5265. <value>http://jabber.org/protocol/pubsub#subscribe_options</value>
  5266. </field>
  5267. ...
  5268. <field var='pubsub#expire'><value>presence</value></field>
  5269. ...
  5270. </x>
  5271. </options>
  5272. </pubsub>
  5273. </iq>
  5274. ]]></example>
  5275. <p>The service will then automatically cancel the subscription when it receives presence of type "unavailable" from the subscriber.</p>
  5276. <p>An implementation MAY enable the node owner to force all subscriptions to be temporary, which is useful for nodes that are also configured to use presence-based delivery. This setting uses the "pubsub#tempsub" node configuration option set to a value of true.</p>
  5277. <example caption='Owner sets all subscriptions to temporary'><![CDATA[
  5278. <iq type='set'
  5279. from='hamlet@denmark.lit/elsinore'
  5280. to='pubsub.shakespeare.lit'
  5281. id='configtemp'>
  5282. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  5283. <configure node='princely_musings'>
  5284. <x xmlns='jabber:x:data' type='submit'>
  5285. <field var='FORM_TYPE' type='hidden'>
  5286. <value>http://jabber.org/protocol/pubsub#node_config</value>
  5287. </field>
  5288. <field var='pubsub#tempsub'><value>true</value></field>
  5289. </x>
  5290. </configure>
  5291. </pubsub>
  5292. </iq>
  5293. ]]></example>
  5294. </section2>
  5295. <section2 topic='Presence-Based Delivery of Events' anchor='impl-presence'>
  5296. <p>Implementations of pubsub MAY deliver event notifications only when the subscriber is online. In these cases, the option may be a node configuration option as shown in the examples above. To facilitate this, the pubsub service needs to subscribe to the subscriber's presence and check the subscriber's current presence information before sending any event notifications (as described in <cite>RFC 3921</cite>). Presence subscriptions MUST be based on the subscribed JID.</p>
  5297. </section2>
  5298. <section2 topic='Not Routing Events to Offline Storage' anchor='impl-offline'>
  5299. <p>Sending events to users of existing XMPP servers may force event notifications to be routed to offline storage for later delivery (as described in &xep0160;). This may not always be desirable. The possible ways of preventing this behavior include:</p>
  5300. <ul>
  5301. <li>Use presence-based subscription options as described above.</li>
  5302. <li>Use delivery semantics as defined by &xep0079;.</li>
  5303. <li>Specify a message type of "headline", which in most existing server implementations will prevent offline storage.</li>
  5304. </ul>
  5305. </section2>
  5306. <section2 topic='Including a Message Body' anchor='impl-body'>
  5307. <p>If a service understands the semantics for a particular payload type and an entity's subscription is so configured (by the "pubsub#include_body" subscription option to true), the service SHOULD include an appropriate XMPP &BODY; child element along with the payloads it sends in event notifications for a given node, where the body's XML character data summarizes or represents the information contained in the payload (this enables clients that do not understand the payload format to present the appropriate information to an end user). For example, the Atom &lt;summary/&gt; element (see <cite>RFC 4287</cite>) could be mapped to the XMPP &BODY; element. A service MUST NOT provide the "pubsub#include_body" subscription option for a node if it does not have a defined way to transform part or all of the payload format into a sensible message body. A node owner MAY define an XSLT for transforming the payload format into a message body, via the "pubsub#body_xslt" node configuration option. This XSLT is applied by the pubsub service after receiving a publish request and before sending the appropriate notifications, not by the client before sending a publish request.</p>
  5308. <p>If the service does not understand the semantics for a particular payload type and therefore cannot transform the payload into a human-readable message body, it SHOULD NOT include a &lt;body/&gt; child.</p>
  5309. <p>If a subscriber has multiple subscriptions to the same node, where some of the SubIDs have include_body set to true and others have include_body set to false, the service SHOULD include a body with all notifications.</p>
  5310. </section2>
  5311. <section2 topic='Node ID and Item ID Uniqueness' anchor='impl-uniqueness'>
  5312. <p>NodeIDs MUST be treated as unique identifiers within the context of a particular pubsub service.</p>
  5313. <p>If item identifiers are used, they MUST be treated as unique within the scope of the node. The combination of the NodeID + ItemID MUST be unique within a given service, and MUST specify a single published item at a single node.</p>
  5314. <p>If a publisher publishes an item and the ItemID matches that of an existing item, the pubsub service MUST overwrite the existing item and generate a new event notification.</p>
  5315. <p>Because it is possible for a node's configuration to change such that ItemIDs are required (e.g., a change from transient to persistent), a service SHOULD use ItemIDs for internal tracking purposes even if it does not include them with the notifications it generates prior to the configuration change.</p>
  5316. </section2>
  5317. <section2 topic='Item Caching' anchor='impl-caching'>
  5318. <p>A service MAY cache the last item published to a node, even if the node is configured for transient publication (i.e., configured to not persist items). The last published item SHOULD be sent to new subscribers upon successful processing of a subscription request or approval by a node owner.</p>
  5319. <p>Note: Particular profiles of the generic publish-subscribe protocol MAY define more stringent requirements regarding the "cache-last-item" feature.</p>
  5320. </section2>
  5321. <section2 topic='Batch Processing' anchor='impl-batch'>
  5322. <p>A publisher MAY include multiple &ITEM; elements in a publish request and MAY include multiple &ITEM; elements in a retract request. This results in "batch processing" of publications or retractions.</p>
  5323. <p>If the service cannot process any one of the items to be published or retracted, the entire batch MUST fail and the service MUST NOT publish or retract any of the items.</p>
  5324. <p>If a batch publish contains so many items that publication of all the items would exceed the maximum number of items for the node, the service MUST return a &notallowed; error, which SHOULD also include a pubsub-specific error condition of &lt;max-items-exceeded/&gt;.</p>
  5325. <p>Note: Batch publication renders the concept of "last published item" problematic; therefore, if information coherence is needed, a publisher SHOULD publish items in separate requests rather than in batch mode.</p>
  5326. </section2>
  5327. <section2 topic='Auto-Subscribing Owners and Publishers' anchor='impl-autosubscribe'>
  5328. <p>A service MUST allow owners and publishers to subscribe to a node, and to retrieve items from a node even if they are not subscribed. A service MAY auto-subscribe owners and publishers if they are not already subscribed, in which case it SHOULD generate a subscription ID if necessary for the subscription and SHOULD send a notification of successful subscription as described in the <link url='#impl-subchange'>Notification of Subscription State Changes</link> section of this document.</p>
  5329. </section2>
  5330. <section2 topic='Authorizing Subscription Requests (Pending Subscribers)' anchor='impl-authorize'>
  5331. <p>How subscription requests are sent to node owners is a matter of implementation. Possibilities include:</p>
  5332. <ul>
  5333. <li>Send requests to all owners (these may be placed in offline storage as described in <cite>XEP-0160</cite>) and first approval wins.</li>
  5334. <li>The service could subscribe to owner presence, and send only to the owners that are online.</li>
  5335. <li>All owners vote on the new subscriber.</li>
  5336. <li>Any owner is allowed to veto the subscriber.</li>
  5337. </ul>
  5338. <p>An implementation MAY use any of these methods, or some other method not defined herein.</p>
  5339. </section2>
  5340. <section2 topic='Notification of Subscription State Changes' anchor='impl-subchange'>
  5341. <p>Various actions and events may result in changes to a subscription state:</p>
  5342. <ul>
  5343. <li><p>Approval or denial of a subscription request as described in the <link url='#owner-subreq'>Manage Subscription Requests</link> use case</p></li>
  5344. <li><p>Cancellation of an existing subscription, for which many "triggers" are possible:</p>
  5345. <ul>
  5346. <li>The entity simply unsubscribes from the node</li>
  5347. <li>The node is of type "presence" and the underlying presence subscription is cancelled</li>
  5348. <li>The node is of type "roster" and the entity is moved to an unauthorized roster group</li>
  5349. </ul>
  5350. </li>
  5351. </ul>
  5352. <p>When a subscription state change occurs, a service SHOULD send a message to the (new, former, or denied) subscriber informing it of the change, where the message contains an &lt;event/&gt; element with a single &lt;subscription/&gt; child that specifies the node, JID, and subscription state. The notification MAY contain a &BODY; element specifying natural-language text regarding the subscription change. The JID to which the service sends the notification is the address that was set in the 'jid' attribute of the subscription request. Examples are shown below.</p>
  5353. <example caption='Subscription approval notification'><![CDATA[
  5354. <message
  5355. from='pubsub.shakespeare.lit'
  5356. to='horatio@denmark.lit'
  5357. id='approvalnotify1'>
  5358. <event xmlns='http://jabber.org/protocol/pubsub#event'>
  5359. <subscription node='princely_musings' jid='horatio@denmark.lit' subscription='subscribed'/>
  5360. </event>
  5361. </message>
  5362. ]]></example>
  5363. <example caption='Subscription cancellation / denial notification'><![CDATA[
  5364. <message
  5365. from='pubsub.shakespeare.lit'
  5366. to='horatio@denmark.lit'
  5367. id='unsubnotify1'>
  5368. <event xmlns='http://jabber.org/protocol/pubsub#event'>
  5369. <subscription node='princely_musings' jid='horatio@denmark.lit' subscription='none'/>
  5370. </event>
  5371. </message>
  5372. ]]></example>
  5373. <p>If the service has knowledge of the (former or denied) subscriber's presence, it SHOULD send the message to all of the subscriber's resources; if not, it MUST send the message to the subscriber's affiliated JID.</p>
  5374. <p>If a service or node supports this feature, it MUST return a feature of "subscription-notifications" in its response to service discovery information requests.</p>
  5375. </section2>
  5376. <section2 topic='NodeID Semantics' anchor='impl-semantics'>
  5377. <p>NodeIDs MAY have semantic meaning in particular profiles, implementations, or deployments of pubsub. However, it is STRONGLY RECOMMENDED that such semantic meaning not be used to encapsulate the hierarchical structure of nodes; instead, node hierarchy SHOULD be encapsulated using collections and their associated child nodes as described in <cite>XEP-0248</cite>.</p>
  5378. </section2>
  5379. <section2 topic='Inclusion of SHIM Headers' anchor='impl-shim'>
  5380. <p>When SubIDs are used, <cite>Stanza Headers and Internet Metadata (SHIM)</cite> headers are to be included in order to differentiate notifications sent regarding a particular subscription. The relevant use cases and scenarios are:</p>
  5381. <ul>
  5382. <li>Sending notifications regarding newly-published items as described in the <link url='#publisher-publish'>Publish an Item to a Node</link> use case.</li>
  5383. <li>Sending notifications regarding deleted items as described in the <link url='#publisher-delete'>Delete an Item from a Node</link> use case.</li>
  5384. </ul>
  5385. <p>The SHIM headers are generated by the node to which the subscriber has a subscription, which may be either a leaf node or a collection node (refer to <cite>XEP-0248</cite>).</p>
  5386. <p>SHIM headers are not to be included when the content does not differ based on subscription ID, e.g., when a node sends notification of a configuration change to the node itself, notification that the node has been purged, or notification that the node has been deleted.</p>
  5387. </section2>
  5388. <section2 topic='Associating Events and Payloads with the Generating Entity' anchor='impl-association'>
  5389. <p>An implementation MAY enable the node configuration to specify an association between the event notification and the entity to which the published information pertains, but such a feature is OPTIONAL. Here are some possible examples:</p>
  5390. <ul>
  5391. <li>In the context of a geolocation notification service using &xep0080;, the user may generate the geolocation information or the information may be generated by an automated service (e.g., a service offered by a mobile telephony provider), but in either case the information is <em>about</em> the user's geolocation and therefore all replies should go to the user (who is probably the node owner).</li>
  5392. <li>In the context of a group weblog, different users might publish to the weblog and replies might go to the publisher of an entry rather than to the weblog owner.</li>
  5393. <li>In the context of an integrated pubsub and multi-user chat system, the node owner might be the room owner but all replies need to be sent to the room rather than to the owner.</li>
  5394. </ul>
  5395. <p>Therefore we define the "itemreply" node configuration option, with two possible values:</p>
  5396. <ul>
  5397. <li>"owner" (i.e., the node owner or an alias for the node owners)</li>
  5398. <li>"publisher" (i.e., the item publisher)</li>
  5399. </ul>
  5400. <p>A node owner MUST NOT define more than one of these options.</p>
  5401. <p>An example is shown below.</p>
  5402. <example caption='Event notification with publisher JID'><![CDATA[
  5403. <message from='pubsub.shakespeare.lit'
  5404. to='bassanio@merchantofvenice.lit'>
  5405. <event xmlns='http://jabber.org/protocol/pubsub#event'>
  5406. <items node='n48ad4fj78zn38st734'>
  5407. <item id='i1s2d3f4g5h6bjeh936'
  5408. publisher='portia@merchantofvenice.lit'>
  5409. <geoloc xmlns='http://jabber.org/protocol/geoloc'>
  5410. <description>Venice</description>
  5411. <lat>45.44</lat>
  5412. <lon>12.33</lon>
  5413. </geoloc>
  5414. </item>
  5415. </items>
  5416. </event>
  5417. </message>
  5418. ]]></example>
  5419. <p>Alternatively, if a service implements the personal eventing subset of this protocol, the virtual pubsub service is the account owner's bare JID and notifications are sent from that JID; for details, refer to <cite>XEP-0163</cite>.</p>
  5420. </section2>
  5421. <section2 topic='Chaining' anchor='impl-chaining'>
  5422. <p>The word "chaining" refers to the practice of subscribing one node to another node. For instance, consider a scenario in which the node &lt;pubsub@example.net/NewsBroadcaster&gt; wants to distribute information received from the node "NewsFeed" at &lt;pubsub.example.com&gt;. While it is theoretically possible for &lt;pubsub@example.net/NewsBroadcaster&gt; to directly subscribe to the NewsFeed node (since the former node is directly addressable as a JID), implementations MUST NOT chain nodes in this fashion. Instead, implementations MUST subscribe from the address of the pubsub service rather than the node (in the example shown here, the subscription would be sent from &lt;pubsub@example.net&gt; rather than &lt;pubsub@example.net/NewsBroadcaster&gt;).</p>
  5423. </section2>
  5424. <section2 topic='Time-Based Subscriptions (Leases)' anchor='impl-leases'>
  5425. <p>In some systems it may be desirable to provide a subscription "leasing" feature in order to expire old or stale subscriptions. Leases can be implemented using configurable subscription options; specifically, when an entity subscribes, the service would require configuration of subscription options and the configuration form would contain a field of "pubsub#expire". This field MUST contain a dateTime (as specified in &xep0082;).</p>
  5426. <p>The leasing process is shown below.</p>
  5427. <example caption='Leasing process'><![CDATA[
  5428. <iq type='set'
  5429. from='francisco@denmark.lit/barracks'
  5430. to='pubsub.shakespeare.lit'
  5431. id='lease1'>
  5432. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  5433. <subscribe
  5434. node='princely_musings'
  5435. jid='francisco@denmark.lit'/>
  5436. </pubsub>
  5437. </iq>
  5438. <iq type='result'
  5439. from='pubsub.shakespeare.lit'
  5440. to='francisco@denmark.lit/barracks'
  5441. id='lease1'>
  5442. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  5443. <subscription
  5444. node='princely_musings'
  5445. jid='francisco@denmark.lit'
  5446. subscription='unconfigured'>
  5447. <subscribe-options>
  5448. <required/>
  5449. </subscribe-options>
  5450. </subscription>
  5451. </pubsub>
  5452. </iq>
  5453. <iq type='get'
  5454. from='francisco@denmark.lit/barracks'
  5455. to='pubsub.shakespeare.lit'
  5456. id='lease2'>
  5457. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  5458. <options node='princely_musings' jid='francisco@denmark.lit'/>
  5459. </pubsub>
  5460. </iq>
  5461. <iq type='result'
  5462. from='pubsub.shakespeare.lit'
  5463. to='francisco@denmark.lit/barracks'
  5464. id='lease2'>
  5465. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  5466. <options node='princely_musings' jid='francisco@denmark.lit'>
  5467. <x xmlns='jabber:x:data' type='form'>
  5468. <field var='FORM_TYPE' type='hidden'>
  5469. <value>http://jabber.org/protocol/pubsub#subscribe_options</value>
  5470. </field>
  5471. ...
  5472. <field var='pubsub#expire' type='text-single'
  5473. label='Requested lease period'/>
  5474. ...
  5475. </x>
  5476. </options>
  5477. </pubsub>
  5478. </iq>
  5479. <iq type='set'
  5480. from='francisco@denmark.lit/barracks'
  5481. to='pubsub.shakespeare.lit'
  5482. id='lease3'>
  5483. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  5484. <options node='princely_musings' jid='francisco@denmark.lit'>
  5485. <x xmlns='jabber:x:data' type='submit'>
  5486. <field var='FORM_TYPE' type='hidden'>
  5487. <value>http://jabber.org/protocol/pubsub#subscribe_options</value>
  5488. </field>
  5489. ...
  5490. <field var='pubsub#expire'><value>2006-02-28T11:59:59Z</value></field>
  5491. ...
  5492. </x>
  5493. </options>
  5494. </pubsub>
  5495. </iq>
  5496. <iq type='result'
  5497. from='pubsub.shakespeare.lit'
  5498. to='francisco@denmark.lit/barracks'
  5499. id='lease3'/>
  5500. ]]></example>
  5501. <p>The service MAY send a message to the subscriber when the lease is almost over (e.g., 24 hours before the end of the lease term). This MUST be done by sending a &MESSAGE; containing a &lt;subscription/&gt; element qualified by the 'http://jabber.org/protocol/pubsub#event' namespace and including an 'expiry' attribute.</p>
  5502. <example caption='Service notifies subscriber of impending lease end'><![CDATA[
  5503. <message from='pubsub.shakespeare.lit' to='francisco@denmark.lit/barracks'>
  5504. <event xmlns='http://jabber.org/protocol/pubsub#event'>
  5505. <subscription
  5506. expiry='2006-02-28T23:59:59Z'
  5507. jid='francisco@denmark.lit'
  5508. node='princely_musings'
  5509. subid='ba49252aaa4f5d320c24d3766f0bdcade78c78d3'
  5510. subscription='subscribed'/>
  5511. </event>
  5512. </message>
  5513. ]]></example>
  5514. <p>When the subscriber wants to renew the lease, it would get the current subscription options, change the value of the "pubsub#expire" field, and submit the new subscription options back to the service. If the new expire value exceeds the maximum value allowed for subscription leases, the service MUST change the value of the field to be the current date/time plus the maximum allowed lease period.</p>
  5515. <example caption='Renewing a lease'><![CDATA[
  5516. <iq type='get'
  5517. from='francisco@denmark.lit/barracks'
  5518. to='pubsub.shakespeare.lit'
  5519. id='renew1'>
  5520. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  5521. <options node='princely_musings' jid='francisco@denmark.lit'/>
  5522. </pubsub>
  5523. </iq>
  5524. <iq type='result'
  5525. from='pubsub.shakespeare.lit'
  5526. to='francisco@denmark.lit/barracks'
  5527. id='renew1'>
  5528. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  5529. <options node='princely_musings' jid='francisco@denmark.lit'>
  5530. <x xmlns='jabber:x:data' type='form'>
  5531. <field var='FORM_TYPE' type='hidden'>
  5532. <value>http://jabber.org/protocol/pubsub#subscribe_options</value>
  5533. </field>
  5534. ...
  5535. <field var='pubsub#expire' type='text-single'
  5536. label='Requested lease period'/>
  5537. ...
  5538. </x>
  5539. </options>
  5540. </pubsub>
  5541. </iq>
  5542. <iq type='set'
  5543. from='francisco@denmark.lit/barracks'
  5544. to='pubsub.shakespeare.lit'
  5545. id='renew2'>
  5546. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  5547. <options node='princely_musings' jid='francisco@denmark.lit'>
  5548. <x xmlns='jabber:x:data' type='submit'>
  5549. <field var='FORM_TYPE' type='hidden'>
  5550. <value>http://jabber.org/protocol/pubsub#subscribe_options</value>
  5551. </field>
  5552. ...
  5553. <field var='pubsub#expire'><value>2006-03-31T23:59:59Z</value></field>
  5554. ...
  5555. </x>
  5556. </options>
  5557. </pubsub>
  5558. </iq>
  5559. <iq type='result'
  5560. from='pubsub.shakespeare.lit'
  5561. to='francisco@denmark.lit/barracks'
  5562. id='renew2'/>
  5563. ]]></example>
  5564. </section2>
  5565. <section2 topic='Content-Based Pubsub Systems' anchor='impl-content'>
  5566. <p>A service MAY enable entities to subscribe to nodes and apply a filter to notifications (e.g., keyword matching such as "send me all news entries from Slashdot that match the term 'XMPP'"). Such a content-based service SHOULD allow an entity to subscribe more than once to the same node and, if so, MUST use subscription identifiers (SubIDs) to distinguish between multiple subscriptions. In order to prevent collisions, a service that supports content-based subscriptions using SubIDs SHOULD generate SubIDs on behalf of subscribers rather than allowing subscribers to set their own SubIDs. <note>Another way to implement content-based subscriptions is to host one node per keyword or other filter; however, this is likely to require an extremely large number of nodes.</note></p>
  5567. <p>Content-based services SHOULD use subscription options to specify the filter(s) to be applied. Because there many possible filtering mechanisms (many of which may be application-specific), this document does not define any such method. However, filtering mechanisms may be defined in separate specifications.</p>
  5568. <p>A fictional example of the subscription options configuration process for content-based pubsub is shown below.</p>
  5569. <example caption='A content-based subscription'><![CDATA[
  5570. <iq type='set'
  5571. from='bard@shakespeare.lit/globe'
  5572. to='pubsub.shakespeare.lit'
  5573. id='filter1'>
  5574. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  5575. <subscribe
  5576. node='princely_musings'
  5577. jid='francisco@denmark.lit'/>
  5578. </pubsub>
  5579. </iq>
  5580. <iq type='result'
  5581. from='pubsub.shakespeare.lit'
  5582. to='bard@shakespeare.lit/globe'
  5583. id='filter1'>
  5584. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  5585. <subscription
  5586. node='princely_musings'
  5587. jid='bard@shakespeare.lit'
  5588. subid='991d7fd1616fd041015064133cd097a10030819e'
  5589. subscription='unconfigured'>
  5590. <subscribe-options>
  5591. <required/>
  5592. </subscribe-options>
  5593. </subscription>
  5594. </pubsub>
  5595. </iq>
  5596. <iq type='get'
  5597. from='bard@shakespeare.lit/globe'
  5598. to='pubsub.shakespeare.lit'
  5599. id='filter2'>
  5600. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  5601. <options node='princely_musings'
  5602. jid='bard@shakespeare.lit'
  5603. subid='991d7fd1616fd041015064133cd097a10030819e'/>
  5604. </pubsub>
  5605. </iq>
  5606. <iq type='result'
  5607. from='pubsub.shakespeare.lit'
  5608. to='bard@shakespeare.lit/globe'
  5609. id='filter2'>
  5610. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  5611. <options node='princely_musings'
  5612. jid='bard@shakespeare.lit'
  5613. subid='991d7fd1616fd041015064133cd097a10030819e'>
  5614. <x xmlns='jabber:x:data' type='form'>
  5615. <field var='FORM_TYPE' type='hidden'>
  5616. <value>http://jabber.org/protocol/pubsub#subscribe_options</value>
  5617. </field>
  5618. ...
  5619. <field var='x-http://shakespeare.lit/search#keyword'
  5620. type='text-single'
  5621. label='Keyword to match'/>
  5622. ...
  5623. </x>
  5624. </options>
  5625. </pubsub>
  5626. </iq>
  5627. <iq type='set'
  5628. from='bard@shakespeare.lit/globe'
  5629. to='pubsub.shakespeare.lit'
  5630. id='filter3'>
  5631. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  5632. <options node='princely_musings'
  5633. jid='bard@shakespeare.lit'
  5634. subid='991d7fd1616fd041015064133cd097a10030819e'>
  5635. <x xmlns='jabber:x:data' type='submit'>
  5636. <field var='FORM_TYPE' type='hidden'>
  5637. <value>http://jabber.org/protocol/pubsub#subscribe_options</value>
  5638. </field>
  5639. ...
  5640. <field var='x-http://shakespeare.lit/search#keyword'><value>peasant</value></field>
  5641. ...
  5642. </x>
  5643. </options>
  5644. </pubsub>
  5645. </iq>
  5646. <iq type='result'
  5647. from='pubsub.shakespeare.lit'
  5648. to='bard@shakespeare.lit/globe'
  5649. id='filter3'/>
  5650. ]]></example>
  5651. <p>The subscriber will then be notified about events that match the keyword.</p>
  5652. <example caption='Event notification for matched keyword'><![CDATA[
  5653. <message from='pubsub.shakespeare.lit' to='bard@shakespeare.lit'>
  5654. <event xmlns='http://jabber.org/protocol/pubsub#event'>
  5655. <items node='princely_musings'>
  5656. <item id='4e30f35051b7b8b42abe083742187228'>
  5657. <entry xmlns='http://www.w3.org/2005/Atom'>
  5658. <title>Alone</title>
  5659. <summary>
  5660. Now I am alone.
  5661. O, what a rogue and peasant slave am I!
  5662. </summary>
  5663. <link rel='alternate' type='text/html'
  5664. href='http://denmark.lit/2003/12/13/atom03'/>
  5665. <id>tag:denmark.lit,2003:entry-32396</id>
  5666. <published>2003-12-13T11:09:53Z</published>
  5667. <updated>2003-12-13T11:09:53Z</updated>
  5668. </entry>
  5669. </item>
  5670. </items>
  5671. </event>
  5672. <headers xmlns='http://jabber.org/protocol/shim'>
  5673. <header name='SubID'>991d7fd1616fd041015064133cd097a10030819e</header>
  5674. </headers>
  5675. </message>
  5676. ]]></example>
  5677. </section2>
  5678. <section2 topic='Singleton Nodes' anchor='impl-singleton'>
  5679. <p>For some nodes, it is desirable to have at most one item associated with the node at any one time (for example, a client may want to store its preferences using a node name that is a namespace controlled by that client). When this pattern is desired, it is RECOMMENDED for the publisher to specify an ItemID of "current" to ensure that the publication of a new item will overwrite the existing item.</p>
  5680. <example caption='Publishing to a Singleton Node'><![CDATA[
  5681. <iq type='set'
  5682. from='horatio@denmark.lit/mobile'
  5683. to='pubsub.shakespeare.lit'
  5684. id='single1'>
  5685. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  5686. <publish node='elsinore-doorbell'>
  5687. <item id='current'/>
  5688. </publish>
  5689. </pubsub>
  5690. </iq>
  5691. ]]></example>
  5692. <p>Naturally, the node owner can enforce the singleton node pattern by setting the max_items configuration option to "1".</p>
  5693. </section2>
  5694. <section2 topic='PubSub URIs' anchor='impl-uri'>
  5695. <p>An XMPP URI (see &rfc5122;) can be used for the purpose of identification or interaction. Some examples are provided below.</p>
  5696. <p>The following URI merely identifies a pubsub node.</p>
  5697. <example caption='XMPP URI for a node'><![CDATA[
  5698. xmpp:pubsub.shakespeare.lit?;node=princely_musings
  5699. ]]></example>
  5700. <p>The following URI identifies a specific item at a node.</p>
  5701. <example caption='XMPP URI for a pubsub item'><![CDATA[
  5702. xmpp:pubsub.shakespeare.lit?;node=princely_musings;item=ae890ac52d0df67ed7cfdf51b644e901
  5703. ]]></example>
  5704. <p>The following URI defines how to subscribe to a node (for details, see the <link url='#registrar-querytypes'>URI Query Types</link> section of this document).</p>
  5705. <example caption='URI for subscribing to a pubsub node'><![CDATA[
  5706. xmpp:pubsub.shakespeare.lit?pubsub;action=subscribe;node=princely_musings
  5707. ]]></example>
  5708. <p>The following URI defines how to retrieve a specific item from a node.</p>
  5709. <example caption='URI for retrieving a pubsub item'><![CDATA[
  5710. xmpp:pubsub.shakespeare.lit?pubsub;action=retrieve;node=princely_musings;item=ae890ac52d0df67ed7cfdf51b644e901
  5711. ]]></example>
  5712. </section2>
  5713. </section1>
  5714. <section1 topic='Internationalization Considerations' anchor='i18n'>
  5715. <section2 topic='Field Labels' anchor='i18n-formtypes'>
  5716. <p>The Data Forms shown in this specification include English-language labels for various fields; implementations that will display such forms to human users SHOULD provide localized label text for fields that are defined for the registered FORM_TYPEs.</p>
  5717. </section2>
  5718. </section1>
  5719. <section1 topic='Security Considerations' anchor='security'>
  5720. <section2 topic='Private Information' anchor='security-privacy'>
  5721. <p>The data published to a pubsub node might contain sensitive information (e.g., a user's geolocation). Therefore, node owners SHOULD exercise care in approving subscription requests. Security considerations regarding particular kinds of information are the responsibility of the "using protocol".</p>
  5722. </section2>
  5723. <section2 topic='Authorization' anchor='security-authorization'>
  5724. <p>XMPP PubSub contains a hierarchy of affiliations for the purpose of authorization and access control. A service MUST NOT allow non-owners or other unauthorized entities to complete any actions defined under the <link url='#owner'>Owner Use Cases</link> section of this document.</p>
  5725. </section2>
  5726. <section2 topic='Access Models' anchor='security-access'>
  5727. <p>A service MUST adhere to the defined access model in determining whether to send event notifications or payloads to an entity, or allow an entity to retrieve items from a node. A service MAY enforce additional privacy and security policies when determining whether an entity is allowed to subscribe to a node or retrieve items from a node; however, any such policies shall be considered specific to an implementation or deployment and are out of scope for this document.</p>
  5728. </section2>
  5729. <section2 topic='Presence Leaks' anchor='security-presence'>
  5730. <p>In the context of instant messaging systems it is possible for the act of publishing an item to reveal the node owner or item publisher's network availability. However, this risk is mitigated by the following factors:</p>
  5731. <ol>
  5732. <li>A node does not necessarily reveal the existence of the publishing entity.</li>
  5733. <li>XMPP PubSub systems are not necessarily tied to instant messaging systems.</li>
  5734. <li>Even in the context of IM systems, a node provides information distinct from network availability (e.g., user tunes).</li>
  5735. <li>Even then, the actual publisher might not be an IM user (e.g., an automated calendaring or geolocation system).</li>
  5736. </ol>
  5737. </section2>
  5738. </section1>
  5739. <section1 topic='IANA Considerations' anchor='iana'>
  5740. <p>This document does not require interaction with &IANA;.</p>
  5741. </section1>
  5742. <section1 topic='XMPP Registrar Considerations' anchor='registrar'>
  5743. <section2 topic='Protocol Namespaces' anchor='registrar-ns'>
  5744. <p>The &REGISTRAR; includes the following namespaces in its registry of protocol namespaces (see &NAMESPACES;):</p>
  5745. <ul>
  5746. <li>http://jabber.org/protocol/pubsub</li>
  5747. <li>http://jabber.org/protocol/pubsub#errors</li>
  5748. <li>http://jabber.org/protocol/pubsub#event</li>
  5749. <li>http://jabber.org/protocol/pubsub#owner</li>
  5750. </ul>
  5751. </section2>
  5752. <section2 topic='Service Discovery Category/Type' anchor='registrar-disco'>
  5753. <p>The XMPP Registrar includes a category of "pubsub" in its registry of Service Discovery identities (see &DISCOCATEGORIES;), as well as three specific types within that category:</p>
  5754. <table caption='Service Discovery Types in Pubsub Category'>
  5755. <tr>
  5756. <td>collection</td>
  5757. <td>A pubsub node of the "collection" type as described in XEP-0248.</td>
  5758. </tr>
  5759. <tr>
  5760. <td>leaf</td>
  5761. <td>A pubsub node of the "leaf" type as described in XEP-0060.</td>
  5762. </tr>
  5763. <tr>
  5764. <td>service</td>
  5765. <td>A pubsub service that supports the functionality defined in XEP-0060. <note>Prior to version 1.5 of XEP-0060, this type was called "generic".</note></td>
  5766. </tr>
  5767. </table>
  5768. <p>The registry submission is as follows:</p>
  5769. <code><![CDATA[
  5770. <category>
  5771. <name>pubsub</name>
  5772. <desc>Services and nodes that adhere to XEP-0060.</desc>
  5773. <type>
  5774. <name>collection</name>
  5775. <desc>A pubsub node of the "collection" type.</desc>
  5776. <doc>XEP-0248</doc>
  5777. </type>
  5778. <type>
  5779. <name>leaf</name>
  5780. <desc>A pubsub node of the "leaf" type.</desc>
  5781. <doc>XEP-0060</doc>
  5782. </type>
  5783. <type>
  5784. <name>service</name>
  5785. <desc>A pubsub service that supports the functionality defined in XEP-0060.</desc>
  5786. <doc>XEP-0060</doc>
  5787. </type>
  5788. </category>
  5789. ]]></code>
  5790. <p>Future submissions to the XMPP Registrar may register additional types.</p>
  5791. </section2>
  5792. <section2 topic='Service Discovery Features' anchor='registrar-features'>
  5793. <p>The XMPP Registrar maintains a registry of service discovery features (see &DISCOFEATURES;), which includes a number of features that may be returned by pubsub services. The following registry submission has been provided to the XMPP Registrar for that purpose.</p>
  5794. <code><![CDATA[
  5795. <var>
  5796. <name>http://jabber.org/protocol/pubsub#access-authorize</name>
  5797. <desc>The default node access model is authorize.</desc>
  5798. <doc>XEP-0060</doc>
  5799. </var>
  5800. <var>
  5801. <name>http://jabber.org/protocol/pubsub#access-open</name>
  5802. <desc>The default node access model is open.</desc>
  5803. <doc>XEP-0060</doc>
  5804. </var>
  5805. <var>
  5806. <name>http://jabber.org/protocol/pubsub#access-presence</name>
  5807. <desc>The default node access model is presence.</desc>
  5808. <doc>XEP-0060</doc>
  5809. </var>
  5810. <var>
  5811. <name>http://jabber.org/protocol/pubsub#access-roster</name>
  5812. <desc>The default node access model is roster.</desc>
  5813. <doc>XEP-0060</doc>
  5814. </var>
  5815. <var>
  5816. <name>http://jabber.org/protocol/pubsub#access-whitelist</name>
  5817. <desc>The default node access model is whitelist.</desc>
  5818. <doc>XEP-0060</doc>
  5819. </var>
  5820. <var>
  5821. <name>http://jabber.org/protocol/pubsub#auto-create</name>
  5822. <desc>The service supports automatic creation of nodes on first publish.</desc>
  5823. <doc>XEP-0060</doc>
  5824. </var>
  5825. <var>
  5826. <name>http://jabber.org/protocol/pubsub#auto-subscribe</name>
  5827. <desc>The service supports automatic subscription to a nodes based on presence subscription.</desc>
  5828. <doc>XEP-0060</doc>
  5829. </var>
  5830. <var>
  5831. <name>http://jabber.org/protocol/pubsub#collections</name>
  5832. <desc>Collection nodes are supported.</desc>
  5833. <doc>XEP-0248</doc>
  5834. </var>
  5835. <var>
  5836. <name>http://jabber.org/protocol/pubsub#config-node</name>
  5837. <desc>Configuration of node options is supported.</desc>
  5838. <doc>XEP-0060</doc>
  5839. </var>
  5840. <var>
  5841. <name>http://jabber.org/protocol/pubsub#create-and-configure</name>
  5842. <desc>Simultaneous creation and configuration of nodes is supported.</desc>
  5843. <doc>XEP-0060</doc>
  5844. </var>
  5845. <var>
  5846. <name>http://jabber.org/protocol/pubsub#create-nodes</name>
  5847. <desc>Creation of nodes is supported.</desc>
  5848. <doc>XEP-0060</doc>
  5849. </var>
  5850. <var>
  5851. <name>http://jabber.org/protocol/pubsub#delete-items</name>
  5852. <desc>Deletion of items is supported.</desc>
  5853. <doc>XEP-0060</doc>
  5854. </var>
  5855. <var>
  5856. <name>http://jabber.org/protocol/pubsub#delete-nodes</name>
  5857. <desc>Deletion of nodes is supported.</desc>
  5858. <doc>XEP-0060</doc>
  5859. </var>
  5860. <var>
  5861. <name>http://jabber.org/protocol/pubsub#filtered-notifications</name>
  5862. <desc>The service supports filtering of notifications based on Entity Capabilities.</desc>
  5863. <doc>XEP-0060</doc>
  5864. </var>
  5865. <var>
  5866. <name>http://jabber.org/protocol/pubsub#get-pending</name>
  5867. <desc>Retrieval of pending subscription approvals is supported.</desc>
  5868. <doc>XEP-0060</doc>
  5869. </var>
  5870. <var>
  5871. <name>http://jabber.org/protocol/pubsub#instant-nodes</name>
  5872. <desc>Creation of instant nodes is supported.</desc>
  5873. <doc>XEP-0060</doc>
  5874. </var>
  5875. <var>
  5876. <name>http://jabber.org/protocol/pubsub#item-ids</name>
  5877. <desc>Publishers may specify item identifiers.</desc>
  5878. <doc>XEP-0060</doc>
  5879. </var>
  5880. <var>
  5881. <name>http://jabber.org/protocol/pubsub#last-published</name>
  5882. <desc>
  5883. The service supports sending of the last published item to new
  5884. subscribers and to newly available resources.
  5885. </desc>
  5886. <doc>XEP-0060</doc>
  5887. </var>
  5888. <var>
  5889. <name>http://jabber.org/protocol/pubsub#leased-subscription</name>
  5890. <desc>Time-based subscriptions are supported.</desc>
  5891. <doc>XEP-0060</doc>
  5892. </var>
  5893. <var>
  5894. <name>http://jabber.org/protocol/pubsub#manage-subscriptions</name>
  5895. <desc>Node owners may manage subscriptions.</desc>
  5896. <doc>XEP-0060</doc>
  5897. </var>
  5898. <var>
  5899. <name>http://jabber.org/protocol/pubsub#member-affiliation</name>
  5900. <desc>The member affiliation is supported.</desc>
  5901. <doc>XEP-0060</doc>
  5902. </var>
  5903. <var>
  5904. <name>http://jabber.org/protocol/pubsub#meta-data</name>
  5905. <desc>Node meta-data is supported.</desc>
  5906. <doc>XEP-0060</doc>
  5907. </var>
  5908. <var>
  5909. <name>http://jabber.org/protocol/pubsub#modify-affiliations</name>
  5910. <desc>Node owners may modify affiliations.</desc>
  5911. <doc>XEP-0060</doc>
  5912. </var>
  5913. <var>
  5914. <name>http://jabber.org/protocol/pubsub#multi-collection</name>
  5915. <desc>A single leaf node can be associated with multiple collections.</desc>
  5916. <doc>XEP-0060</doc>
  5917. </var>
  5918. <var>
  5919. <name>http://jabber.org/protocol/pubsub#multi-items</name>
  5920. <desc>The service supports the storage of multiple items per node.</desc>
  5921. <doc>XEP-0060</doc>
  5922. </var>
  5923. <var>
  5924. <name>http://jabber.org/protocol/pubsub#multi-subscribe</name>
  5925. <desc>A single entity may subscribe to a node multiple times.</desc>
  5926. <doc>XEP-0060</doc>
  5927. </var>
  5928. <var>
  5929. <name>http://jabber.org/protocol/pubsub#outcast-affiliation</name>
  5930. <desc>The outcast affiliation is supported.</desc>
  5931. <doc>XEP-0060</doc>
  5932. </var>
  5933. <var>
  5934. <name>http://jabber.org/protocol/pubsub#persistent-items</name>
  5935. <desc>Persistent items are supported.</desc>
  5936. <doc>XEP-0060</doc>
  5937. </var>
  5938. <var>
  5939. <name>http://jabber.org/protocol/pubsub#presence-notifications</name>
  5940. <desc>Presence-based delivery of event notifications is supported.</desc>
  5941. <doc>XEP-0060</doc>
  5942. </var>
  5943. <var>
  5944. <name>http://jabber.org/protocol/pubsub#presence-subscribe</name>
  5945. <desc>Implicit presence-based subscriptions are supported.</desc>
  5946. <doc>XEP-0060</doc>
  5947. </var>
  5948. <var>
  5949. <name>http://jabber.org/protocol/pubsub#publish</name>
  5950. <desc>Publishing items is supported.</desc>
  5951. <doc>XEP-0060</doc>
  5952. </var>
  5953. <var>
  5954. <name>http://jabber.org/protocol/pubsub#publish-options</name>
  5955. <desc>Publication with publish options is supported.</desc>
  5956. <doc>XEP-0060</doc>
  5957. </var>
  5958. <var>
  5959. <name>http://jabber.org/protocol/pubsub#publish-only-affiliation</name>
  5960. <desc>The publish-only affiliation is supported.</desc>
  5961. <doc>XEP-0060</doc>
  5962. </var>
  5963. <var>
  5964. <name>http://jabber.org/protocol/pubsub#publisher-affiliation</name>
  5965. <desc>The publisher affiliation is supported.</desc>
  5966. <doc>XEP-0060</doc>
  5967. </var>
  5968. <var>
  5969. <name>http://jabber.org/protocol/pubsub#purge-nodes</name>
  5970. <desc>Purging of nodes is supported.</desc>
  5971. <doc>XEP-0060</doc>
  5972. </var>
  5973. <var>
  5974. <name>http://jabber.org/protocol/pubsub#retract-items</name>
  5975. <desc>Item retraction is supported.</desc>
  5976. <doc>XEP-0060</doc>
  5977. </var>
  5978. <var>
  5979. <name>http://jabber.org/protocol/pubsub#retrieve-affiliations</name>
  5980. <desc>Retrieval of current affiliations is supported.</desc>
  5981. <doc>XEP-0060</doc>
  5982. </var>
  5983. <var>
  5984. <name>http://jabber.org/protocol/pubsub#retrieve-default</name>
  5985. <desc>Retrieval of default node configuration is supported.</desc>
  5986. <doc>XEP-0060</doc>
  5987. </var>
  5988. <var>
  5989. <name>http://jabber.org/protocol/pubsub#retrieve-default-sub</name>
  5990. <desc>Retrieval of default subscription configuration is supported.</desc>
  5991. <doc>XEP-0060</doc>
  5992. </var>
  5993. <var>
  5994. <name>http://jabber.org/protocol/pubsub#retrieve-items</name>
  5995. <desc>Item retrieval is supported.</desc>
  5996. <doc>XEP-0060</doc>
  5997. </var>
  5998. <var>
  5999. <name>http://jabber.org/protocol/pubsub#retrieve-subscriptions</name>
  6000. <desc>Retrieval of current subscriptions is supported.</desc>
  6001. <doc>XEP-0060</doc>
  6002. </var>
  6003. <var>
  6004. <name>http://jabber.org/protocol/pubsub#subscribe</name>
  6005. <desc>Subscribing and unsubscribing are supported.</desc>
  6006. <doc>XEP-0060</doc>
  6007. </var>
  6008. <var>
  6009. <name>http://jabber.org/protocol/pubsub#subscription-options</name>
  6010. <desc>Configuration of subscription options is supported.</desc>
  6011. <doc>XEP-0060</doc>
  6012. </var>
  6013. <var>
  6014. <name>http://jabber.org/protocol/pubsub#subscription-notifications</name>
  6015. <desc>Notification of subscription state changes is supported.</desc>
  6016. <doc>XEP-0060</doc>
  6017. </var>
  6018. ]]></code>
  6019. </section2>
  6020. <section2 topic='Field Standardization' anchor='registrar-formtypes'>
  6021. <p>XEP-0068 defines a process for standardizing the fields used within Data Forms scoped by a particular namespace, and the XMPP Registrar maintains a registry of such FORM_TYPES (see &FORMTYPES;). Within pubsub, there are four uses of such forms:</p>
  6022. <ol>
  6023. <li>Authorization of subscriptions using the 'http://jabber.org/protocol/pubsub#subscribe_authorization' namespace.</li>
  6024. <li>Configuration of subscription options using the 'http://jabber.org/protocol/pubsub#subscribe_options' namespace.</li>
  6025. <li>Configuration of a node using the 'http://jabber.org/protocol/pubsub#node_config' namespace.</li>
  6026. <li>Setting of metadata information using the 'http://jabber.org/protocol/pubsub#meta-data' namespace.</li>
  6027. </ol>
  6028. <p>The registry submissions associated with these namespaces are defined below.</p>
  6029. <p>Note: There is no requirement that configuration fields need to be registered with the XMPP Registrar. However, as specified in Section 3.4 of <cite>XEP-0068</cite>, names of custom (unregistered) fields MUST begin with the characters "x-" if the form itself is scoped by a registered FORM_TYPE.</p>
  6030. <section3 topic='pubsub#subscribe_authorization FORM_TYPE' anchor='registrar-formtypes-auth'>
  6031. <code><![CDATA[
  6032. <form_type>
  6033. <name>http://jabber.org/protocol/pubsub#subscribe_authorization</name>
  6034. <doc>XEP-0060</doc>
  6035. <desc>Forms enabling authorization of subscriptions to pubsub nodes</desc>
  6036. <field
  6037. var='pubsub#allow'
  6038. type='boolean'
  6039. label='Whether to allow the subscription'/>
  6040. <field
  6041. var='pubsub#node'
  6042. type='text-single'
  6043. label='The NodeID of the relevant node'/>
  6044. <field
  6045. var='pubsub#subscriber_jid'
  6046. type='jid-single'
  6047. label='The address (JID) of the subscriber'/>
  6048. <field
  6049. var='pubsub#subid'
  6050. type='text-single'
  6051. label='The subscription identifier associated with the subscription request'/>
  6052. </form_type>
  6053. ]]></code>
  6054. </section3>
  6055. <section3 topic='pubsub#subscribe_options FORM_TYPE' anchor='registrar-formtypes-subscribe'>
  6056. <code><![CDATA[
  6057. <form_type>
  6058. <name>http://jabber.org/protocol/pubsub#subscribe_options</name>
  6059. <doc>XEP-0060</doc>
  6060. <desc>Forms enabling configuration of subscription options for pubsub nodes</desc>
  6061. <field
  6062. var='pubsub#deliver'
  6063. type='boolean'
  6064. label='Whether an entity wants to receive
  6065. or disable notifications'/>
  6066. <field
  6067. var='pubsub#digest'
  6068. type='boolean'
  6069. label='Whether an entity wants to receive digests
  6070. (aggregations) of notifications or all
  6071. notifications individually'/>
  6072. <field var='pubsub#digest_frequency'
  6073. type='text-single'
  6074. label='The minimum number of milliseconds between
  6075. sending any two notification digests'/>
  6076. <field
  6077. var='pubsub#expire'
  6078. type='text-single'
  6079. label='The DateTime at which a leased subscription
  6080. will end or has ended'/>
  6081. <field
  6082. var='pubsub#include_body'
  6083. type='boolean'
  6084. label='Whether an entity wants to receive an XMPP
  6085. message body in addition to the payload
  6086. format'/>
  6087. <field
  6088. var='pubsub#show-values'
  6089. type='list-multi'
  6090. label='The presence states for which an entity
  6091. wants to receive notifications'>
  6092. <option label='XMPP Show Value of Away'>
  6093. <value>away</value>
  6094. </option>
  6095. <option label='XMPP Show Value of Chat'>
  6096. <value>chat</value>
  6097. </option>
  6098. <option label='XMPP Show Value of DND (Do Not Disturb)'>
  6099. <value>dnd</value>
  6100. </option>
  6101. <option label='Mere Availability in XMPP (No Show Value)'>
  6102. <value>online</value>
  6103. </option>
  6104. <option label='XMPP Show Value of XA (Extended Away)'>
  6105. <value>xa</value>
  6106. </option>
  6107. </field>
  6108. <field var='pubsub#subscription_type'
  6109. type='list-single'>
  6110. <option label='Receive notification of new items only'>
  6111. <value>items</value>
  6112. </option>
  6113. <option label='Receive notification of new nodes only'>
  6114. <value>nodes</value>
  6115. </option>
  6116. </field>
  6117. <field var='pubsub#subscription_depth'
  6118. type='list-single'>
  6119. <option label='Receive notification from direct child nodes only'>
  6120. <value>1</value>
  6121. </option>
  6122. <option label='Receive notification from all descendent nodes'>
  6123. <value>all</value>
  6124. </option>
  6125. </field>
  6126. </form_type>
  6127. ]]></code>
  6128. </section3>
  6129. <section3 topic='pubsub#meta-data FORM_TYPE' anchor='registrar-formtypes-metadata'>
  6130. <code><![CDATA[
  6131. <form_type>
  6132. <name>http://jabber.org/protocol/pubsub#meta-data</name>
  6133. <doc>XEP-0060</doc>
  6134. <desc>Forms enabling setting of metadata information about pubsub nodes</desc>
  6135. <field var='pubsub#contact'
  6136. type='jid-multi'
  6137. label='The JIDs of those to contact with questions'/>
  6138. <field var='pubsub#creation_date'
  6139. type='text-single'
  6140. label='The datetime when the node was created'/>
  6141. <field var='pubsub#creator'
  6142. type='jid-single'
  6143. label='The JID of the node creator'/>
  6144. <field var='pubsub#description'
  6145. type='text-single'
  6146. label='A description of the node'/>
  6147. <field var='pubsub#language'
  6148. type='list-single'
  6149. label='The default language of the node'/>
  6150. <field var='pubsub#num_subscribers'
  6151. type='text-single'
  6152. label='The number of subscribers to the node'/>
  6153. <field var='pubsub#owner'
  6154. type='jid-multi'
  6155. label='The JIDs of those with an affiliation of owner'/>
  6156. <field var='pubsub#publisher'
  6157. type='jid-multi'
  6158. label='The JIDs of those with an affiliation of publisher'/>
  6159. <field var='pubsub#title'
  6160. type='text-single'
  6161. label='The name of the node'/>
  6162. <field var='pubsub#type'
  6163. type='text-single'
  6164. label='Payload type'/>
  6165. <field var='pubsub#max_items'
  6166. type='text-single'
  6167. label='Max # of items to persist'/>
  6168. </form_type>
  6169. ]]></code>
  6170. </section3>
  6171. <section3 topic='pubsub#node_config FORM_TYPE' anchor='registrar-formtypes-config'>
  6172. <code><![CDATA[
  6173. <form_type>
  6174. <name>http://jabber.org/protocol/pubsub#node_config</name>
  6175. <doc>XEP-0060</doc>
  6176. <desc>Forms enabling configuration of pubsub nodes</desc>
  6177. <field var='pubsub#access_model'
  6178. type='list-single'
  6179. label='Who may subscribe and retrieve items'>
  6180. <option label='Subscription requests must be approved and only subscribers may retrieve items'>
  6181. <value>authorize</value>
  6182. </option>
  6183. <option label='Anyone may subscribe and retrieve items'>
  6184. <value>open</value>
  6185. </option>
  6186. <option label='Anyone with a presence subscription of both or from may subscribe and retrieve items'>
  6187. <value>presence</value>
  6188. </option>
  6189. <option label='Anyone in the specified roster group(s) may subscribe and retrieve items'>
  6190. <value>roster</value>
  6191. </option>
  6192. <option label='Only those on a whitelist may subscribe and retrieve items'>
  6193. <value>whitelist</value>
  6194. </option>
  6195. </field>
  6196. <field var='pubsub#body_xslt'
  6197. type='text-single'
  6198. label='The URL of an XSL transformation which can be
  6199. applied to payloads in order to generate an
  6200. appropriate message body element.'/>
  6201. <field var='pubsub#children_association_policy'
  6202. type='list-single'
  6203. label='Who may associate leaf nodes with a collection'>
  6204. <option label='Anyone may associate leaf nodes with the collection'>
  6205. <value>all</value>
  6206. </option>
  6207. <option label='Only collection node owners may associate leaf nodes with the collection'>
  6208. <value>owners</value>
  6209. </option>
  6210. <option label='Only those on a whitelist may associate leaf nodes with the collection'>
  6211. <value>whitelist</value>
  6212. </option>
  6213. </field>
  6214. <field var='pubsub#children_association_whitelist'
  6215. type='jid-multi'
  6216. label='The list of JIDs that may associate leaf nodes with a collection'/>
  6217. <field var='pubsub#children'
  6218. type='text-multi'
  6219. label='The child nodes (leaf or collection) associated with a collection'/>
  6220. <field var='pubsub#children_max'
  6221. type='text-single'
  6222. label='The maximum number of child nodes that can be associated with a collection'/>
  6223. <field var='pubsub#collection'
  6224. type='text-multi'
  6225. label='The collection(s) with which a node is affiliated'/>
  6226. <field var='pubsub#contact'
  6227. type='jid-multi'
  6228. label='The JIDs of those to contact with questions'/>
  6229. <field var='pubsub#dataform_xslt'
  6230. type='text-single'
  6231. label='The URL of an XSL transformation which can be
  6232. applied to the payload format in order to generate
  6233. a valid Data Forms result that the client could
  6234. display using a generic Data Forms rendering
  6235. engine'/>
  6236. <field var='pubsub#deliver_notifications' type='boolean'
  6237. label='Whether to deliver event notifications'>
  6238. <value>true</value>
  6239. </field>
  6240. <field var='pubsub#deliver_payloads'
  6241. type='boolean'
  6242. label='Whether to deliver payloads with event notifications; applies only to leaf nodes'/>
  6243. <field var='pubsub#description'
  6244. type='text-single'
  6245. label='A description of the node'/>
  6246. <field var='pubsub#item_expire'
  6247. type='text-single'
  6248. label='Number of seconds after which to automatically purge items'/>
  6249. <field var='pubsub#itemreply'
  6250. type='list-single'
  6251. label='Whether owners or publisher should receive replies to items'>
  6252. <option label='Statically specify a replyto of the node owner(s)'>
  6253. <value>owner</value>
  6254. </option>
  6255. <option label='Dynamically specify a replyto of the item publisher'>
  6256. <value>publisher</value>
  6257. </option>
  6258. </field>
  6259. <field var='pubsub#language'
  6260. type='list-single'
  6261. label='The default language of the node'/>
  6262. <field var='pubsub#max_items'
  6263. type='text-single'
  6264. label='The maximum number of items to persist'/>
  6265. <field var='pubsub#max_payload_size'
  6266. type='text-single'
  6267. label='The maximum payload size in bytes'/>
  6268. <field var='pubsub#node_type'
  6269. type='list-single'
  6270. label='Whether the node is a leaf (default) or a collection'>
  6271. <option label='The node is a leaf node (default)'>
  6272. <value>leaf</value>
  6273. </option>
  6274. <option label='The node is a collection node'>
  6275. <value>collection</value>
  6276. </option>
  6277. </field>
  6278. <field var='pubsub#notification_type' type='list-single'
  6279. label='Specify the delivery style for notifications'>
  6280. <option label='Messages of type normal'>
  6281. <value>normal</value>
  6282. </option>
  6283. <option label='Messages of type headline'>
  6284. <value>headline</value>
  6285. </option>
  6286. </field>
  6287. <field var='pubsub#notify_config'
  6288. type='boolean'
  6289. label='Whether to notify subscribers when the node configuration changes'/>
  6290. <field var='pubsub#notify_delete'
  6291. type='boolean'
  6292. label='Whether to notify subscribers when the node is deleted'/>
  6293. <field var='pubsub#notify_retract'
  6294. type='boolean'
  6295. label='Whether to notify subscribers when items are removed from the node'/>
  6296. <field var='pubsub#notify_sub'
  6297. type='boolean'
  6298. label='Whether to notify owners about new subscribers and unsubscribes'/>
  6299. <field var='pubsub#persist_items'
  6300. type='boolean'
  6301. label='Whether to persist items to storage'/>
  6302. <field var='pubsub#presence_based_delivery'
  6303. type='boolean'
  6304. label='Whether to deliver notifications to available users only'/>
  6305. <field var='pubsub#publish_model'
  6306. type='list-single'
  6307. label='The publisher model'>
  6308. <option label='Only publishers may publish'>
  6309. <value>publishers</value>
  6310. </option>
  6311. <option label='Subscribers may publish'>
  6312. <value>subscribers</value>
  6313. </option>
  6314. <option label='Anyone may publish'>
  6315. <value>open</value>
  6316. </option>
  6317. </field>
  6318. <field var='pubsub#purge_offline'
  6319. type='boolean'
  6320. label='Whether to purge all items when the relevant publisher goes offline'/>
  6321. <field var='pubsub#roster_groups_allowed'
  6322. type='list-multi'
  6323. label='The roster group(s) allowed to subscribe and retrieve items'/>
  6324. <field var='pubsub#send_last_published_item'
  6325. type='list-single'
  6326. label='When to send the last published item'>
  6327. <option label='Never'>
  6328. <value>never</value>
  6329. </option>
  6330. <option label='When a new subscription is processed'>
  6331. <value>on_sub</value>
  6332. </option>
  6333. <option label='When a new subscription is processed and whenever a subscriber comes online'>
  6334. <value>on_sub_and_presence</value>
  6335. </option>
  6336. </field>
  6337. <field var='pubsub#tempsub'
  6338. type='boolean'
  6339. label='Whether to make all subscriptions temporary, based on subscriber presence'/>
  6340. <field var='pubsub#subscribe' type='boolean'
  6341. label='Whether to allow subscriptions'>
  6342. <value>1</value>
  6343. </field>
  6344. <field var='pubsub#title'
  6345. type='text-single'
  6346. label='A friendly name for the node'/>
  6347. <field var='pubsub#type'
  6348. type='text-single'
  6349. label='The type of node data, usually specified by
  6350. the namespace of the payload (if any)'/>
  6351. </form_type>
  6352. ]]></code>
  6353. </section3>
  6354. </section2>
  6355. <section2 topic='SHIM Headers' anchor='registrar-shim'>
  6356. <p>The XMPP Registrar includes "Collection" and "SubID" in its registry of SHIM headers (see &SHIMHEADERS;). The registry submission is as follows:</p>
  6357. <code><![CDATA[
  6358. <header>
  6359. <name>Collection</name>
  6360. <desc>The collection via which an event notification was received from the originating node.</desc>
  6361. <doc>XEP-0248</doc>
  6362. </header>
  6363. <header>
  6364. <name>SubID</name>
  6365. <desc>A subscription identifer within the pubsub protocol.</desc>
  6366. <doc>XEP-0060</doc>
  6367. </header>
  6368. ]]></code>
  6369. <p>Future submissions to the XMPP Registrar may register additional SHIM headers that can be used in relation to the pubsub protocol, and such submission may occur without updating this specification.</p>
  6370. </section2>
  6371. <section2 topic='URI Query Types' anchor='registrar-querytypes'>
  6372. <p>As authorized by &xep0147;, the XMPP Registrar maintains a registry of queries and key-value pairs for use in XMPP URIs (see &QUERYTYPES;).</p>
  6373. <p>The "pubsub" querytype is defined herein for interaction with pubsub services, with three keys: (1) "action" (whose defined values are "subscribe", "unsubscribe", and "retrieve"), (2) "node" (to specify a pubsub node), and optionally "item" (to specify a particular item at a node).</p>
  6374. <example caption='Pubsub Subscribe Action: IRI/URI'><![CDATA[
  6375. xmpp:pubsub.shakespeare.lit?pubsub;action=subscribe;node=princely_musings
  6376. ]]></example>
  6377. <example caption='Pubsub Subscribe Action: Resulting Stanza'><![CDATA[
  6378. <iq to='pubsub.shakespeare.lit' type='set'>
  6379. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  6380. <subscribe node='princely_musings'/>
  6381. </pubsub>
  6382. </iq>
  6383. ]]></example>
  6384. <example caption='Pubsub Unsubscribe Action: IRI/URI'><![CDATA[
  6385. xmpp:pubsub.shakespeare.lit?pubsub;action=unsubscribe;node=princely_musings
  6386. ]]></example>
  6387. <example caption='Pubsub Unsubscribe Action: Resulting Stanza'><![CDATA[
  6388. <iq to='pubsub.shakespeare.lit' type='set'>
  6389. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  6390. <unsubscribe node='princely_musings'/>
  6391. </pubsub>
  6392. </iq>
  6393. ]]></example>
  6394. <example caption='Pubsub Retrieve Action: IRI/URI'><![CDATA[
  6395. xmpp:pubsub.shakespeare.lit?pubsub;action=retrieve;node=princely_musings
  6396. ]]></example>
  6397. <example caption='Pubsub Retrieve Action: Resulting Stanza'><![CDATA[
  6398. <iq to='pubsub.shakespeare.lit' type='get'>
  6399. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  6400. <items node='princely_musings'/>
  6401. </pubsub>
  6402. </iq>
  6403. ]]></example>
  6404. <p>The following submission registers the "pubsub" querytype.</p>
  6405. <code><![CDATA[
  6406. <querytype>
  6407. <name>pubsub</name>
  6408. <proto>http://jabber.org/protocol/pubsub</proto>
  6409. <desc>enables interaction with a publish-subscribe service</desc>
  6410. <doc>XEP-0060</doc>
  6411. <keys>
  6412. <key>
  6413. <name>action</name>
  6414. <desc>the pubsub action</desc>
  6415. <values>
  6416. <value>
  6417. <name>subscribe</name>
  6418. <desc>enables subscribing to a pubsub node</desc>
  6419. </value>
  6420. <value>
  6421. <name>unsubscribe</name>
  6422. <desc>enables unsubscribing from a pubsub node</desc>
  6423. </value>
  6424. </values>
  6425. </key>
  6426. <key>
  6427. <name>node</name>
  6428. <desc>the pubsub node</desc>
  6429. </key>
  6430. </keys>
  6431. </querytype>
  6432. ]]></code>
  6433. </section2>
  6434. </section1>
  6435. <section1 topic='XML Schemas' anchor='schemas'>
  6436. <section2 topic='http://jabber.org/protocol/pubsub' anchor='schemas-pubsub'>
  6437. <code><![CDATA[
  6438. <?xml version='1.0' encoding='UTF-8'?>
  6439. <xs:schema
  6440. xmlns:xs='http://www.w3.org/2001/XMLSchema'
  6441. targetNamespace='http://jabber.org/protocol/pubsub'
  6442. xmlns='http://jabber.org/protocol/pubsub'
  6443. elementFormDefault='qualified'>
  6444. <xs:annotation>
  6445. <xs:documentation>
  6446. The protocol documented by this schema is defined in
  6447. XEP-0060: http://xmpp.org/extensions/xep-0060.html
  6448. </xs:documentation>
  6449. </xs:annotation>
  6450. <xs:import
  6451. namespace='jabber:x:data'
  6452. schemaLocation='http://xmpp.org/schemas/x-data.xsd'/>
  6453. <xs:element name='pubsub'>
  6454. <xs:complexType>
  6455. <xs:choice>
  6456. <xs:sequence>
  6457. <xs:element ref='create'/>
  6458. <xs:element ref='configure' minOccurs='0'/>
  6459. </xs:sequence>
  6460. <xs:sequence>
  6461. <xs:element ref='subscribe' minOccurs='0'/>
  6462. <xs:element ref='options' minOccurs='0'/>
  6463. </xs:sequence>
  6464. <xs:sequence>
  6465. <xs:element ref='publish'/>
  6466. <xs:element ref='publish-options' minOccurs='0'/>
  6467. </xs:sequence>
  6468. <xs:choice minOccurs='0'>
  6469. <xs:element ref='affiliations'/>
  6470. <xs:element ref='default'/>
  6471. <xs:element ref='items'/>
  6472. <xs:element ref='publish'/>
  6473. <xs:element ref='retract'/>
  6474. <xs:element ref='subscription'/>
  6475. <xs:element ref='subscriptions'/>
  6476. <xs:element ref='unsubscribe'/>
  6477. </xs:choice>
  6478. </xs:choice>
  6479. </xs:complexType>
  6480. </xs:element>
  6481. <xs:element name='affiliations'>
  6482. <xs:complexType>
  6483. <xs:sequence>
  6484. <xs:element ref='affiliation' minOccurs='0' maxOccurs='unbounded'/>
  6485. </xs:sequence>
  6486. <xs:attribute name='node' type='xs:string' use='required'/>
  6487. </xs:complexType>
  6488. </xs:element>
  6489. <xs:element name='affiliation'>
  6490. <xs:complexType>
  6491. <xs:simpleContent>
  6492. <xs:extension base='empty'>
  6493. <xs:attribute name='affiliation' use='required'>
  6494. <xs:simpleType>
  6495. <xs:restriction base='xs:NCName'>
  6496. <xs:enumeration value='member'/>
  6497. <xs:enumeration value='none'/>
  6498. <xs:enumeration value='outcast'/>
  6499. <xs:enumeration value='owner'/>
  6500. <xs:enumeration value='publisher'/>
  6501. <xs:enumeration value='publish-only'/>
  6502. </xs:restriction>
  6503. </xs:simpleType>
  6504. </xs:attribute>
  6505. <xs:attribute name='node' type='xs:string' use='required'/>
  6506. </xs:extension>
  6507. </xs:simpleContent>
  6508. </xs:complexType>
  6509. </xs:element>
  6510. <xs:element name='configure'>
  6511. <xs:complexType>
  6512. <xs:choice minOccurs='0' xmlns:xdata='jabber:x:data'>
  6513. <xs:element ref='xdata:x'/>
  6514. </xs:choice>
  6515. </xs:complexType>
  6516. </xs:element>
  6517. <xs:element name='create'>
  6518. <xs:complexType>
  6519. <xs:simpleContent>
  6520. <xs:extension base='empty'>
  6521. <xs:attribute name='node' type='xs:string' use='optional'/>
  6522. </xs:extension>
  6523. </xs:simpleContent>
  6524. </xs:complexType>
  6525. </xs:element>
  6526. <xs:element name='default'>
  6527. <xs:complexType>
  6528. <xs:simpleContent>
  6529. <xs:extension base='empty'>
  6530. <xs:attribute name='node' type='xs:string' use='optional'/>
  6531. <xs:attribute name='type'
  6532. use='optional'
  6533. default='leaf'>
  6534. <xs:simpleType>
  6535. <xs:restriction base='xs:NCName'>
  6536. <xs:enumeration value='collection'/>
  6537. <xs:enumeration value='leaf'/>
  6538. </xs:restriction>
  6539. </xs:simpleType>
  6540. </xs:attribute>
  6541. </xs:extension>
  6542. </xs:simpleContent>
  6543. </xs:complexType>
  6544. </xs:element>
  6545. <xs:element name='items'>
  6546. <xs:complexType>
  6547. <xs:sequence>
  6548. <xs:element ref='item' minOccurs='0' maxOccurs='unbounded'/>
  6549. </xs:sequence>
  6550. <xs:attribute name='max_items' type='xs:positiveInteger' use='optional'/>
  6551. <xs:attribute name='node' type='xs:string' use='required'/>
  6552. <xs:attribute name='subid' type='xs:string' use='optional'/>
  6553. </xs:complexType>
  6554. </xs:element>
  6555. <xs:element name='item'>
  6556. <xs:complexType>
  6557. <xs:sequence minOccurs='0'>
  6558. <xs:any namespace='##other'/>
  6559. </xs:sequence>
  6560. <xs:attribute name='id' type='xs:string' use='optional'/>
  6561. </xs:complexType>
  6562. </xs:element>
  6563. <xs:element name='options'>
  6564. <xs:complexType>
  6565. <xs:sequence minOccurs='0'>
  6566. <xs:any namespace='jabber:x:data'/>
  6567. </xs:sequence>
  6568. <xs:attribute name='jid' type='xs:string' use='required'/>
  6569. <xs:attribute name='node' type='xs:string' use='optional'/>
  6570. <xs:attribute name='subid' type='xs:string' use='optional'/>
  6571. </xs:complexType>
  6572. </xs:element>
  6573. <xs:element name='publish'>
  6574. <xs:complexType>
  6575. <xs:sequence>
  6576. <xs:element ref='item' minOccurs='0' maxOccurs='unbounded'/>
  6577. </xs:sequence>
  6578. <xs:attribute name='node' type='xs:string' use='required'/>
  6579. </xs:complexType>
  6580. </xs:element>
  6581. <xs:element name='publish-options'>
  6582. <xs:complexType>
  6583. <xs:choice minOccurs='0' xmlns:xdata='jabber:x:data'>
  6584. <xs:element ref='xdata:x'/>
  6585. </xs:choice>
  6586. </xs:complexType>
  6587. </xs:element>
  6588. <xs:element name='retract'>
  6589. <xs:complexType>
  6590. <xs:sequence>
  6591. <xs:element ref='item' minOccurs='1' maxOccurs='unbounded'/>
  6592. </xs:sequence>
  6593. <xs:attribute name='node' type='xs:string' use='required'/>
  6594. <xs:attribute name='notify' type='xs:boolean' use='optional'/>
  6595. </xs:complexType>
  6596. </xs:element>
  6597. <xs:element name='subscribe-options'>
  6598. <xs:complexType>
  6599. <xs:sequence>
  6600. <xs:element name='required' type='empty' minOccurs='0'/>
  6601. </xs:sequence>
  6602. </xs:complexType>
  6603. </xs:element>
  6604. <xs:element name='subscribe'>
  6605. <xs:complexType>
  6606. <xs:simpleContent>
  6607. <xs:extension base='empty'>
  6608. <xs:attribute name='jid' type='xs:string' use='required'/>
  6609. <xs:attribute name='node' type='xs:string' use='optional'/>
  6610. </xs:extension>
  6611. </xs:simpleContent>
  6612. </xs:complexType>
  6613. </xs:element>
  6614. <xs:element name='subscriptions'>
  6615. <xs:complexType>
  6616. <xs:sequence minOccurs='0' maxOccurs='unbounded'>
  6617. <xs:element ref='subscription'/>
  6618. </xs:sequence>
  6619. <xs:attribute name='node' type='xs:string' use='optional'/>
  6620. </xs:complexType>
  6621. </xs:element>
  6622. <xs:element name='subscription'>
  6623. <xs:complexType>
  6624. <xs:sequence>
  6625. <xs:element ref='subscribe-options' minOccurs='0'/>
  6626. </xs:sequence>
  6627. <xs:attribute name='jid' type='xs:string' use='required'/>
  6628. <xs:attribute name='node' type='xs:string' use='optional'/>
  6629. <xs:attribute name='subid' type='xs:string' use='optional'/>
  6630. <xs:attribute name='subscription' use='optional'>
  6631. <xs:simpleType>
  6632. <xs:restriction base='xs:NCName'>
  6633. <xs:enumeration value='none'/>
  6634. <xs:enumeration value='pending'/>
  6635. <xs:enumeration value='subscribed'/>
  6636. <xs:enumeration value='unconfigured'/>
  6637. </xs:restriction>
  6638. </xs:simpleType>
  6639. </xs:attribute>
  6640. </xs:complexType>
  6641. </xs:element>
  6642. <xs:element name='unsubscribe'>
  6643. <xs:complexType>
  6644. <xs:simpleContent>
  6645. <xs:extension base='empty'>
  6646. <xs:attribute name='jid' type='xs:string' use='required'/>
  6647. <xs:attribute name='node' type='xs:string' use='optional'/>
  6648. <xs:attribute name='subid' type='xs:string' use='optional'/>
  6649. </xs:extension>
  6650. </xs:simpleContent>
  6651. </xs:complexType>
  6652. </xs:element>
  6653. <xs:simpleType name='empty'>
  6654. <xs:restriction base='xs:string'>
  6655. <xs:enumeration value=''/>
  6656. </xs:restriction>
  6657. </xs:simpleType>
  6658. </xs:schema>
  6659. ]]></code>
  6660. </section2>
  6661. <section2 topic='http://jabber.org/protocol/pubsub#errors' anchor='schemas-error'>
  6662. <code><![CDATA[
  6663. <?xml version='1.0' encoding='UTF-8'?>
  6664. <xs:schema
  6665. xmlns:xs='http://www.w3.org/2001/XMLSchema'
  6666. targetNamespace='http://jabber.org/protocol/pubsub#errors'
  6667. xmlns='http://jabber.org/protocol/pubsub#errors'
  6668. elementFormDefault='qualified'>
  6669. <xs:annotation>
  6670. <xs:documentation>
  6671. This namespace is used for error reporting only, as
  6672. defined in XEP-0060:
  6673. http://xmpp.org/extensions/xep-0060.html
  6674. </xs:documentation>
  6675. </xs:annotation>
  6676. <xs:element name='closed-node' type='empty'/>
  6677. <xs:element name='configuration-required' type='empty'/>
  6678. <xs:element name='invalid-jid' type='empty'/>
  6679. <xs:element name='invalid-options' type='empty'/>
  6680. <xs:element name='invalid-payload' type='empty'/>
  6681. <xs:element name='invalid-subid' type='empty'/>
  6682. <xs:element name='item-forbidden' type='empty'/>
  6683. <xs:element name='item-required' type='empty'/>
  6684. <xs:element name='jid-required' type='empty'/>
  6685. <xs:element name='max-items-exceeded' type='empty'/>
  6686. <xs:element name='max-nodes-exceeded' type='empty'/>
  6687. <xs:element name='nodeid-required' type='empty'/>
  6688. <xs:element name='not-in-roster-group' type='empty'/>
  6689. <xs:element name='not-subscribed' type='empty'/>
  6690. <xs:element name='payload-too-big' type='empty'/>
  6691. <xs:element name='payload-required' type='empty'/>
  6692. <xs:element name='pending-subscription' type='empty'/>
  6693. <xs:element name='precondition-not-met' type='empty'/>
  6694. <xs:element name='presence-subscription-required' type='empty'/>
  6695. <xs:element name='subid-required' type='empty'/>
  6696. <xs:element name='too-many-subscriptions' type='empty'/>
  6697. <xs:element name='unsupported'>
  6698. <xs:complexType>
  6699. <xs:simpleContent>
  6700. <xs:extension base='empty'>
  6701. <xs:attribute name='feature' use='required'>
  6702. <xs:simpleType>
  6703. <xs:restriction base='xs:NCName'>
  6704. <xs:enumeration value='access-authorize'/>
  6705. <xs:enumeration value='access-open'/>
  6706. <xs:enumeration value='access-presence'/>
  6707. <xs:enumeration value='access-roster'/>
  6708. <xs:enumeration value='access-whitelist'/>
  6709. <xs:enumeration value='auto-create'/>
  6710. <xs:enumeration value='auto-subscribe'/>
  6711. <xs:enumeration value='collections'/>
  6712. <xs:enumeration value='config-node'/>
  6713. <xs:enumeration value='create-and-configure'/>
  6714. <xs:enumeration value='create-nodes'/>
  6715. <xs:enumeration value='delete-items'/>
  6716. <xs:enumeration value='delete-nodes'/>
  6717. <xs:enumeration value='filtered-notifications'/>
  6718. <xs:enumeration value='get-pending'/>
  6719. <xs:enumeration value='instant-nodes'/>
  6720. <xs:enumeration value='item-ids'/>
  6721. <xs:enumeration value='last-published'/>
  6722. <xs:enumeration value='leased-subscription'/>
  6723. <xs:enumeration value='manage-subscriptions'/>
  6724. <xs:enumeration value='member-affiliation'/>
  6725. <xs:enumeration value='meta-data'/>
  6726. <xs:enumeration value='modify-affiliations'/>
  6727. <xs:enumeration value='multi-collection'/>
  6728. <xs:enumeration value='multi-items'/>
  6729. <xs:enumeration value='multi-subscribe'/>
  6730. <xs:enumeration value='outcast-affiliation'/>
  6731. <xs:enumeration value='persistent-items'/>
  6732. <xs:enumeration value='presence-notifications'/>
  6733. <xs:enumeration value='presence-subscribe'/>
  6734. <xs:enumeration value='publish'/>
  6735. <xs:enumeration value='publish-options'/>
  6736. <xs:enumeration value='publish-only-affiliation'/>
  6737. <xs:enumeration value='publisher-affiliation'/>
  6738. <xs:enumeration value='purge-nodes'/>
  6739. <xs:enumeration value='retract-items'/>
  6740. <xs:enumeration value='retrieve-affiliations'/>
  6741. <xs:enumeration value='retrieve-default'/>
  6742. <xs:enumeration value='retrieve-default-sub'/>
  6743. <xs:enumeration value='retrieve-items'/>
  6744. <xs:enumeration value='retrieve-subscriptions'/>
  6745. <xs:enumeration value='subscribe'/>
  6746. <xs:enumeration value='subscription-options'/>
  6747. <xs:enumeration value='subscription-notifications'/>
  6748. </xs:restriction>
  6749. </xs:simpleType>
  6750. </xs:attribute>
  6751. </xs:extension>
  6752. </xs:simpleContent>
  6753. </xs:complexType>
  6754. </xs:element>
  6755. <xs:element name='unsupported-access-model' type='empty'/>
  6756. <xs:simpleType name='empty'>
  6757. <xs:restriction base='xs:string'>
  6758. <xs:enumeration value=''/>
  6759. </xs:restriction>
  6760. </xs:simpleType>
  6761. </xs:schema>
  6762. ]]></code>
  6763. </section2>
  6764. <section2 topic='http://jabber.org/protocol/pubsub#event' anchor='schemas-event'>
  6765. <code><![CDATA[
  6766. <?xml version='1.0' encoding='UTF-8'?>
  6767. <xs:schema
  6768. xmlns:xs='http://www.w3.org/2001/XMLSchema'
  6769. targetNamespace='http://jabber.org/protocol/pubsub#event'
  6770. xmlns='http://jabber.org/protocol/pubsub#event'
  6771. elementFormDefault='qualified'>
  6772. <xs:annotation>
  6773. <xs:documentation>
  6774. The protocol documented by this schema is defined in
  6775. XEP-0060: http://xmpp.org/extensions/xep-0060.html
  6776. </xs:documentation>
  6777. </xs:annotation>
  6778. <xs:import
  6779. namespace='jabber:x:data'
  6780. schemaLocation='http://xmpp.org/schemas/x-data.xsd'/>
  6781. <xs:element name='event'>
  6782. <xs:complexType>
  6783. <xs:choice>
  6784. <xs:element ref='collection'/>
  6785. <xs:element ref='configuration'/>
  6786. <xs:element ref='delete'/>
  6787. <xs:element ref='items'/>
  6788. <xs:element ref='purge'/>
  6789. <xs:element ref='subscription'/>
  6790. </xs:choice>
  6791. </xs:complexType>
  6792. </xs:element>
  6793. <xs:element name='collection'>
  6794. <xs:complexType>
  6795. <xs:choice>
  6796. <xs:element ref='associate'/>
  6797. <xs:element ref='disassociate'/>
  6798. </xs:choice>
  6799. <xs:attribute name='node' type='xs:string' use='optional'/>
  6800. </xs:complexType>
  6801. </xs:element>
  6802. <xs:element name='associate'>
  6803. <xs:complexType>
  6804. <xs:simpleContent>
  6805. <xs:extension base='empty'>
  6806. <xs:attribute name='node' type='xs:string' use='required'/>
  6807. </xs:extension>
  6808. </xs:simpleContent>
  6809. </xs:complexType>
  6810. </xs:element>
  6811. <xs:element name='disassociate'>
  6812. <xs:complexType>
  6813. <xs:simpleContent>
  6814. <xs:extension base='empty'>
  6815. <xs:attribute name='node' type='xs:string' use='required'/>
  6816. </xs:extension>
  6817. </xs:simpleContent>
  6818. </xs:complexType>
  6819. </xs:element>
  6820. <xs:element name='configuration'>
  6821. <xs:complexType>
  6822. <xs:sequence minOccurs='0' xmlns:xdata='jabber:x:data'>
  6823. <xs:element ref='xdata:x'/>
  6824. </xs:sequence>
  6825. <xs:attribute name='node' type='xs:string' use='optional'/>
  6826. </xs:complexType>
  6827. </xs:element>
  6828. <xs:element name='delete'>
  6829. <xs:complexType>
  6830. <xs:sequence>
  6831. <xs:element ref='redirect' minOccurs='0' maxOccurs='1'/>
  6832. </xs:sequence>
  6833. <xs:attribute name='node' type='xs:string' use='required'/>
  6834. </xs:complexType>
  6835. </xs:element>
  6836. <xs:element name='items'>
  6837. <xs:complexType>
  6838. <xs:choice>
  6839. <xs:element ref='item' minOccurs='0' maxOccurs='unbounded'/>
  6840. <xs:element ref='retract' minOccurs='0' maxOccurs='unbounded'/>
  6841. </xs:choice>
  6842. <xs:attribute name='node' type='xs:string' use='required'/>
  6843. </xs:complexType>
  6844. </xs:element>
  6845. <xs:element name='item'>
  6846. <xs:complexType>
  6847. <xs:choice minOccurs='0'>
  6848. <xs:any namespace='##other'/>
  6849. </xs:choice>
  6850. <xs:attribute name='id' type='xs:string' use='optional'/>
  6851. <xs:attribute name='node' type='xs:string' use='optional'/>
  6852. <xs:attribute name='publisher' type='xs:string' use='optional'/>
  6853. </xs:complexType>
  6854. </xs:element>
  6855. <xs:element name='purge'>
  6856. <xs:complexType>
  6857. <xs:simpleContent>
  6858. <xs:extension base='empty'>
  6859. <xs:attribute name='node' type='xs:string' use='required'/>
  6860. </xs:extension>
  6861. </xs:simpleContent>
  6862. </xs:complexType>
  6863. </xs:element>
  6864. <xs:element name='redirect'>
  6865. <xs:complexType>
  6866. <xs:simpleContent>
  6867. <xs:extension base='empty'>
  6868. <xs:attribute name='uri' type='xs:string' use='required'/>
  6869. </xs:extension>
  6870. </xs:simpleContent>
  6871. </xs:complexType>
  6872. </xs:element>
  6873. <xs:element name='retract'>
  6874. <xs:complexType>
  6875. <xs:simpleContent>
  6876. <xs:extension base='empty'>
  6877. <xs:attribute name='id' type='xs:string' use='required'/>
  6878. </xs:extension>
  6879. </xs:simpleContent>
  6880. </xs:complexType>
  6881. </xs:element>
  6882. <xs:element name='subscription'>
  6883. <xs:complexType>
  6884. <xs:simpleContent>
  6885. <xs:extension base='empty'>
  6886. <xs:attribute name='expiry' type='xs:dateTime' use='optional'/>
  6887. <xs:attribute name='jid' type='xs:string' use='required'/>
  6888. <xs:attribute name='node' type='xs:string' use='optional'/>
  6889. <xs:attribute name='subid' type='xs:string' use='optional'/>
  6890. <xs:attribute name='subscription' use='optional'>
  6891. <xs:simpleType>
  6892. <xs:restriction base='xs:NCName'>
  6893. <xs:enumeration value='none'/>
  6894. <xs:enumeration value='pending'/>
  6895. <xs:enumeration value='subscribed'/>
  6896. <xs:enumeration value='unconfigured'/>
  6897. </xs:restriction>
  6898. </xs:simpleType>
  6899. </xs:attribute>
  6900. </xs:extension>
  6901. </xs:simpleContent>
  6902. </xs:complexType>
  6903. </xs:element>
  6904. <xs:simpleType name='empty'>
  6905. <xs:restriction base='xs:string'>
  6906. <xs:enumeration value=''/>
  6907. </xs:restriction>
  6908. </xs:simpleType>
  6909. </xs:schema>
  6910. ]]></code>
  6911. </section2>
  6912. <section2 topic='http://jabber.org/protocol/pubsub#owner' anchor='schemas-owner'>
  6913. <code><![CDATA[
  6914. <?xml version='1.0' encoding='UTF-8'?>
  6915. <xs:schema
  6916. xmlns:xs='http://www.w3.org/2001/XMLSchema'
  6917. targetNamespace='http://jabber.org/protocol/pubsub#owner'
  6918. xmlns='http://jabber.org/protocol/pubsub#owner'
  6919. elementFormDefault='qualified'>
  6920. <xs:annotation>
  6921. <xs:documentation>
  6922. The protocol documented by this schema is defined in
  6923. XEP-0060: http://xmpp.org/extensions/xep-0060.html
  6924. </xs:documentation>
  6925. </xs:annotation>
  6926. <xs:import
  6927. namespace='jabber:x:data'
  6928. schemaLocation='http://xmpp.org/schemas/x-data.xsd'/>
  6929. <xs:element name='pubsub'>
  6930. <xs:complexType>
  6931. <xs:choice>
  6932. <xs:element ref='affiliations'/>
  6933. <xs:element ref='configure'/>
  6934. <xs:element ref='default'/>
  6935. <xs:element ref='delete'/>
  6936. <xs:element ref='purge'/>
  6937. <xs:element ref='subscriptions'/>
  6938. </xs:choice>
  6939. </xs:complexType>
  6940. </xs:element>
  6941. <xs:element name='affiliations'>
  6942. <xs:complexType>
  6943. <xs:sequence>
  6944. <xs:element ref='affiliation' minOccurs='0' maxOccurs='unbounded'/>
  6945. </xs:sequence>
  6946. <xs:attribute name='node' type='xs:string' use='required'/>
  6947. </xs:complexType>
  6948. </xs:element>
  6949. <xs:element name='affiliation'>
  6950. <xs:complexType>
  6951. <xs:simpleContent>
  6952. <xs:extension base='empty'>
  6953. <xs:attribute name='affiliation' use='required'>
  6954. <xs:simpleType>
  6955. <xs:restriction base='xs:NCName'>
  6956. <xs:enumeration value='member'/>
  6957. <xs:enumeration value='none'/>
  6958. <xs:enumeration value='outcast'/>
  6959. <xs:enumeration value='owner'/>
  6960. <xs:enumeration value='publisher'/>
  6961. <xs:enumeration value='publish-only'/>
  6962. </xs:restriction>
  6963. </xs:simpleType>
  6964. </xs:attribute>
  6965. <xs:attribute name='jid' type='xs:string' use='required'/>
  6966. </xs:extension>
  6967. </xs:simpleContent>
  6968. </xs:complexType>
  6969. </xs:element>
  6970. <xs:element name='configure'>
  6971. <xs:complexType>
  6972. <xs:choice minOccurs='0' xmlns:xdata='jabber:x:data'>
  6973. <xs:element ref='xdata:x'/>
  6974. </xs:choice>
  6975. <xs:attribute name='node' use='optional'/>
  6976. </xs:complexType>
  6977. </xs:element>
  6978. <xs:element name='default'>
  6979. <xs:complexType>
  6980. <xs:choice minOccurs='0' xmlns:xdata='jabber:x:data'>
  6981. <xs:element ref='xdata:x'/>
  6982. </xs:choice>
  6983. </xs:complexType>
  6984. </xs:element>
  6985. <xs:element name='delete'>
  6986. <xs:complexType>
  6987. <xs:sequence>
  6988. <xs:element ref='redirect' minOccurs='0' maxOccurs='1'/>
  6989. </xs:sequence>
  6990. <xs:attribute name='node' type='xs:string' use='required'/>
  6991. </xs:complexType>
  6992. </xs:element>
  6993. <xs:element name='purge'>
  6994. <xs:complexType>
  6995. <xs:simpleContent>
  6996. <xs:extension base='empty'>
  6997. <xs:attribute name='node' type='xs:string' use='required'/>
  6998. </xs:extension>
  6999. </xs:simpleContent>
  7000. </xs:complexType>
  7001. </xs:element>
  7002. <xs:element name='redirect'>
  7003. <xs:complexType>
  7004. <xs:simpleContent>
  7005. <xs:extension base='empty'>
  7006. <xs:attribute name='uri' type='xs:string' use='required'/>
  7007. </xs:extension>
  7008. </xs:simpleContent>
  7009. </xs:complexType>
  7010. </xs:element>
  7011. <xs:element name='subscriptions'>
  7012. <xs:complexType>
  7013. <xs:sequence>
  7014. <xs:element ref='subscription' minOccurs='0' maxOccurs='unbounded'/>
  7015. </xs:sequence>
  7016. <xs:attribute name='node' type='xs:string' use='required'/>
  7017. </xs:complexType>
  7018. </xs:element>
  7019. <xs:element name='subscription'>
  7020. <xs:complexType>
  7021. <xs:simpleContent>
  7022. <xs:extension base='empty'>
  7023. <xs:attribute name='subscription' use='required'>
  7024. <xs:simpleType>
  7025. <xs:restriction base='xs:NCName'>
  7026. <xs:enumeration value='none'/>
  7027. <xs:enumeration value='pending'/>
  7028. <xs:enumeration value='subscribed'/>
  7029. <xs:enumeration value='unconfigured'/>
  7030. </xs:restriction>
  7031. </xs:simpleType>
  7032. </xs:attribute>
  7033. <xs:attribute name='jid' type='xs:string' use='required'/>
  7034. </xs:extension>
  7035. </xs:simpleContent>
  7036. </xs:complexType>
  7037. </xs:element>
  7038. <xs:simpleType name='empty'>
  7039. <xs:restriction base='xs:string'>
  7040. <xs:enumeration value=''/>
  7041. </xs:restriction>
  7042. </xs:simpleType>
  7043. </xs:schema>
  7044. ]]></code>
  7045. </section2>
  7046. </section1>
  7047. <section1 topic='Acknowledgements' anchor='ack'>
  7048. <p>Thanks to Kirk Bateman, Robin Collier, Blaine Cook, Ovidiu Craciun, Brian Cully, Dave Cridland, Guillaume Desmottes, Gaston Dombiak, William Edney, Seth Fitzsimmons, Fabio Forno, Nathan Fritz, Julien Genestoux, Anastasia Gornostaeva, Joe Hildebrand, Curtis King, Tuomas Koski, Petri Liimatta, Tobias Markmann, Pedro Melo, Dirk Meyer, Tory Patnoe, Peter Petrov, Sonny Piers, Christophe Romain, Pavel Šimerda, Andy Skelton, Kevin Smith, Chris Teegarden, Simon Tennant, Matt Tucker, Matthew Wild, Bob Wyman, Matus Zamborsky, and Brett Zamir for their feedback.</p>
  7049. </section1>
  7050. <section1 topic='Author Note' anchor='authornote'>
  7051. <p>Peter Millard, primary author of this specification from version 0.1 through version 1.7, died on April 26, 2006. The remaining co-authors are indebted to him for his many years of work on publish-subscribe technologies.</p>
  7052. </section1>
  7053. </xep>