org.eclipse.emf.cdo.transaction
Class CDOPushTransaction

java.lang.Object
  extended by org.eclipse.net4j.util.event.Notifier
      extended by org.eclipse.emf.cdo.transaction.CDOPushTransaction
All Implemented Interfaces:
IAdaptable, CDOBranchPoint, CDOCommonTransaction, CDOCommonView, CDOChangeSetDataProvider, CDOCommitHistory.Provider<CDOObject,CDOObjectHistory>, CDOLockOwner, CDORevisionProvider, CDOTimeProvider, CDOTransaction, CDOUserTransaction, CDOUpdatable, CDOView, Closeable, IContainer<CDOResourceNode>, INotifier, IOptionsContainer

public class CDOPushTransaction
extends Notifier
implements CDOTransaction

A transaction that persists changes to the object graph locally on commit and can later load these changes and push them to the repository.

Since:
3.0
No Extend
This interface is not intended to be extended by clients.
No Instantiate
This class is not intended to be instantiated by clients.

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.emf.cdo.transaction.CDOTransaction
CDOTransaction.Options
 
Nested classes/interfaces inherited from interface org.eclipse.net4j.util.container.IContainer
IContainer.Modifiable<E>
 
Field Summary
 
Fields inherited from interface org.eclipse.emf.cdo.util.CDOUpdatable
NO_TIMEOUT
 
Fields inherited from interface org.eclipse.emf.cdo.common.branch.CDOBranchPoint
INVALID_DATE, UNSPECIFIED_DATE
 
Constructor Summary
CDOPushTransaction(CDOTransaction delegate)
           
CDOPushTransaction(CDOTransaction delegate, File file)
           
CDOPushTransaction(CDOTransaction delegate, File file, boolean reconstructSavepoints)
           
 
Method Summary
 void addListener(IListener listener)
           
 void addObjectHandler(CDOObjectHandler handler)
           
 void addTransactionHandler(CDOTransactionHandlerBase handler)
           
 void close()
           
 CDOCommitInfo commit()
          Same as commit(null).
 CDOCommitInfo commit(IProgressMonitor progressMonitor)
          Commits the modifications of this transaction to the repository and returns a commit info object if successful.
 CDOChangeSetData compareRevisions(CDOBranchPoint source)
           
 CDOBinaryResource createBinaryResource(String path)
           
 CDOQuery createQuery(String language, String queryString)
          Same as createQuery(language, queryString, null).
 CDOQuery createQuery(String language, String queryString, boolean considerDirtyState)
           
 CDOQuery createQuery(String language, String queryString, Object context)
           
 CDOQuery createQuery(String language, String queryString, Object context, boolean considerDirtyState)
           
 CDOResource createResource(String path)
           
 CDOResourceFolder createResourceFolder(String path)
           
static File createTempFile(CDOTransaction transaction)
           
 CDOTextResource createTextResource(String path)
           
 void disableDurableLocking(boolean releaseLocks)
          Disables the storage of all information that's needed to reopen this view at a later point in time.
 String enableDurableLocking()
          Enables the storage of all information that's needed to reopen this view at a later point in time.
 String enableDurableLocking(boolean enable)
          Deprecated. Use enableDurableLocking() instead or disableDurableLocking(boolean), respectively.
 CDOSavepoint[] exportChanges(OutputStream out)
           
 Object getAdapter(Class adapter)
           
 CDOBinaryResource getBinaryResource(String path)
           
 CDOBranch getBranch()
          Returns the branch of this branch point, or null if this branch point is the base of the main branch.
 CDOChangeSetData getChangeSetData()
           
 String getCommitComment()
          Returns the comment to be used in the next commit operation.
 Set<? extends EObject> getCommittables()
           
 Set<CDOObject> getConflicts()
           
 CDOTransaction getDelegate()
           
 Map<CDOID,CDOObject> getDetachedObjects()
           
 Map<CDOID,CDOObject> getDirtyObjects()
           
 String getDurableLockingID()
           
 CDOResourceNode[] getElements()
           
 File getFile()
           
 CDOSavepoint getFirstSavepoint()
           
 CDOCommitHistory getHistory()
           
 CDOObjectHistory getHistory(CDOObject object)
           
 long getLastCommitTime()
           
 CDOSavepoint getLastSavepoint()
           
 long getLastUpdateTime()
          Returns the time stamp of the last commit operation.
 IListener[] getListeners()
           
 Map<CDOID,CDOObject> getNewObjects()
           
 CDOObject getObject(CDOID id)
          Returns the object for the given CDOID.
 CDOObject getObject(CDOID id, boolean loadOnDemand)
          Returns the object for the given CDOID.
<T extends EObject>
T
getObject(T objectFromDifferentView)
          Takes an object from a (possibly) different view and contextifies it for the usage with this view.
 CDOObjectHandler[] getObjectHandlers()
           
 CDOBinaryResource getOrCreateBinaryResource(String path)
           
 CDOResource getOrCreateResource(String path)
           
 CDOResourceFolder getOrCreateResourceFolder(String path)
           
 CDOTextResource getOrCreateTextResource(String path)
           
 CDOResource getResource(String path)
          Same as getResource(String, true).
 CDOResource getResource(String path, boolean loadOnDemand)
           
 CDOResourceFolder getResourceFolder(String path)
           
 CDOResourceNode getResourceNode(String path)
          Returns the resource node with the given path.
 ResourceSet getResourceSet()
          Returns the resource set this view is associated with.
 CDORevision getRevision(CDOID id)
           
 Map<CDOID,CDORevisionDelta> getRevisionDeltas()
           
 CDOResource getRootResource()
          Returns the root resource of the repository.
 CDOSession getSession()
          Returns the session this view was opened by.
 int getSessionID()
           
 CDOTextResource getTextResource(String path)
           
 long getTimeStamp()
          Returns the time stamp of this branch point, or the fixed special time stamp unspecified if this branch point marks the head of a branch.
 CDOTransactionHandler[] getTransactionHandlers()
           
 CDOTransactionHandler1[] getTransactionHandlers1()
           
 CDOTransactionHandler2[] getTransactionHandlers2()
           
 URIHandler getURIHandler()
           
 int getViewID()
           
 CDOViewSet getViewSet()
          Returns the view set this view is associated with.
 boolean hasConflict()
          Returns true if this transaction contains local modifications that are conflicting with remote modifications, false otherwise.
 boolean hasListeners()
           
 boolean hasResource(String path)
          Returns true if a resource with the given path exists in the repository, false.
 CDOSavepoint[] importChanges(InputStream in, boolean reconstructSavepoints)
           
 boolean isClosed()
           
 boolean isDirty()
          Returns true if this transaction is not closed and contains uncommitted changes, false otherwise.
 boolean isDurableView()
           
 boolean isEmpty()
           
 boolean isInvalidationRunnerActive()
           
 boolean isLegacyModeEnabled()
          Deprecated. 
 boolean isObjectRegistered(CDOID id)
          Returns true if an object with the given id is currently registered in this view, false otherwise.
 boolean isReadOnly()
           
 void lockObjects(Collection<? extends CDOObject> objects, IRWLockManager.LockType lockType, long timeout)
          Locks the given objects.
 void lockObjects(Collection<? extends CDOObject> objects, IRWLockManager.LockType lockType, long timeout, boolean recursive)
           
 CDOChangeSetData merge(CDOBranchPoint source, CDOBranchPoint sourceBase, CDOMerger merger)
           
 CDOChangeSetData merge(CDOBranchPoint source, CDOMerger merger)
           
 CDOTransaction.Options options()
          Returns the options of this view.
 void push()
           
 void push(IProgressMonitor progressMonitor)
           
 List<CDOResourceNode> queryResources(CDOResourceFolder folder, String name, boolean exactMatch)
          Returns a list of the resources in the given folder with a name equal to or starting with the value of the name parameter.
 CloseableIterator<CDOResourceNode> queryResourcesAsync(CDOResourceFolder folder, String name, boolean exactMatch)
          Returns an iterator over the resources in the given folder with a name equal to or starting with the value of the name parameter.
 List<CDOObjectReference> queryXRefs(CDOObject targetObject, EReference... sourceReferences)
          Returns a list of object references that represent the cross references to the specified target object.
 List<CDOObjectReference> queryXRefs(Set<CDOObject> targetObjects, EReference... sourceReferences)
          Returns a list of object references that represent the cross references to the specified target objects.
 CloseableIterator<CDOObjectReference> queryXRefsAsync(Set<CDOObject> targetObjects, EReference... sourceReferences)
          Returns an iterator over the object references that represent the cross references to the specified target objects.
 int reload(CDOObject... objects)
          Reloads the given objects from the repository.
 void removeListener(IListener listener)
           
 void removeObjectHandler(CDOObjectHandler handler)
           
 void removeTransactionHandler(CDOTransactionHandlerBase handler)
           
 void rollback()
           
 boolean setBranch(CDOBranch branch)
          Same as calling setBranchPoint(branch, getTimeStamp()).
 boolean setBranchPoint(CDOBranch branch, long timeStamp)
          Sets the branch and the point in (repository) time this view should refer to.
 boolean setBranchPoint(CDOBranchPoint branchPoint)
          Same as calling setBranchPoint(branchPoint.getBranch(), branchPoint.getTimeStamp()).
 void setCommitComment(String comment)
          Sets the comment to be used in the next commit operation.
 void setCommittables(Set<? extends EObject> committables)
           
protected  void setDirty(boolean dirty)
           
 void setResourcePathCache(Map<String,CDOID> resourcePathCache)
          Sets the new map to be used as a cache for various get*Resource*(String path) methods.
 CDOSavepoint setSavepoint()
          Creates a save point in the CDOTransaction that can be used to roll back a part of the transaction Save points do not involve the server side, everything is done on the client side.
 boolean setTimeStamp(long timeStamp)
          Same as calling setBranchPoint(getBranch(), timeStamp).
 String toString()
           
 void unlockObjects()
          Unlocks all locked objects of this view.
 void unlockObjects(Collection<? extends CDOObject> objects, IRWLockManager.LockType lockType)
          Unlocks the given locked objects of this view.
 void unlockObjects(Collection<? extends CDOObject> objects, IRWLockManager.LockType lockType, boolean recursive)
           
 void waitForUpdate(long updateTime)
          Blocks the calling thread until a commit operation with the given time stamp (or higher) has occured.
 boolean waitForUpdate(long updateTime, long timeoutMillis)
          Blocks the calling thread until a commit operation with the given time stamp (or higher) has occured or the given timeout has expired.
 
Methods inherited from class org.eclipse.net4j.util.event.Notifier
fireEvent, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getNotificationService, lastListenerRemoved
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CDOPushTransaction

public CDOPushTransaction(CDOTransaction delegate)
                   throws IOException
Throws:
IOException

CDOPushTransaction

public CDOPushTransaction(CDOTransaction delegate,
                          File file)
                   throws IOException
Throws:
IOException

CDOPushTransaction

public CDOPushTransaction(CDOTransaction delegate,
                          File file,
                          boolean reconstructSavepoints)
                   throws IOException
Throws:
IOException
Method Detail

getDelegate

public CDOTransaction getDelegate()

getFile

public File getFile()

isDirty

public boolean isDirty()
Description copied from interface: CDOTransaction
Returns true if this transaction is not closed and contains uncommitted changes, false otherwise.

Specified by:
isDirty in interface CDOTransaction
Specified by:
isDirty in interface CDOView
See Also:
CDOTransaction.isDirty()

setDirty

protected void setDirty(boolean dirty)

commit

public CDOCommitInfo commit()
                     throws CommitException
Description copied from interface: CDOUserTransaction
Same as commit(null).

Specified by:
commit in interface CDOUserTransaction
Throws:
CommitException

commit

public CDOCommitInfo commit(IProgressMonitor progressMonitor)
                     throws CommitException
Description copied from interface: CDOUserTransaction
Commits the modifications of this transaction to the repository and returns a commit info object if successful.

Various kinds of problems can cause the commit to fail and not all of them can be avoided by acquiring pessimistic locks on the modified objects. In particular you must expect and handle containment cycle exceptions. The following example shows how write robust transactions:

    CDOTransaction transaction = null;

    try
    {
      transaction = session.openTransaction();

      for (;;)
      {
        try
        {
          synchronized (transaction)
          {
            CDOResource resource = transaction.getResource("/stock/resource1");

            // Modify the model here...

            transaction.commit();
            break;
          }
        }
        catch (ConcurrentAccessException ex)
        {
          transaction.rollback();
        }
        catch (CommitException ex)
        {
          throw ex.wrap();
        }
      }
    }
    finally
    {
      if (transaction != null)
      {
        transaction.close();
      }
    }
 
Note that the transaction stays functional after a any call to the commit() methods. If the transaction is not closed after a commit it can be used to apply additional modifications to the model.

Specified by:
commit in interface CDOUserTransaction
Throws:
CommitException

rollback

public void rollback()
Specified by:
rollback in interface CDOUserTransaction

push

public void push()
          throws CommitException
Throws:
CommitException

push

public void push(IProgressMonitor progressMonitor)
          throws CommitException
Throws:
CommitException

exportChanges

public CDOSavepoint[] exportChanges(OutputStream out)
                             throws IOException
Specified by:
exportChanges in interface CDOTransaction
Throws:
IOException

importChanges

public CDOSavepoint[] importChanges(InputStream in,
                                    boolean reconstructSavepoints)
                             throws IOException
Specified by:
importChanges in interface CDOTransaction
Throws:
IOException

getLastCommitTime

public long getLastCommitTime()
Specified by:
getLastCommitTime in interface CDOTransaction

addListener

public void addListener(IListener listener)
Specified by:
addListener in interface INotifier
Overrides:
addListener in class Notifier

removeListener

public void removeListener(IListener listener)
Specified by:
removeListener in interface INotifier
Overrides:
removeListener in class Notifier

hasListeners

public boolean hasListeners()
Specified by:
hasListeners in interface INotifier
Overrides:
hasListeners in class Notifier

getListeners

public IListener[] getListeners()
Specified by:
getListeners in interface INotifier
Overrides:
getListeners in class Notifier

addObjectHandler

public void addObjectHandler(CDOObjectHandler handler)
Specified by:
addObjectHandler in interface CDOView

addTransactionHandler

public void addTransactionHandler(CDOTransactionHandlerBase handler)
Specified by:
addTransactionHandler in interface CDOTransaction
Since:
4.0

close

public void close()
Specified by:
close in interface Closeable

createQuery

public CDOQuery createQuery(String language,
                            String queryString)
Description copied from interface: CDOView
Same as createQuery(language, queryString, null).

Specified by:
createQuery in interface CDOView
See Also:
CDOView.createQuery(String, String, Object)

createQuery

public CDOQuery createQuery(String language,
                            String queryString,
                            Object context)
Specified by:
createQuery in interface CDOView
Since:
4.0

createQuery

public CDOQuery createQuery(String language,
                            String queryString,
                            boolean considerDirtyState)
Specified by:
createQuery in interface CDOTransaction
Since:
4.0

createQuery

public CDOQuery createQuery(String language,
                            String queryString,
                            Object context,
                            boolean considerDirtyState)
Specified by:
createQuery in interface CDOTransaction
Since:
4.0

createResourceFolder

public CDOResourceFolder createResourceFolder(String path)
Specified by:
createResourceFolder in interface CDOTransaction
Since:
4.0

createResource

public CDOResource createResource(String path)
Specified by:
createResource in interface CDOTransaction
See Also:
ResourceSet.createResource(URI)

isLegacyModeEnabled

@Deprecated
public boolean isLegacyModeEnabled()
Deprecated. 

Specified by:
isLegacyModeEnabled in interface CDOView
See Also:
CDOUtil.setLegacyModeDefault(boolean)

getLastUpdateTime

public long getLastUpdateTime()
Description copied from interface: CDOUpdatable
Returns the time stamp of the last commit operation. May not be accurate if passive updates are disabled.

Specified by:
getLastUpdateTime in interface CDOUpdatable

waitForUpdate

public void waitForUpdate(long updateTime)
Description copied from interface: CDOUpdatable
Blocks the calling thread until a commit operation with the given time stamp (or higher) has occured.

Specified by:
waitForUpdate in interface CDOUpdatable

waitForUpdate

public boolean waitForUpdate(long updateTime,
                             long timeoutMillis)
Description copied from interface: CDOUpdatable
Blocks the calling thread until a commit operation with the given time stamp (or higher) has occured or the given timeout has expired.

Specified by:
waitForUpdate in interface CDOUpdatable
Returns:
true if the specified commit operation has occured within the given timeout period, false otherwise.

getConflicts

public Set<CDOObject> getConflicts()
Specified by:
getConflicts in interface CDOTransaction

getChangeSetData

public CDOChangeSetData getChangeSetData()
Specified by:
getChangeSetData in interface CDOChangeSetDataProvider
Since:
4.0

getDetachedObjects

public Map<CDOID,CDOObject> getDetachedObjects()
Specified by:
getDetachedObjects in interface CDOTransaction

getDirtyObjects

public Map<CDOID,CDOObject> getDirtyObjects()
Specified by:
getDirtyObjects in interface CDOTransaction

getRevision

public CDORevision getRevision(CDOID id)
Specified by:
getRevision in interface CDORevisionProvider
Since:
4.0

getFirstSavepoint

public CDOSavepoint getFirstSavepoint()
Specified by:
getFirstSavepoint in interface CDOTransaction
Since:
4.1

getLastSavepoint

public CDOSavepoint getLastSavepoint()
Specified by:
getLastSavepoint in interface CDOTransaction
Specified by:
getLastSavepoint in interface CDOUserTransaction

isInvalidationRunnerActive

public boolean isInvalidationRunnerActive()
Specified by:
isInvalidationRunnerActive in interface CDOView
Since:
4.0

getNewObjects

public Map<CDOID,CDOObject> getNewObjects()
Specified by:
getNewObjects in interface CDOTransaction

getObject

public CDOObject getObject(CDOID id,
                           boolean loadOnDemand)
Description copied from interface: CDOView
Returns the object for the given CDOID.

Specified by:
getObject in interface CDOView
loadOnDemand - whether to create and load the object, if it doesn't already exist.
Returns:
the object resolved by the CDOID if the id is not null, or null if there isn't one and loadOnDemand is false.

getObject

public CDOObject getObject(CDOID id)
Description copied from interface: CDOView
Returns the object for the given CDOID.

Same as getObject(id, true).

Specified by:
getObject in interface CDOView
See Also:
CDOView.getObject(CDOID, boolean)

getObject

public <T extends EObject> T getObject(T objectFromDifferentView)
Description copied from interface: CDOView
Takes an object from a (possibly) different view and contextifies it for the usage with this view.

Specified by:
getObject in interface CDOView

getObjectHandlers

public CDOObjectHandler[] getObjectHandlers()
Specified by:
getObjectHandlers in interface CDOView

getOrCreateResource

public CDOResource getOrCreateResource(String path)
Specified by:
getOrCreateResource in interface CDOTransaction

getOrCreateResourceFolder

public CDOResourceFolder getOrCreateResourceFolder(String path)
Specified by:
getOrCreateResourceFolder in interface CDOTransaction
Since:
4.0

getResource

public CDOResource getResource(String path,
                               boolean loadOnDemand)
Specified by:
getResource in interface CDOView
See Also:
ResourceSet.getResource(URI, boolean)

getResource

public CDOResource getResource(String path)
Description copied from interface: CDOView
Same as getResource(String, true).

Specified by:
getResource in interface CDOView
See Also:
ResourceSet.getResource(URI, boolean)

getResourceNode

public CDOResourceNode getResourceNode(String path)
Description copied from interface: CDOView
Returns the resource node with the given path.

Specified by:
getResourceNode in interface CDOView
Returns:
never null.

createTextResource

public CDOTextResource createTextResource(String path)
Specified by:
createTextResource in interface CDOTransaction
Since:
4.2

getOrCreateTextResource

public CDOTextResource getOrCreateTextResource(String path)
Specified by:
getOrCreateTextResource in interface CDOTransaction
Since:
4.2

createBinaryResource

public CDOBinaryResource createBinaryResource(String path)
Specified by:
createBinaryResource in interface CDOTransaction
Since:
4.2

getOrCreateBinaryResource

public CDOBinaryResource getOrCreateBinaryResource(String path)
Specified by:
getOrCreateBinaryResource in interface CDOTransaction
Since:
4.2

getTextResource

public CDOTextResource getTextResource(String path)
Specified by:
getTextResource in interface CDOView
Since:
4.2

getBinaryResource

public CDOBinaryResource getBinaryResource(String path)
Specified by:
getBinaryResource in interface CDOView
Since:
4.2

getResourceFolder

public CDOResourceFolder getResourceFolder(String path)
Specified by:
getResourceFolder in interface CDOView
Since:
4.2

setResourcePathCache

public void setResourcePathCache(Map<String,CDOID> resourcePathCache)
Description copied from interface: CDOView
Sets the new map to be used as a cache for various get*Resource*(String path) methods.

Can be used to reset/clear the resource path cache by passing a new HashMap<String, CDOID>(). Smarter maps could implement a LRU eviction policy to limit the map capacity. Passing null disables resource path caching.

The default value is new HashMap<String, CDOID>().

Specified by:
setResourcePathCache in interface CDOView
Since:
4.2
See Also:
CDOView.getResourceNode(String), CDOView.getResource(String), CDOView.getResource(String, boolean), CDOView.getBinaryResource(String), CDOView.getTextResource(String), CDOView.getResourceFolder(String), CDOView.hasResource(String)

getResourceSet

public ResourceSet getResourceSet()
Description copied from interface: CDOView
Returns the resource set this view is associated with.

Same as calling getViewSet().getResourceSet().

Specified by:
getResourceSet in interface CDOView
See Also:
CDOViewSet.getResourceSet()

getRevisionDeltas

public Map<CDOID,CDORevisionDelta> getRevisionDeltas()
Specified by:
getRevisionDeltas in interface CDOTransaction

getRootResource

public CDOResource getRootResource()
Description copied from interface: CDOView
Returns the root resource of the repository.

The root resource is a special resource with only CDOResourceNodes in its contents list. You can use it as the main entry into the new resource and folder structure.

Specified by:
getRootResource in interface CDOView

getSession

public CDOSession getSession()
Description copied from interface: CDOView
Returns the session this view was opened by.

Specified by:
getSession in interface CDOCommonView
Specified by:
getSession in interface CDOView
Returns:
The session this view was opened by, or null if this view is closed.
See Also:
Closeable.close(), Closeable.isClosed(), CDOViewContainer.openView(), CDOTransactionContainer.openTransaction()

getTimeStamp

public long getTimeStamp()
Description copied from interface: CDOBranchPoint
Returns the time stamp of this branch point, or the fixed special time stamp unspecified if this branch point marks the head of a branch.

Specified by:
getTimeStamp in interface CDOBranchPoint
Specified by:
getTimeStamp in interface CDOTimeProvider

getDurableLockingID

public String getDurableLockingID()
Specified by:
getDurableLockingID in interface CDOCommonView
Specified by:
getDurableLockingID in interface CDOLockOwner
Since:
4.0

getTransactionHandlers

public CDOTransactionHandler[] getTransactionHandlers()
Specified by:
getTransactionHandlers in interface CDOTransaction

getTransactionHandlers1

public CDOTransactionHandler1[] getTransactionHandlers1()
Specified by:
getTransactionHandlers1 in interface CDOTransaction
Since:
4.0

getTransactionHandlers2

public CDOTransactionHandler2[] getTransactionHandlers2()
Specified by:
getTransactionHandlers2 in interface CDOTransaction
Since:
4.0

getSessionID

public int getSessionID()
Specified by:
getSessionID in interface CDOLockOwner
Returns:
the ID identifying the session that owns the view
Since:
4.1

isDurableView

public boolean isDurableView()
Specified by:
isDurableView in interface CDOLockOwner
Since:
4.1

getViewID

public int getViewID()
Specified by:
getViewID in interface CDOCommonView
Specified by:
getViewID in interface CDOLockOwner
Returns:
the ID identifying the view within the session

getViewSet

public CDOViewSet getViewSet()
Description copied from interface: CDOView
Returns the view set this view is associated with.

Specified by:
getViewSet in interface CDOView
Returns:
The view set this view is associated with, never null.
See Also:
CDOViewSet.getViews()

hasConflict

public boolean hasConflict()
Description copied from interface: CDOTransaction
Returns true if this transaction contains local modifications that are conflicting with remote modifications, false otherwise.

Specified by:
hasConflict in interface CDOTransaction
Specified by:
hasConflict in interface CDOView
See Also:
CDOTransaction.hasConflict()

hasResource

public boolean hasResource(String path)
Description copied from interface: CDOView
Returns true if a resource with the given path exists in the repository, false. Applies to file resources, as well.

Specified by:
hasResource in interface CDOView
See Also:
CDOView.getResource(String, boolean)

isClosed

public boolean isClosed()
Specified by:
isClosed in interface Closeable

isObjectRegistered

public boolean isObjectRegistered(CDOID id)
Description copied from interface: CDOView
Returns true if an object with the given id is currently registered in this view, false otherwise.

Specified by:
isObjectRegistered in interface CDOView

lockObjects

public void lockObjects(Collection<? extends CDOObject> objects,
                        IRWLockManager.LockType lockType,
                        long timeout)
                 throws InterruptedException
Description copied from interface: CDOView
Locks the given objects. Once the objects are locked, they will not be changed remotely or go in conflict state.

Specified by:
lockObjects in interface CDOView
Throws:
InterruptedException

lockObjects

public void lockObjects(Collection<? extends CDOObject> objects,
                        IRWLockManager.LockType lockType,
                        long timeout,
                        boolean recursive)
                 throws InterruptedException
Specified by:
lockObjects in interface CDOView
Throws:
InterruptedException

options

public CDOTransaction.Options options()
Description copied from interface: CDOCommonView
Returns the options of this view.

Specified by:
options in interface CDOCommonView
Specified by:
options in interface CDOTransaction
Specified by:
options in interface CDOView
Specified by:
options in interface IOptionsContainer

queryResources

public List<CDOResourceNode> queryResources(CDOResourceFolder folder,
                                            String name,
                                            boolean exactMatch)
Description copied from interface: CDOView
Returns a list of the resources in the given folder with a name equal to or starting with the value of the name parameter.

Specified by:
queryResources in interface CDOView
Parameters:
folder - The folder to search in, or null for top level resource nodes.
name - the name or prefix of the resource nodes to return.
exactMatch - true if the complete name of the resource must match, false if only a common prefix of the name must match.

queryResourcesAsync

public CloseableIterator<CDOResourceNode> queryResourcesAsync(CDOResourceFolder folder,
                                                              String name,
                                                              boolean exactMatch)
Description copied from interface: CDOView
Returns an iterator over the resources in the given folder with a name equal to or starting with the value of the name parameter. The underlying query will be executed asynchronously.

Specified by:
queryResourcesAsync in interface CDOView
Parameters:
folder - The folder to search in, or null for top level resource nodes.
name - the name or prefix of the resource nodes to return.
exactMatch - true if the complete name of the resource must match, false if only a common prefix of the name must match.

queryXRefs

public List<CDOObjectReference> queryXRefs(CDOObject targetObject,
                                           EReference... sourceReferences)
Description copied from interface: CDOView
Returns a list of object references that represent the cross references to the specified target object.

Specified by:
queryXRefs in interface CDOView
Parameters:
targetObject - The target object that referencing objects are requested for. An external target object can be used with the help of CDOUtil.wrapExternalObject().
sourceReferences - The reference features that referencing objects are requested for, or an empty array if all reference features are to be used in the request.
Since:
4.0
See Also:
CDOView.queryXRefs(Set, EReference...), CDOView.queryXRefsAsync(Set, EReference...), CDOUtil.wrapExternalObject(EObject, CDOView)

queryXRefs

public List<CDOObjectReference> queryXRefs(Set<CDOObject> targetObjects,
                                           EReference... sourceReferences)
Description copied from interface: CDOView
Returns a list of object references that represent the cross references to the specified target objects.

Specified by:
queryXRefs in interface CDOView
Parameters:
targetObjects - The set of target objects that referencing objects are requested for. External target objects can be used with the help of CDOUtil.wrapExternalObject().
sourceReferences - The reference features that referencing objects are requested for, or an empty array if all reference features are to be used in the request.
See Also:
CDOView.queryXRefs(CDOObject, EReference...), CDOView.queryXRefsAsync(Set, EReference...), CDOUtil.wrapExternalObject(EObject, CDOView)

queryXRefsAsync

public CloseableIterator<CDOObjectReference> queryXRefsAsync(Set<CDOObject> targetObjects,
                                                             EReference... sourceReferences)
Description copied from interface: CDOView
Returns an iterator over the object references that represent the cross references to the specified target objects. The underlying query will be executed asynchronously.

Specified by:
queryXRefsAsync in interface CDOView
Parameters:
targetObjects - The set of target objects that referencing objects are requested for. External target objects can be used with the help of CDOUtil.wrapExternalObject().
sourceReferences - The reference features that referencing objects are requested for, or an empty array if all reference features are to be used in the request.
See Also:
CDOView.queryXRefs(CDOObject, EReference...), CDOView.queryXRefs(Set, EReference...), CDOUtil.wrapExternalObject(EObject, CDOView)

reload

public int reload(CDOObject... objects)
Description copied from interface: CDOView
Reloads the given objects from the repository.

Specified by:
reload in interface CDOView

removeObjectHandler

public void removeObjectHandler(CDOObjectHandler handler)
Specified by:
removeObjectHandler in interface CDOView

removeTransactionHandler

public void removeTransactionHandler(CDOTransactionHandlerBase handler)
Specified by:
removeTransactionHandler in interface CDOTransaction
Since:
4.0

merge

public CDOChangeSetData merge(CDOBranchPoint source,
                              CDOMerger merger)
Specified by:
merge in interface CDOTransaction

merge

public CDOChangeSetData merge(CDOBranchPoint source,
                              CDOBranchPoint sourceBase,
                              CDOMerger merger)
Specified by:
merge in interface CDOTransaction
Since:
4.0

compareRevisions

public CDOChangeSetData compareRevisions(CDOBranchPoint source)
Specified by:
compareRevisions in interface CDOView
Since:
4.0

getHistory

public CDOCommitHistory getHistory()
Specified by:
getHistory in interface CDOCommitHistory.Provider<CDOObject,CDOObjectHistory>
Since:
4.2

getHistory

public CDOObjectHistory getHistory(CDOObject object)
Specified by:
getHistory in interface CDOCommitHistory.Provider<CDOObject,CDOObjectHistory>
Since:
4.2

setSavepoint

public CDOSavepoint setSavepoint()
Description copied from interface: CDOUserTransaction
Creates a save point in the CDOTransaction that can be used to roll back a part of the transaction

Save points do not involve the server side, everything is done on the client side.

Specified by:
setSavepoint in interface CDOTransaction
Specified by:
setSavepoint in interface CDOUserTransaction

unlockObjects

public void unlockObjects()
Description copied from interface: CDOView
Unlocks all locked objects of this view.

Specified by:
unlockObjects in interface CDOView

unlockObjects

public void unlockObjects(Collection<? extends CDOObject> objects,
                          IRWLockManager.LockType lockType)
Description copied from interface: CDOView
Unlocks the given locked objects of this view.

Specified by:
unlockObjects in interface CDOView

unlockObjects

public void unlockObjects(Collection<? extends CDOObject> objects,
                          IRWLockManager.LockType lockType,
                          boolean recursive)
Specified by:
unlockObjects in interface CDOView

enableDurableLocking

@Deprecated
public String enableDurableLocking(boolean enable)
Deprecated. Use enableDurableLocking() instead or disableDurableLocking(boolean), respectively.

Specified by:
enableDurableLocking in interface CDOView
Since:
4.0

enableDurableLocking

public String enableDurableLocking()
Description copied from interface: CDOView
Enables the storage of all information that's needed to reopen this view at a later point in time. This information includes the branch point, the user ID of the session, whether it's a read-only view or a transaction and all the locks that are acquired or will be acquired while durable locking is enabled.

Specified by:
enableDurableLocking in interface CDOView
Since:
4.1
See Also:
CDOViewContainer.openView(String), CDOViewContainer.openView(String, ResourceSet), CDOTransactionContainer.openTransaction(String), CDOTransactionContainer.openTransaction(String, ResourceSet), CDOView.disableDurableLocking(boolean)

disableDurableLocking

public void disableDurableLocking(boolean releaseLocks)
Description copied from interface: CDOView
Disables the storage of all information that's needed to reopen this view at a later point in time. If such information is stored when this method is called it is removed. Note that locks acquired by this view are only released if true is passed to the releaseLocks parameter.

Specified by:
disableDurableLocking in interface CDOView
Since:
4.1
See Also:
CDOView.enableDurableLocking()

isReadOnly

public boolean isReadOnly()
Specified by:
isReadOnly in interface CDOCommonView

getBranch

public CDOBranch getBranch()
Description copied from interface: CDOBranchPoint
Returns the branch of this branch point, or null if this branch point is the base of the main branch.

Specified by:
getBranch in interface CDOBranchPoint

setBranchPoint

public boolean setBranchPoint(CDOBranch branch,
                              long timeStamp)
Description copied from interface: CDOView
Sets the branch and the point in (repository) time this view should refer to. Objects provided by this view will be valid at this time. The special value UNSPECIFIED_DATE denotes a "floating view" that always shows the latest state of the repository.

Specified by:
setBranchPoint in interface CDOView
Returns:
true if the branch point was changed, false otherwise.

setBranchPoint

public boolean setBranchPoint(CDOBranchPoint branchPoint)
Description copied from interface: CDOView
Same as calling setBranchPoint(branchPoint.getBranch(), branchPoint.getTimeStamp()).

Specified by:
setBranchPoint in interface CDOView

setBranch

public boolean setBranch(CDOBranch branch)
Description copied from interface: CDOView
Same as calling setBranchPoint(branch, getTimeStamp()).

Specified by:
setBranch in interface CDOView

setTimeStamp

public boolean setTimeStamp(long timeStamp)
Description copied from interface: CDOView
Same as calling setBranchPoint(getBranch(), timeStamp).

Specified by:
setTimeStamp in interface CDOView

getURIHandler

public URIHandler getURIHandler()
Specified by:
getURIHandler in interface CDOView

getCommitComment

public String getCommitComment()
Description copied from interface: CDOTransaction
Returns the comment to be used in the next commit operation.

Specified by:
getCommitComment in interface CDOTransaction
See Also:
CDOCommitInfo.getComment()

setCommitComment

public void setCommitComment(String comment)
Description copied from interface: CDOTransaction
Sets the comment to be used in the next commit operation.

Specified by:
setCommitComment in interface CDOTransaction
See Also:
CDOCommitInfo.getComment()

setCommittables

public void setCommittables(Set<? extends EObject> committables)
Specified by:
setCommittables in interface CDOTransaction
Since:
4.0

getCommittables

public Set<? extends EObject> getCommittables()
Specified by:
getCommittables in interface CDOTransaction
Since:
4.0

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface IContainer<CDOResourceNode>
Since:
4.2

getElements

public CDOResourceNode[] getElements()
Specified by:
getElements in interface IContainer<CDOResourceNode>
Since:
4.2

toString

public String toString()
Overrides:
toString in class Object

getAdapter

public Object getAdapter(Class adapter)
Specified by:
getAdapter in interface IAdaptable
Since:
4.2

createTempFile

public static File createTempFile(CDOTransaction transaction)
                           throws IOException
Throws:
IOException


Copyright (c) 2011, 2012 Eike Stepper (Berlin, Germany) and others.