org.objectweb.dsrg.sofa.repository
Class SofaURIFactory

java.lang.Object
  extended by org.objectweb.dsrg.sofa.repository.SofaURIFactory

public class SofaURIFactory
extends java.lang.Object

Factory for creating SofaURI. As an instance is EMF URI implementation returned with some parts predefined. It should be used for creating all SofaURI instances.


Field Summary
static java.lang.String ERROR_NO_VERSION
          This message is sent by createURIWithAuthority(java.lang.String, java.lang.String, java.lang.String) in IllegalArgumentException when no version is set.
static java.lang.String TAG
          Parameter used to determine tagged version of content of repository
static java.lang.String TRAILING_SLASH
          This must be set into URI's fragment, otherwise XMLResource will not find any object by our URIs.
static java.lang.String URI_DATA_AUTHORITY
          Authority used for data URIs (targets are data).
static java.lang.String URI_INTERNAL_AUTHORITY
          Authority used for URIs of internal objects of Sofa repository.
static java.lang.String URI_META_AUTHORITY
          Authority used for meta URIs (targets are metadata).
static java.lang.String VERSION
          Parameter used to determine version of content of repository
 
Constructor Summary
SofaURIFactory()
           
 
Method Summary
static org.eclipse.emf.common.util.URI createDataURI(java.lang.String name, java.lang.String version)
          Static method used to create instance of SofaURI which uniquely represents DATA content of repository.
static org.eclipse.emf.common.util.URI createDataURI(java.lang.String name, java.lang.String version, java.lang.String tag)
          Static method used to create instance of SofaURI which uniquely represents DATA content of repository.
static org.eclipse.emf.common.util.URI createDataURI(java.lang.String name, Version version)
          Static method used to create instance of SofaURI which uniquely represents DATA content of repository.
static org.eclipse.emf.common.util.URI createDataURI(org.eclipse.emf.common.util.URI metaObject, DataStreamType dataStreamType)
          Static method used to create instance of SofaURI which uniquely represents DATA content of repository attached to meta object specified by metaObject URI.
static org.eclipse.emf.common.util.URI createDataURIWithQuery(org.eclipse.emf.common.util.URI metaObject, DataStreamType dataStreamType, java.util.Map<java.lang.String,java.lang.String> params)
          Static method used to create instance of SofaURI which uniquely represents DATA content of repository attached to meta object specified by metaObject URI and by query string which is constructed from params map.
static org.eclipse.emf.common.util.URI createURI(java.lang.String name, java.lang.String version)
          Static method used to create instance of SofaURI which uniquely represents META content of repository.
static org.eclipse.emf.common.util.URI createURI(java.lang.String name, java.lang.String version, java.lang.String tag)
          Static method used to create instance of SofaURI which uniquely represents META content of repository.
static org.eclipse.emf.common.util.URI createURI(java.lang.String name, Version version)
          Static method used to create instance of SofaURI which uniquely represents META content of repository.
static org.eclipse.emf.common.util.URI createURIWithAuthority(java.lang.String name, java.lang.String version, java.lang.String authority)
          Basic static method which can create all SofaURIs (only exception is URI of RepositoryData object, for this URI getRepositoryDataURI() must be used).
static org.eclipse.emf.common.util.URI createURIWithAuthority(java.lang.String name, java.lang.String version, java.lang.String tag, java.lang.String authority)
          Basic static method which can create all SofaURIs (only exception is URI of RepositoryData object, for this URI getRepositoryDataURI() must be used).
static org.eclipse.emf.common.util.URI getRepositoryDataURI()
          Returns static URI of RepositoryData object.
static org.eclipse.emf.common.util.URI getRepositoryInfoURI()
          Returns static URI of RepositoryInfo object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

public static final java.lang.String VERSION
Parameter used to determine version of content of repository

See Also:
Constant Field Values

TAG

public static final java.lang.String TAG
Parameter used to determine tagged version of content of repository

See Also:
Constant Field Values

ERROR_NO_VERSION

public static final java.lang.String ERROR_NO_VERSION
This message is sent by createURIWithAuthority(java.lang.String, java.lang.String, java.lang.String) in IllegalArgumentException when no version is set.

See Also:
Constant Field Values

URI_META_AUTHORITY

public static final java.lang.String URI_META_AUTHORITY
Authority used for meta URIs (targets are metadata).

See Also:
Constant Field Values

URI_DATA_AUTHORITY

public static final java.lang.String URI_DATA_AUTHORITY
Authority used for data URIs (targets are data).

See Also:
Constant Field Values

URI_INTERNAL_AUTHORITY

public static final java.lang.String URI_INTERNAL_AUTHORITY
Authority used for URIs of internal objects of Sofa repository.

See Also:
Constant Field Values

TRAILING_SLASH

public static final java.lang.String TRAILING_SLASH
This must be set into URI's fragment, otherwise XMLResource will not find any object by our URIs.

See Also:
Constant Field Values
Constructor Detail

SofaURIFactory

public SofaURIFactory()
Method Detail

createURI

public static org.eclipse.emf.common.util.URI createURI(java.lang.String name,
                                                        Version version)
Static method used to create instance of SofaURI which uniquely represents META content of repository.

Parameters:
name - hierarchical name of repository content in dot notation
version - version of repository content
Returns:
instance of EMF URI representing SofaURI

createURI

public static org.eclipse.emf.common.util.URI createURI(java.lang.String name,
                                                        java.lang.String version,
                                                        java.lang.String tag)
Static method used to create instance of SofaURI which uniquely represents META content of repository.

Parameters:
name - hierarchical name of repository content in dot notation
version - version of repository content
tag - tag of repository content
Returns:
instance of EMF URI representing SofaURI

createURI

public static org.eclipse.emf.common.util.URI createURI(java.lang.String name,
                                                        java.lang.String version)
Static method used to create instance of SofaURI which uniquely represents META content of repository.

Parameters:
name - hierarchical name of repository content in dot notation
version - version of repository content
Returns:
instance of EMF URI representing SofaURI

createDataURI

public static org.eclipse.emf.common.util.URI createDataURI(java.lang.String name,
                                                            Version version)
Static method used to create instance of SofaURI which uniquely represents DATA content of repository.

Parameters:
name - hierarchical name of repository content in dot notation
version - version of repository content
Returns:
instance of EMF URI representing SofaURI

createDataURI

public static org.eclipse.emf.common.util.URI createDataURI(java.lang.String name,
                                                            java.lang.String version)
Static method used to create instance of SofaURI which uniquely represents DATA content of repository.

Parameters:
name - hierarchical name of repository content in dot notation
version - version of repository content
Returns:
instance of EMF URI representing SofaURI

createDataURI

public static org.eclipse.emf.common.util.URI createDataURI(java.lang.String name,
                                                            java.lang.String version,
                                                            java.lang.String tag)
Static method used to create instance of SofaURI which uniquely represents DATA content of repository.

Parameters:
name - hierarchical name of repository content in dot notation
version - version of repository content
tag - tag of repository content
Returns:
instance of EMF URI representing SofaURI

createDataURI

public static org.eclipse.emf.common.util.URI createDataURI(org.eclipse.emf.common.util.URI metaObject,
                                                            DataStreamType dataStreamType)
Static method used to create instance of SofaURI which uniquely represents DATA content of repository attached to meta object specified by metaObject URI. Internally used by CodeBundle.

Parameters:
metaObject - URI to meta object containing info about repository content
dataStreamType - stream type
Returns:
instance of EMF URI representing SofaURI

createDataURIWithQuery

public static org.eclipse.emf.common.util.URI createDataURIWithQuery(org.eclipse.emf.common.util.URI metaObject,
                                                                     DataStreamType dataStreamType,
                                                                     java.util.Map<java.lang.String,java.lang.String> params)
Static method used to create instance of SofaURI which uniquely represents DATA content of repository attached to meta object specified by metaObject URI and by query string which is constructed from params map. Internally used by CodeBundle.

Parameters:
metaObject - URI to meta object containing info about repository content
dataStreamType - stream type
params - map of pairs paramName and paramValue
Returns:
instance of EMF URI representing SofaURI

getRepositoryDataURI

public static org.eclipse.emf.common.util.URI getRepositoryDataURI()
Returns static URI of RepositoryData object. Should be used only internally. See RepositoryQuery.getRepositoryDataObject().

Returns:
SofaURI

getRepositoryInfoURI

public static org.eclipse.emf.common.util.URI getRepositoryInfoURI()
Returns static URI of RepositoryInfo object. Should be used only internally. See RepositoryQuery.getRepositoryInfoObject().

Returns:
URI to repository info object

createURIWithAuthority

public static org.eclipse.emf.common.util.URI createURIWithAuthority(java.lang.String name,
                                                                     java.lang.String version,
                                                                     java.lang.String authority)
Basic static method which can create all SofaURIs (only exception is URI of RepositoryData object, for this URI getRepositoryDataURI() must be used). This method should be used only internally.

Parameters:
name - hierarchical name of repository content in dot notation
version - string representation of version of repository content
authority - basically URI_META_AUTHORITY or URI_DATA_AUTHORITY
Returns:
instance of EMF URI representing SofaURI
See Also:
createURI(java.lang.String, org.objectweb.dsrg.sofa.repository.model.Version), getRepositoryDataURI()

createURIWithAuthority

public static org.eclipse.emf.common.util.URI createURIWithAuthority(java.lang.String name,
                                                                     java.lang.String version,
                                                                     java.lang.String tag,
                                                                     java.lang.String authority)
Basic static method which can create all SofaURIs (only exception is URI of RepositoryData object, for this URI getRepositoryDataURI() must be used). This method should be used only internally.

Parameters:
name - hierarchical name of repository content in dot notation
version - string representation of version of repository content
tag - string representation of tag of repository content
authority - basically URI_META_AUTHORITY or URI_DATA_AUTHORITY
Returns:
instance of EMF URI representing SofaURI
See Also:
createURI(java.lang.String, org.objectweb.dsrg.sofa.repository.model.Version), getRepositoryDataURI()