Class URN
- Direct Known Subclasses:
- BarcodeURN,- SVG_URN,- URL_URN,- URNResource,- UserProfileImageURN,- UserProfileStringURN
{@link NID} with its required parameters, varying depending on the {@link NID}. The NID string is case sensitive. the "urn:" prefix is not case sensitive.IIZI Uniform Resource Names (URN) are using the common standard.
A URN normally looks like below, but you can read more at Uniform Resource Name.
The IIZI implementation for URN's to reference various parts in IIZI is:
"urn:NID:NSS:[?+r-component]][?=q-component][#fragment]".
or, in the form of a syntax diagram, as:
In the IIZI case, the use of the some NID's also requires specifying an environment location ({@link NIDLocation}) where the data is stored, e.g. in a database, a server cluster, a server instance (for security), a user (chosen to be identified or not), a user identifier, an application, a specific user session or a specific user client session. In the case a location is used, the resource URL produced from the URN will be private to that particular location, e.g. a server, a user or its application/client session.
Luckily, the abstraction of the final naming depends on so many things, but you don't have to worry about it. Just place it in the correct NID (Name space IDentifier) and leave the complexity to the framework.
The IIZI NID's are not registered with IANA, so they are all prefixed with "iz-" in this enum class.
- Author:
- Christopher Mindus
- Field SummaryFields
- Constructor SummaryConstructors
- Method SummaryModifier and TypeMethodDescriptionGets this instance as- URNResourcetype.- abstract booleanChecks if another URN is equal to this one.- static URNHelper method that creates a- URNResourcefrom a String.Gets the image target interface for this URN instance, if supported.- abstract StringGets the parameter string for the- toString()method.- abstract String- getURL()Gets the URL of this resource relative the current web server.- final StringGets the original URN unparsed string.- abstract int- hashCode()Gets the hash code of the instance.- booleanChecks if this instance supports returning the image target interface- {@link IImageTarget}.- booleanChecks if this URN instance is a- URNResource.- final String- toString()Formats this instance to a String that can be used for debugging.
- Field Details- urnStringThe original URN string.
 
- Constructor Details- URNConstructor.- Parameters:
- urnString- The original URN string.
- Throws:
- NullPointerException- If the- urnStringis- null.
 
 
- Method Details- fromHelper method that creates a- URNResourcefrom a String.- This method calls: - URNFactory.getInstance().from(urnString); - Parameters:
- urnString- The String to resolve to an URN resource.
- Returns:
- The URN instance.
- Throws:
- URNException- For illegal URN's.
- NIDException- For exceptions with Naming ID's.
- UnknownNIDException- For unknown Naming ID's.
- IllegalArgumentException- If the implementation encounters illegal characters.
 
- getURLGets the URL of this resource relative the current web server.- Returns:
- The URL relative the current server, if based on the current server, otherwise the full URL to the resource, or the data URL as data:<i>mediatype</i>[;base64],<i>data</i>.
- Throws:
- IOException- If there was a problem retrieving the file, an SQL error or other I/O error that caused the URL not to be possible to get (e.g. barcode failure).
 
- isURNResourcepublic boolean isURNResource()Checks if this URN instance is a- URNResource.- Returns:
- true if the instance is a URNResource, false by default.
 
- asURNResourceGets this instance as- URNResourcetype.- Returns:
- The URNResourceinstance, ornullif this instance is not aURNResource(default).
 
- isImageTargetSupportedpublic boolean isImageTargetSupported()Checks if this instance supports returning the image target interface- {@link IImageTarget}.- Returns:
- trueif the URN supports the image target interface,- false(default) otherwise.
 
- getImageTargetGets the image target interface for this URN instance, if supported.- Returns:
- The image target interface, or null(default) if not supported.
 
- getURNStringGets the original URN unparsed string.- Returns:
- The string used to parse and build this URN instance.
 
- hashCodepublic abstract int hashCode()Gets the hash code of the instance. The original URN string is not used for this hash code, rather the URN 'NID' and the parameters.
- equalsChecks if another URN is equal to this one. The original URN string is not used for this comparison, rather the URN 'NID' and the parameters.
- getParamStringGets the parameter string for the- toString()method.- Returns:
- The parameter string, always non-null.
 
- toStringFormats this instance to a String that can be used for debugging.
 
