Skip to content

Package: ECPRepositoryManager

ECPRepositoryManager

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2013 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * Eike Stepper - initial API and implementation
13: * Eugen Neufeld - javaDoc
14: *
15: *******************************************************************************/
16:
17: package org.eclipse.emf.ecp.core;
18:
19: import java.util.Collection;
20:
21: import org.eclipse.emf.ecp.core.util.ECPProperties;
22:
23: /**
24: * The ECPRepositoryManager contains all ECPRepositories and manages their lifecycle.
25: * It is available as an OSGi service or using {@link org.eclipse.emf.ecp.core.util.ECPUtil} It publishes observable
26: * events on the {@link org.eclipse.emf.ecp.core.util.observer.ECPObserverBus ECPObserverBus}.
27: * Related Observer types: {@link org.eclipse.emf.ecp.core.util.observer.ECPRepositoriesChangedObserver
28: * ECPRepositoriesChangedObserver}, {@link org.eclipse.emf.ecp.core.util.observer.ECPRepositoryContentChangedObserver
29: * ECPRepositoryContentChangedObserver}.
30: * Use {@link org.eclipse.emf.ecp.core.util.ECPUtil#getECPObserverBus() ECPUtil#getECPObserverBus()} to retrieve the
31: * ObserverBus and
32: * {@link org.eclipse.emf.ecp.core.util.observer.ECPObserverBus#register(org.eclipse.emf.ecp.core.util.observer.ECPObserver)
33: * ECPObserverBus#register(ECPObserver)} to register an Observer.
34: *
35: * @author Eike Stepper
36: * @author Jonas
37: * @noimplement This interface is not intended to be implemented by clients.
38: * @noextend This interface is not intended to be extended by clients.
39: */
40: public interface ECPRepositoryManager {
41:
42:         /**
43:          * This method returns a {@link ECPRepository} from an adaptable.
44:          *
45:          * @param adaptable the adaptable to adapt
46:          * @return {@link ECPRepository} or null if the adaptable could not be adapted
47:          */
48:
49:         ECPRepository getRepository(Object adaptable);
50:
51:         /**
52:          * This method returns a repository by its name.
53:          *
54:          * @param name the name of the repository
55:          * @return the {@link ECPRepository} or null if no repository with such name exists.
56:          */
57:
58:         ECPRepository getRepository(String name);
59:
60:         /**
61:          * Returns all known repositories.
62:          *
63:          * @return an array of all known {@link ECPRepository ECPRepositories}
64:          */
65:
66:         Collection<ECPRepository> getRepositories();
67:
68:         /**
69:          * This method allows the user to create a repository. If {@link ECPProvider#hasCreateRepositorySupport()} returns
70:          * false an UnsupportedOperationException is thrown.
71:          *
72:          * @param provider the {@link ECPProvider} of this repository
73:          * @param name the name of the new repository
74:          * @param label the label of the new repository
75:          * @param description the description of the new repository
76:          * @param properties the {@link ECPProperties} of this repository
77:          * @return the created {@link ECPRepository}
78:          */
79:         ECPRepository addRepository(ECPProvider provider, String name, String label, String description,
80:                 ECPProperties properties);
81:
82: }