org.eclipse.emf.cdo.session

## Interface CDOSession

- All Superinterfaces:
    CDOCommonSession, CDOTransactionContainer, CDOTransactionOpener, CDOUpdatable, CDOViewContainer, CDOViewOpener, Closeable, IAdaptable, IContainer<CDOView>, INotifier, IOptionsContainer, IPasswordCredentialsProvider.Provider, IPropertiesContainer, IUserAware
  All Known Subinterfaces:
    CDONet4jSession, CDOSession, CDOSession, InternalCDOSession

      public interface CDOSession
      extends CDOCommonSession, CDOUpdatable, CDOTransactionContainer, IPasswordCredentialsProvider.Provider

  Represents and controls the connection to a model repository in addition to the inherited `view` management functions.

  A session has the following responsibilities:

  - `CDORepositoryInfo information`
  - `Package registry`
  - `Data management`
  - `View management`

  Note that in order to retrieve, access and store `objects` a `view` is needed. The various `openXYZ` methods are provided for this purpose.

  A session can fire the following events:

  - `CDOSessionInvalidationEvent` after `commit notifications` have been received and processed.
  - `CDOSessionLocksChangedEvent` after `locks` have been acquired or released.
  Since:
    2.0
  Author:
    Eike Stepper
  No Implement
    This interface is not intended to be implemented by clients.
  No Extend
    This interface is not intended to be extended by clients.
  Apiviz
    .*\.CDOTransactionContainer, .*\.CDOUpdatable
  Apiviz
  Apiviz
    `CDORepositoryInfo`, `CDOPackageRegistry`, `CDOBranchManager`, `CDORevisionManager`, `CDOFetchRuleManager`, `CDORemoteSessionManager`, `CDOCommitInfoManager`, `CDOIDGenerator`, `CDOSession.Options`, `CDOSession.ExceptionHandler`, `CDOSession.ExceptionHandler`
  Apiviz
    `CDOSessionInvalidationEvent` - - fires, `CDOSessionLocksChangedEvent` - - fires
  Apiviz
    `CDOView` - - views, `CDOTransaction` - - transactions

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static interface` | `CDOSession.ExceptionHandler` Handles `protocol` exceptions if `configured` before the session has been opened.
    `static interface` | `CDOSession.Options` Encapsulates a set of notifying `session` configuration options.

    - ### Nested classes/interfaces inherited from interface org.eclipse.net4j.util.container.IContainer

      `IContainer.Modifiable<E>, IContainer.Persistable<E>, IContainer.Persistence<E>`

  - ### Field Summary

    - ### Fields inherited from interface org.eclipse.emf.cdo.util.CDOUpdatable

      `NO_TIMEOUT`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `changeCredentials()` Initiates (possibly interactive) changing of credentials for the user logged in in this session.
    `CDOChangeSetData` | `compareRevisions(CDOBranchPoint source, CDOBranchPoint target)`
    `CDOBranchManager` | `getBranchManager()` Returns the CDO `branch manager` that manages the `branches` of the repository of this session.
    `CDOCommitInfoManager` | `getCommitInfoManager()` Returns the CDO `commit info manager` of this session.
    `CDOSession.ExceptionHandler` | `getExceptionHandler()` Returns the `exception handler` of this session.
    `CDOFetchRuleManager` | `getFetchRuleManager()` Returns the CDO `fetch rule manager` of this session.
    `CDOIDGenerator` | `getIDGenerator()` Returns the CDO `ID generator` of this session.
    `CDOPackageRegistry` | `getPackageRegistry()` Returns the EMF `package registry` that is used by all `objects` of all `views` of this session.
    `CDORemoteSessionManager` | `getRemoteSessionManager()` Returns the CDO `remote session manager` that keeps track of the other remote sessions served by the repository of this local session.
    `CDORepositoryInfo` | `getRepositoryInfo()` Returns an instance of `CDORepositoryInfo` that describes the model repository this `session` is connected to.
    `CDORevisionManager` | `getRevisionManager()` Returns the CDO `revision manager` that manages the `revisions` of the repository of this session.
    `CDOSession.Options` | `options()` Returns the `options` of this session.
    `long` | `refresh()` Refreshes the object caches of all (non-historical) `views`.
    `long` | `refresh(CDOSessionProtocol.RefreshSessionResult.Provider provider)`
    `void` | `waitForUpdate(long updateTime)` Equivalent to calling `CDOUpdatable.waitForUpdate(long)` on each of this session's views.
    `boolean` | `waitForUpdate(long updateTime, long timeoutMillis)` Equivalent to calling `CDOUpdatable.waitForUpdate(long)` on each of this session's views.

    - ### Methods inherited from interface org.eclipse.emf.cdo.common.CDOCommonSession

      `getSessionID, getView, getViews`

    - ### Methods inherited from interface org.eclipse.core.runtime.IAdaptable

      `getAdapter`

    - ### Methods inherited from interface org.eclipse.net4j.util.security.IUserAware

      `getUserID`

    - ### Methods inherited from interface org.eclipse.net4j.util.properties.IPropertiesContainer

      `properties`

    - ### Methods inherited from interface org.eclipse.net4j.util.collection.Closeable

      `close, isClosed`

    - ### Methods inherited from interface org.eclipse.emf.cdo.util.CDOUpdatable

      `getLastUpdateTime, runAfterUpdate`

    - ### Methods inherited from interface org.eclipse.emf.cdo.transaction.CDOTransactionContainer

      `getTransaction, getTransactions, getTransactions, openTransaction, openTransaction, openTransaction, openTransaction, openTransaction, openTransaction`

    - ### Methods inherited from interface org.eclipse.emf.cdo.view.CDOViewContainer

      `getView, getViews, getViews, openView, openView, openView, openView, openView, openView, openView, openView`

    - ### Methods inherited from interface org.eclipse.net4j.util.container.IContainer

      `getElements, isEmpty`

    - ### Methods inherited from interface org.eclipse.net4j.util.event.INotifier

      `addListener, getListeners, hasListeners, removeListener`

    - ### Methods inherited from interface org.eclipse.emf.cdo.view.CDOViewOpener

      `openView, openView`

    - ### Methods inherited from interface org.eclipse.emf.cdo.transaction.CDOTransactionOpener

      `openTransaction, openTransaction`

    - ### Methods inherited from interface org.eclipse.net4j.util.security.IPasswordCredentialsProvider.Provider

      `getCredentialsProvider`

- - ### Method Detail

    - #### getRepositoryInfo

          CDORepositoryInfo getRepositoryInfo()

      Returns an instance of `CDORepositoryInfo` that describes the model repository this `session` is connected to.
      Since:
        3.0

    - #### getPackageRegistry

          CDOPackageRegistry getPackageRegistry()

      Returns the EMF `package registry` that is used by all `objects` of all `views` of this session.

      This registry is managed by the `package unit manager` of this session. All `packages` that are already persisted in the repository of this session are automatically registered with this registry. New packages can be locally registered with this registry and are committed to the repository through a `transaction`, if needed.

    - #### getBranchManager

          CDOBranchManager getBranchManager()

      Returns the CDO `branch manager` that manages the `branches` of the repository of this session.
      Since:
        3.0

    - #### getRevisionManager

          CDORevisionManager getRevisionManager()

      Returns the CDO `revision manager` that manages the `revisions` of the repository of this session.
      Since:
        3.0

    - #### getFetchRuleManager

          CDOFetchRuleManager getFetchRuleManager()

      Returns the CDO `fetch rule manager` of this session.
      Since:
        3.0

    - #### getRemoteSessionManager

          CDORemoteSessionManager getRemoteSessionManager()

      Returns the CDO `remote session manager` that keeps track of the other remote sessions served by the repository of this local session.

    - #### getCommitInfoManager

          CDOCommitInfoManager getCommitInfoManager()

      Returns the CDO `commit info manager` of this session.
      Since:
        3.0

    - #### getExceptionHandler

          CDOSession.ExceptionHandler getExceptionHandler()

      Returns the `exception handler` of this session.

    - #### getIDGenerator

          CDOIDGenerator getIDGenerator()

      Returns the CDO `ID generator` of this session.
      Since:
        4.1

    - #### refresh

          long refresh()

      Refreshes the object caches of all (non-historical) `views`.
      Since:
        3.0

    - #### refresh

          long refresh(CDOSessionProtocol.RefreshSessionResult.Provider provider)

      Since:
        4.4

    - #### waitForUpdate

          void waitForUpdate(long updateTime)

      Equivalent to calling `CDOUpdatable.waitForUpdate(long)` on each of this session's views. That is, this blocks the calling thread until all of this session's views have incorporated a commit operation with the given time stamp (or higher).
      Specified by:
        `waitForUpdate` in interface `CDOUpdatable`

    - #### waitForUpdate

          boolean waitForUpdate(long updateTime,
                                long timeoutMillis)

      Equivalent to calling `CDOUpdatable.waitForUpdate(long)` on each of this session's views. That is, this blocks the calling thread until all of this session's views have incorporated a commit operation with the given time stamp (or higher) or the given total 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.

    - #### compareRevisions

          CDOChangeSetData compareRevisions(CDOBranchPoint source,
                                            CDOBranchPoint target)

      Since:
        4.0

    - #### changeCredentials

          void changeCredentials()

      Initiates (possibly interactive) changing of credentials for the user logged in in this session. This is an optional operation of the session.
      Throws:
        `UnsupportedOperationException` - if the session implementation does not permit changing credentials
      Since:
        4.3
      See Also:
        `IPasswordCredentialsProvider.Provider.getCredentialsProvider()`

    - #### options

          CDOSession.Options options()

      Returns the `options` of this session.
      Specified by:
        `options` in interface `CDOCommonSession`
      Specified by:
        `options` in interface `IOptionsContainer`

Copyright (c) 2014 Eike Stepper (Berlin, Germany) and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html