The JCR APIs have always been plagued by the session-dependance of prefixed
names, as it makes it impossible to define constant values for things named
using JCR names.
Examples include immutable node names (jcr:content), node and property type
names, and, more recently, privileges (see issue 468).
During the Costa Mesa F2F, the consensus apparently was to consider this a
client convenience issue, and thus worry about it in JCR 2.1.
I believe it would be worthwhile to solve this earlier.
There are two obvious way to represent abstract JCR names in Java:
1) Using a new class/interface "Name" (with getters for namespaceURI and local
2) Using James Clark's notation ("expanded name") as a String:
+ clean approach
- requires additional method signatures
+ simple approach, avoids some of the new method signatures (in parameters)
- there may be a few edge cases where a given String can both be a prefixed name
and an expanded name.
My preference would be 1), introducing javax.jcr.JcrName, and to add support for
JcrNames in addition to prefixed strings in those places where it provides the