org.objectweb.dsrg.sofa.repository
Class RepositoryQuery

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

public class RepositoryQuery
extends java.lang.Object

This object is responsible for complete querying of objects from repository. There is no another suitable method or object for retrieving metadata from repository.


Constructor Summary
RepositoryQuery(org.eclipse.emf.ecore.resource.ResourceSet rs)
          Standard constructor.
 
Method Summary
 java.io.OutputStream getData(org.eclipse.emf.common.util.URI uri)
          Directly opens OutputStream from RepositoryServer for specified uri and data are not deserialized by EMF.
 org.eclipse.emf.ecore.EObject getEObject(org.eclipse.emf.common.util.URI uri)
          Fundamental method for quering objects by URI.
 org.eclipse.emf.ecore.EObject getEObject(org.eclipse.emf.common.util.URI uri, boolean forceUnload)
          Fundamental method for querying objects by URI.
 RepositoryData getRepositoryDataObject()
          Loads RepositoryData object from repository - DON'T CACHE RETRUNED OBJECT - Always use this method to get RepsitoryData.
 RepositoryInfo getRepositoryInfoObject()
          Loads RepositoryInfo object from repository.
 org.eclipse.emf.ecore.EObject resolveProxy(org.eclipse.emf.ecore.EObject eo)
          If you use forceUnload parameter on the method getEObject(org.eclipse.emf.common.util.URI), you can then hold only proxy objects and this method returns resolved full object instance or proxy object, if it is not able to resolve it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RepositoryQuery

public RepositoryQuery(org.eclipse.emf.ecore.resource.ResourceSet rs)
Standard constructor. Used internaly by RepositoryAgent.

Parameters:
rs - From this ResourceSet objects are queried.
Method Detail

getEObject

public org.eclipse.emf.ecore.EObject getEObject(org.eclipse.emf.common.util.URI uri)
Fundamental method for quering objects by URI. If EObject was already read by this RepositoryAgent, no refresh is done and old object is served to the client.

Parameters:
uri - SofaURI, which identifies object.
Returns:
EObject instance

getEObject

public org.eclipse.emf.ecore.EObject getEObject(org.eclipse.emf.common.util.URI uri,
                                                boolean forceUnload)
Fundamental method for querying objects by URI.

Parameters:
uri - SofaURI, which identifies object.
forceUnload - If set to true, already read object is ALWAYS unloaded and reloaded from repository server, this can be suitable for developers
Returns:
object identified by given uri

getRepositoryDataObject

public RepositoryData getRepositoryDataObject()
Loads RepositoryData object from repository - DON'T CACHE RETRUNED OBJECT - Always use this method to get RepsitoryData. This object have special SofaURI.

Returns:
RepositoryData object

getRepositoryInfoObject

public RepositoryInfo getRepositoryInfoObject()
Loads RepositoryInfo object from repository. This object have special SofaURI.

Returns:
RepositoryInfo object

getData

public java.io.OutputStream getData(org.eclipse.emf.common.util.URI uri)
                             throws java.io.IOException
Directly opens OutputStream from RepositoryServer for specified uri and data are not deserialized by EMF.

Parameters:
uri - Destination SofaURI
Returns:
OutputStream to read data from server
Throws:
java.io.IOException

resolveProxy

public org.eclipse.emf.ecore.EObject resolveProxy(org.eclipse.emf.ecore.EObject eo)
If you use forceUnload parameter on the method getEObject(org.eclipse.emf.common.util.URI), you can then hold only proxy objects and this method returns resolved full object instance or proxy object, if it is not able to resolve it.

Parameters:
eo - Proxy object
Returns:
Full object representation