org.eclipse.emf.cdo.client
Interface CDOResource

All Superinterfaces:
org.eclipse.emf.common.notify.Notifier, org.eclipse.emf.ecore.resource.Resource
All Known Implementing Classes:
CDOResourceImpl

public interface CDOResource
extends org.eclipse.emf.ecore.resource.Resource

A special Resource that associates a CDO ResourceManager to the contained EObject instances.

There are two possible URI formats for a CDOResource that can be used interchangeably:

  1. The scheme is cdo and the opaque part of the URI contains an arbitrary, but absolute and unique path, for example cdo:///com/foo/bar.xyz
  2. The scheme is cdo and the opaque part of the URI contains a flat resource identifier (RID), for example cdo://4711
The first format is usually used by clients when creating or loading a CDOResource. The second format is used internally by CDO, but can also be used by additional tooling. The RID of a CDOResource is assigned by the CDO server, is guaranteed to be unique and will never change.

This interface is not expected to be implemented by clients.

See Also:
CDOPersistable, ResourceManager

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.emf.ecore.resource.Resource
org.eclipse.emf.ecore.resource.Resource.Diagnostic, org.eclipse.emf.ecore.resource.Resource.Factory, org.eclipse.emf.ecore.resource.Resource.Internal, org.eclipse.emf.ecore.resource.Resource.IOWrappedException
 
Field Summary
 
Fields inherited from interface org.eclipse.emf.ecore.resource.Resource
OPTION_CIPHER, OPTION_ZIP, RESOURCE__CONTENTS, RESOURCE__ERRORS, RESOURCE__IS_LOADED, RESOURCE__IS_MODIFIED, RESOURCE__IS_TRACKING_MODIFICATION, RESOURCE__RESOURCE_SET, RESOURCE__URI, RESOURCE__WARNINGS
 
Method Summary
 ResourceInfo getInfo()
          Returns the ResourceInfo of this CDOResource.
 java.lang.String getPath()
          Returns the absolute path of this CDOResource.
 ResourceManager getResourceManager()
          Returns the ResourceManager associated with this CDOResource.
 int getRID()
          Returns the RID of this CDOResource.
 boolean isExisting()
          Determines if this CDOResource does already exist in the repository.
 void preLoad()
          Loads all the contained objects from the repository.
 org.eclipse.emf.common.util.EList queryCrossReferences(org.eclipse.emf.ecore.EObject object)
          TODO Document method queryCrossReferences The queryCrossReferences method.
 java.util.Set queryExtent(org.eclipse.emf.ecore.EClass context)
          Convenience method to query polymorphic extents, returns the same result as queryExtent(context, false).
 java.util.Set queryExtent(org.eclipse.emf.ecore.EClass context, boolean exactMatch)
          Sends a request to the CDO server to query all CDOPersistable instances in this CDOResource that are instances of the context EClass or of any of its subclasses.
 void setExisting(boolean existing)
          For internal use only.
 void setPath(java.lang.String path)
          For internal use only.
 
Methods inherited from interface org.eclipse.emf.ecore.resource.Resource
getAllContents, getContents, getEObject, getErrors, getResourceSet, getURI, getURIFragment, getWarnings, isLoaded, isModified, isTrackingModification, load, load, save, save, setModified, setTrackingModification, setURI, unload
 
Methods inherited from interface org.eclipse.emf.common.notify.Notifier
eAdapters, eDeliver, eNotify, eSetDeliver
 

Method Detail

getResourceManager

ResourceManager getResourceManager()
Returns the ResourceManager associated with this CDOResource.

Returns:
The ResourceManager associated with this CDOResource.

isExisting

boolean isExisting()
Determines if this CDOResource does already exist in the repository.

Returns:
true if this CDOResource exists in the repository, false otherwise.

setExisting

void setExisting(boolean existing)
For internal use only.


getPath

java.lang.String getPath()
Returns the absolute path of this CDOResource.

Returns:
The absolute path of this CDOResource.

getRID

int getRID()
Returns the RID of this CDOResource.

Returns:
The RID of this CDOResource.

getInfo

ResourceInfo getInfo()
Returns the ResourceInfo of this CDOResource.

Returns:
The ResourceInfo of this CDOResource.

setPath

void setPath(java.lang.String path)
For internal use only.


queryExtent

java.util.Set queryExtent(org.eclipse.emf.ecore.EClass context)
Convenience method to query polymorphic extents, returns the same result as queryExtent(context, false).

Parameters:
context - The EClass that all the objects to be queried shall be castable to.
Returns:
A Set of all the objects in this CDOResource that can safely be casted to the context EClass.
See Also:
queryExtent(EClass, boolean), ResourceManager.queryExtent(EClass)

queryExtent

java.util.Set queryExtent(org.eclipse.emf.ecore.EClass context,
                          boolean exactMatch)
Sends a request to the CDO server to query all CDOPersistable instances in this CDOResource that are instances of the context EClass or of any of its subclasses.

The CDOPersistable instances do not have to be already loaded in order to be found by this remote query. If they had not been loaded before, CDO will create proxies for them and lazily load them while iterating over the returned Set. The remote query is performed on each call to this method, no caching will occur.

Parameters:
context - The EClass that all the objects to be queried shall be castable to.
exactMatch - Pass true to exclude objects from the result that are instances of subclasses of the context EClass, false otherwise.
Returns:
A Set of all the objects in this CDOResource that can safely be casted to the context EClass.
See Also:
ResourceManager.queryExtent(EClass, boolean)

queryCrossReferences

org.eclipse.emf.common.util.EList queryCrossReferences(org.eclipse.emf.ecore.EObject object)
TODO Document method queryCrossReferences

The queryCrossReferences method.

Parameters:
object -
Returns:

preLoad

void preLoad()
Loads all the contained objects from the repository.


Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
All Rights Reserved.