org.eclipse.higgins.idas.registry.contextid
Class ContextIdFactory

java.lang.Object
  extended byorg.eclipse.higgins.idas.registry.contextid.ContextIdFactory

public class ContextIdFactory
extends Object

This is a helper class that can be used to obtain an IContextId in the following ways: 1) From a local file (an XRDS document) 2) From a XRI (which yields an XRDS document, using XRI resolution) 3) From a URL (which yields an XRDS document, using Yadis discovery) 4) From a stream (from which an XRDS document is read) 5) From the ContextId list that was passed to IdASRegistry using the Configuration API. 6) From a string, in which case the following will be tried in order: 1), 2), 3), 5) In any case, the ContextId contains everything needed to instantiate a context. This is: - One or more context types (used by IdASRegistry to find a suitable context factory). - Context configuration. - In the case of XRDS, optional URI(s) of the service endpoint that was used for the ContextId.

Author:
msabadello at parityinc dot net

Constructor Summary
ContextIdFactory()
           
 
Method Summary
static org.eclipse.higgins.idas.api.IContextId fromConfiguration(String contextId)
           
static org.eclipse.higgins.idas.api.IContextId fromFile(File file)
           
static org.eclipse.higgins.idas.api.IContextId fromFile(String string)
           
static org.eclipse.higgins.idas.api.IContextId fromStream(InputStream stream)
           
static org.eclipse.higgins.idas.api.IContextId fromString(String string)
           
static org.eclipse.higgins.idas.api.IContextId fromUrl(String string)
           
static org.eclipse.higgins.idas.api.IContextId fromUrl(URL url)
           
static org.eclipse.higgins.idas.api.IContextId fromXRI(String string)
           
static org.eclipse.higgins.idas.api.IContextId fromXRI(org.openxri.XRI xri)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContextIdFactory

public ContextIdFactory()
Method Detail

fromString

public static org.eclipse.higgins.idas.api.IContextId fromString(String string)
                                                          throws org.eclipse.higgins.idas.api.IdASException
Throws:
org.eclipse.higgins.idas.api.IdASException

fromConfiguration

public static org.eclipse.higgins.idas.api.IContextId fromConfiguration(String contextId)
                                                                 throws org.eclipse.higgins.idas.api.IdASException
Throws:
org.eclipse.higgins.idas.api.IdASException

fromFile

public static org.eclipse.higgins.idas.api.IContextId fromFile(File file)
                                                        throws org.eclipse.higgins.idas.api.IdASException
Throws:
org.eclipse.higgins.idas.api.IdASException

fromFile

public static org.eclipse.higgins.idas.api.IContextId fromFile(String string)
                                                        throws org.eclipse.higgins.idas.api.IdASException
Throws:
org.eclipse.higgins.idas.api.IdASException

fromXRI

public static org.eclipse.higgins.idas.api.IContextId fromXRI(org.openxri.XRI xri)
                                                       throws org.eclipse.higgins.idas.api.IdASException
Throws:
org.eclipse.higgins.idas.api.IdASException

fromXRI

public static org.eclipse.higgins.idas.api.IContextId fromXRI(String string)
                                                       throws org.eclipse.higgins.idas.api.IdASException
Throws:
org.eclipse.higgins.idas.api.IdASException

fromUrl

public static org.eclipse.higgins.idas.api.IContextId fromUrl(URL url)
                                                       throws org.eclipse.higgins.idas.api.IdASException
Throws:
org.eclipse.higgins.idas.api.IdASException

fromUrl

public static org.eclipse.higgins.idas.api.IContextId fromUrl(String string)
                                                       throws org.eclipse.higgins.idas.api.IdASException
Throws:
org.eclipse.higgins.idas.api.IdASException

fromStream

public static org.eclipse.higgins.idas.api.IContextId fromStream(InputStream stream)
                                                          throws org.eclipse.higgins.idas.api.IdASException
Throws:
org.eclipse.higgins.idas.api.IdASException