Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 3d043e63c55b0f593500e023b919960239608480 (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
/*
 * 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:
 *    Victor Roldan Betancort - initial API and implementation
 *    Eike Stepper - maintenance
 */
package org.eclipse.emf.cdo.view;

import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.ResourceSet;

/**
 * Capable of opening a <code>CDOView</code> on a target repository, defined by a URI. A regular expression and the
 * priority are used to determine the most suitable provider.
 *
 * @since 2.0
 * @author Victor Roldan Betancort
 */
public interface CDOViewProvider
{
  public static final int DEFAULT_PRIORITY = 500;

  /**
   * Returns the priority of this provider. Usually used to choose between several <code>CDOViewProvider</code> that
   * match the same repository URI.
   */
  public int getPriority();

  /**
   * Returns the regular expression that determines if the provider can handle certain URI
   */
  public String getRegex();

  /**
   * Checks if the URI matches with the regular expression of this provider
   */
  public boolean matchesRegex(URI uri);

  /**
   * Receives a URI and returns an opened <code>CDOView</code> against the repository. The implementer is responsible to
   * do the UUID to physical host map in case necessary.
   *
   * @return a wired-up and opened <code>CDOView</code>
   */
  public CDOView getView(URI uri, ResourceSet resourceSet);

  /**
   * @since 4.0
   */
  public URI getResourceURI(CDOView view, String path);
}

Back to the top