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 in IllegalArgumentException when no version is set.
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).
 
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, 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, 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 SofaURIFactory.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

ERROR_NO_VERSION

public static final java.lang.String ERROR_NO_VERSION
This message is sent by createURIWithAuthority 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)
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(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:
name - hierarchical name of repository content in dot notation
version - version of repository content
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:
name - hierarchical name of repository content in dot notation
version - version of repository content
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.getRepositoryDara.

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.getRepositoryInfo.

Returns:

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 SofaURIFactory.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, getRepositoryDataURI