Package com.iizix.urn
Class URNFactory
java.lang.Object
com.iizix.urn.URNFactory
Factory used to keep track of various URL mapper's possible for the iiziServer and iiziGo Designer, e.g. for global, user, or session private URL's. These URL's can be used e.g. to map a very large (images) stored on file or in a database so that the client gets a short URL to use, and still have to download the contents to get it (but can be kept in cache by that device). It can also used to store an image (ImageBuffer or byte data) into the server for temporary or permanent use (either as file or in database).
Method Summary
Modifier and TypeMethodDescriptionCreates aURN
from a String.static URNFactory
Gets the instance to the URL factory.getProvider
(NID nid) Gets the service provider for the specified name.boolean
register
(IURNProvider provider) Registers a URN provider.
Method Details
getInstance
Gets the instance to the URL factory.register
Registers a URN provider.- Parameters:
provider
- The provider.- Returns:
- true if successfully registered, false if already registered. Failures will also be logged in the server.
- Throws:
RuntimeException
- If this method is called twice for the same URN provider.
getProvider
Gets the service provider for the specified name.- Parameters:
nid
- The NID.- Returns:
- The provider, or
null
if not found.
from
Creates aURN
from a String.- 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.