org.eclipse.higgins.idas.registry.contextid
Class ContextIdFactory
java.lang.Object
org.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
ContextIdFactory
public ContextIdFactory()
fromString
public static org.eclipse.higgins.idas.api.IContextId fromString(String contextIDString)
throws org.eclipse.higgins.idas.api.IdASException
- Throws:
org.eclipse.higgins.idas.api.IdASException
fromString
public static org.eclipse.higgins.idas.api.IContextId fromString(String contextIDString,
IdASRegistry registry)
throws org.eclipse.higgins.idas.api.IdASException
- Parameters:
contextIDString - registry - May be null
- Returns:
-
- 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
fromConfiguration
public static org.eclipse.higgins.idas.api.IContextId fromConfiguration(String contextId,
IdASRegistry registry)
throws org.eclipse.higgins.idas.api.IdASException
- Parameters:
contextId - registry - May be null
- Returns:
-
- 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