[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [xri] Backtracking
John Bradley wrote: > My tendency is to code that into the authority resolution recursion > function rather than invoking the general SEP selection for each > subsegment. > I envision the code as a recursive function that processes sub > segments until it reaches the last sub segment or hits a ref/redirect. Yes - I've always thought of it that way too. > At a ref or redirect you have one or more refs to process. You > iterate through the list by again recursing to the same function > with the new parameters. > Once you have consumed all of the sub segments you fallow the ref > in the last XRD if there is one. > If the XRD cant be returned you raise an exception and unwind back > to your list of refs you are iterating through. > > Only then do you invoke the general SEP selection process with the > input parameter. Yes if by "only then" you mean only when you have finished authority resolution successfully. If authority resolution fails, you don't have a final XRD to do SEP selection on. > If this fails to find the SEP then there are two choices 1 return > SEP not found, or 2 rase an exception and unwind back to your list > of refs you are iterating through. That's where you lost me. Authority resolution and SEP selection must be two distinct phases, it seems to me. During authority resolution, you are either following SEPs of type $res*auth, or REFs or REDIRECTs. If I understand ED 06 correctly, any particular XRD can contain either $res*auth SEPs, or REFs or REDIRECTs, but not mix and match from those - if there are XRD level REFs, there cannot also be $res*auth SEPs in the same XRD. So if you follow a $res*auth SEP, and you are not able to consume all of the subsegments in the authority resolution process that way, you can back up and try another URI from the same $res*auth SEP, or a URI from a lower priority $res*auth SEP in the same XRD. If none of those result in successfully consuming all of the subsegments in the authority resolution process, you have to error out. Same for following REFs - if following a REF does not lead to successful authority resolution, you can try another REF in the same XRD. Otherwise you're done. Once you have successfully finished the authority resolution process and obtained a final XRD, you can start SEP selection. Here's where it gets really confusing I think. If there are no matching SEPs, but there are XRD level REFs, you can follow the REFs looking for your service. But following a REF involves starting -another- authority resolution chain. But this is separate and distinct from the original authority resolution chain that had to finish before you could start SEP selection. Have I got that right? =vg
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]