Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 880ef0e5fe528e3c1e5dab77508da1077fd6138a (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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
/*******************************************************************************
 * Copyright (c) 2004, 2013 IBM Corporation 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:
 *     IBM Corporation - initial API and implementation
 *     Danail Nachev -  ProSyst - bug 218625
 *     Rob Harrop - SpringSource Inc. (bug 247522)
 *******************************************************************************/
package org.eclipse.osgi.compatibility.state;

import java.util.*;
import org.eclipse.osgi.internal.resolver.StateHelperImpl;
import org.eclipse.osgi.service.resolver.*;
import org.osgi.framework.BundleException;
import org.osgi.framework.Version;
import org.osgi.framework.hooks.resolver.ResolverHookFactory;

public final class ReadOnlyState implements State {
	private final PlatformAdminImpl platformAdmin;

	public ReadOnlyState(PlatformAdminImpl platformAdmin) {
		this.platformAdmin = platformAdmin;
	}

	public boolean addBundle(BundleDescription description) {
		throw new UnsupportedOperationException();
	}

	public StateDelta compare(State state) throws BundleException {
		return platformAdmin.getSystemState().compare(state);
	}

	public BundleDescription getBundle(long id) {
		return platformAdmin.getSystemState().getBundle(id);
	}

	public BundleDescription getBundle(String symbolicName, Version version) {
		return platformAdmin.getSystemState().getBundle(symbolicName, version);
	}

	public BundleDescription getBundleByLocation(String location) {
		return platformAdmin.getSystemState().getBundleByLocation(location);
	}

	public BundleDescription[] getBundles() {
		return platformAdmin.getSystemState().getBundles();
	}

	public BundleDescription[] getBundles(String symbolicName) {
		return platformAdmin.getSystemState().getBundles(symbolicName);
	}

	public StateDelta getChanges() {
		return platformAdmin.getSystemState().getChanges();
	}

	public ExportPackageDescription[] getExportedPackages() {
		return platformAdmin.getSystemState().getExportedPackages();
	}

	public StateObjectFactory getFactory() {
		return platformAdmin.getSystemState().getFactory();
	}

	public BundleDescription[] getResolvedBundles() {
		return platformAdmin.getSystemState().getResolvedBundles();
	}

	public long getTimeStamp() {
		return platformAdmin.getTimeStamp();
	}

	public boolean isEmpty() {
		return platformAdmin.getSystemState().isEmpty();
	}

	public boolean isResolved() {
		return platformAdmin.getSystemState().isResolved();
	}

	public boolean removeBundle(BundleDescription bundle) {
		throw new UnsupportedOperationException();
	}

	public BundleDescription removeBundle(long bundleId) {
		throw new UnsupportedOperationException();
	}

	public StateDelta resolve() {
		throw new UnsupportedOperationException();
	}

	public StateDelta resolve(boolean incremental) {
		throw new UnsupportedOperationException();
	}

	public StateDelta resolve(BundleDescription[] discard) {
		throw new UnsupportedOperationException();
	}

	public StateDelta resolve(BundleDescription[] resolve, boolean discard) {
		throw new UnsupportedOperationException();
	}

	@SuppressWarnings("deprecation")
	public void setOverrides(Object value) {
		throw new UnsupportedOperationException();
	}

	public boolean updateBundle(BundleDescription newDescription) {
		throw new UnsupportedOperationException();
	}

	public void resolveConstraint(VersionConstraint constraint, BaseDescription supplier) {
		throw new UnsupportedOperationException();
	}

	/**
	 * @deprecated
	 */
	public void resolveBundle(BundleDescription bundle, boolean status, BundleDescription[] hosts, ExportPackageDescription[] selectedExports, BundleDescription[] resolvedRequires, ExportPackageDescription[] resolvedImports) {
		throw new UnsupportedOperationException();
	}

	/**
	 * @deprecated
	 */
	public void resolveBundle(BundleDescription bundle, boolean status, BundleDescription[] host, ExportPackageDescription[] selectedExports, ExportPackageDescription[] substitutedExports, BundleDescription[] resolvedRequires, ExportPackageDescription[] resolveImports) {
		throw new UnsupportedOperationException();
	}

	public void resolveBundle(BundleDescription bundle, boolean status, BundleDescription[] hosts, ExportPackageDescription[] selectedExports, ExportPackageDescription[] substitutedExports, GenericDescription[] selectedCapabilities, BundleDescription[] resolvedRequires, ExportPackageDescription[] resolvedImports, GenericDescription[] resolvedCapabilities, Map<String, List<StateWire>> resolvedRequirements) {
		throw new UnsupportedOperationException();
	}

	public void removeBundleComplete(BundleDescription bundle) {
		throw new UnsupportedOperationException();
	}

	public Resolver getResolver() {
		return null;
	}

	public void setResolver(Resolver value) {
		throw new UnsupportedOperationException();
	}

	public boolean setPlatformProperties(Dictionary<?, ?> platformProperties) {
		throw new UnsupportedOperationException();
	}

	public boolean setPlatformProperties(Dictionary<?, ?> platformProperties[]) {
		throw new UnsupportedOperationException();
	}

	public Dictionary[] getPlatformProperties() {
		return platformAdmin.getSystemState().getPlatformProperties();
	}

	public ExportPackageDescription linkDynamicImport(BundleDescription importingBundle, String requestedPackage) {
		throw new UnsupportedOperationException();
	}

	public void setTimeStamp(long timeStamp) {
		throw new UnsupportedOperationException();
	}

	public ExportPackageDescription[] getSystemPackages() {
		return platformAdmin.getSystemState().getSystemPackages();
	}

	public void addResolverError(BundleDescription bundle, int type, String data, VersionConstraint unsatisfied) {
		throw new UnsupportedOperationException();
	}

	public ResolverError[] getResolverErrors(BundleDescription bundle) {
		return platformAdmin.getSystemState().getResolverErrors(bundle);
	}

	public void removeResolverErrors(BundleDescription bundle) {
		throw new UnsupportedOperationException();
	}

	public StateHelper getStateHelper() {
		return StateHelperImpl.getInstance();
	}

	public long getHighestBundleId() {
		return platformAdmin.getSystemState().getHighestBundleId();
	}

	public void setNativePathsInvalid(NativeCodeDescription nativeCodeDescription, boolean hasInvalidPaths) {
		throw new UnsupportedOperationException();
	}

	public BundleDescription[] getDisabledBundles() {
		return platformAdmin.getSystemState().getDisabledBundles();
	}

	public void addDisabledInfo(DisabledInfo disabledInfo) {
		throw new UnsupportedOperationException();
	}

	public DisabledInfo[] getDisabledInfos(BundleDescription bundle) {
		return platformAdmin.getSystemState().getDisabledInfos(bundle);
	}

	public DisabledInfo getDisabledInfo(BundleDescription bundle, String policyName) {
		return platformAdmin.getSystemState().getDisabledInfo(bundle, policyName);
	}

	public void removeDisabledInfo(DisabledInfo disabledInfo) {
		throw new UnsupportedOperationException();
	}

	public BundleDescription[] getRemovalPending() {
		throw new UnsupportedOperationException();
	}

	public Collection<BundleDescription> getDependencyClosure(Collection<BundleDescription> bundles) {
		return platformAdmin.getSystemState().getDependencyClosure(bundles);
	}

	public void addDynamicImportPackages(BundleDescription importingBundle, ImportPackageSpecification[] dynamicImports) {
		throw new UnsupportedOperationException();
	}

	public void setResolverHookFactory(ResolverHookFactory hookFactory) {
		// do nothing
	}

}

Back to the top