Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 097567ffbec491110e4a6c9356abe7bd0de03ec3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
/*
 * Copyright (c) 2004 - 2012 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
 *
 * Contributors:
 *    Eike Stepper - initial API and implementation
 */
package org.eclipse.emf.cdo.internal.server.embedded;

import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.id.CDOID.ObjectType;
import org.eclipse.emf.cdo.server.IRepository;
import org.eclipse.emf.cdo.server.embedded.CDOSessionConfiguration;
import org.eclipse.emf.cdo.spi.server.InternalRepository;

import org.eclipse.emf.internal.cdo.session.CDOSessionConfigurationImpl;

import org.eclipse.net4j.util.CheckUtil;

import org.eclipse.emf.spi.cdo.InternalCDOSession;

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.PlatformObject;

import java.util.Set;

/**
 * @author Eike Stepper
 * @deprecated Not yet supported.
 */
@Deprecated
public class EmbeddedClientSessionConfiguration extends CDOSessionConfigurationImpl implements CDOSessionConfiguration
{
  private InternalRepository repository;

  public EmbeddedClientSessionConfiguration()
  {
    throw new UnsupportedOperationException("Embedded sessions are not yet supported");
  }

  public InternalRepository getRepository()
  {
    return repository;
  }

  public void setRepository(IRepository repository)
  {
    checkNotOpen();
    this.repository = (InternalRepository)repository;
  }

  @Override
  public org.eclipse.emf.cdo.server.embedded.CDOSession openSession()
  {
    return (org.eclipse.emf.cdo.server.embedded.CDOSession)super.openSession();
  }

  public InternalCDOSession createSession()
  {
    if (isActivateOnOpen())
    {
      CheckUtil.checkState(repository, "Specify a repository"); //$NON-NLS-1$
    }

    return new EmbeddedClientSession();
  }

  /**
   * @author Eike Stepper
   */
  protected static class RepositoryInfo extends PlatformObject implements org.eclipse.emf.cdo.session.CDORepositoryInfo
  {
    private EmbeddedClientSession session;

    public RepositoryInfo(EmbeddedClientSession session)
    {
      this.session = session;
    }

    public EmbeddedClientSession getSession()
    {
      return session;
    }

    public String getName()
    {
      return session.getRepository().getName();
    }

    public String getUUID()
    {
      return session.getRepository().getUUID();
    }

    public Type getType()
    {
      return session.getRepository().getType();
    }

    public State getState()
    {
      return session.getRepository().getState();
    }

    public long getCreationTime()
    {
      return session.getRepository().getCreationTime();
    }

    public long getTimeStamp()
    {
      return getTimeStamp(false);
    }

    public long getTimeStamp(boolean forceRefresh)
    {
      return System.currentTimeMillis();
    }

    public CDOID getRootResourceID()
    {
      return session.getRepository().getRootResourceID();
    }

    public boolean isSupportingAudits()
    {
      return session.getRepository().isSupportingAudits();
    }

    public boolean isSupportingBranches()
    {
      return session.getRepository().isSupportingBranches();
    }

    public boolean isSupportingEcore()
    {
      return session.getRepository().isSupportingEcore();
    }

    public boolean isSerializingCommits()
    {
      return session.getRepository().isSerializingCommits();
    }

    public boolean isEnsuringReferentialIntegrity()
    {
      return session.getRepository().isEnsuringReferentialIntegrity();
    }

    public IDGenerationLocation getIDGenerationLocation()
    {
      return session.getRepository().getIDGenerationLocation();
    }

    public String getStoreType()
    {
      return session.getRepository().getStoreType();
    }

    public Set<ObjectType> getObjectIDTypes()
    {
      return session.getRepository().getObjectIDTypes();
    }

    public boolean waitWhileInitial(IProgressMonitor monitor)
    {
      throw new UnsupportedOperationException();
    }
  }
}

Back to the top