Package com.iizix.urn

Class URNFactory

java.lang.Object
com.iizix.urn.URNFactory

public final class URNFactory extends Object
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).
Author:
Christopher Mindus
See Also:
  • Method Details

    • getInstance

      public static URNFactory getInstance()
      Gets the instance to the URL factory.
    • register

      public boolean register(IURNProvider provider)
      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

      public IURNProvider getProvider(NID nid)
      Gets the service provider for the specified name.
      Parameters:
      nid - The NID.
      Returns:
      The provider, or null if not found.
    • from

      public URN from(String urnString) throws URNException
      Creates a URN 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.