/*
- * Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
+ * Copyright (C) 2007-2012 Argeo GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.argeo.slc.osgi.build;
import java.util.ArrayList;
import java.util.HashSet;
+import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.SortedMap;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.argeo.slc.DefaultNameVersion;
+import org.argeo.slc.NameVersion;
import org.argeo.slc.SlcException;
import org.argeo.slc.UnsupportedException;
-import org.argeo.slc.build.BasicNameVersion;
import org.argeo.slc.build.Distribution;
import org.argeo.slc.build.ModularDistribution;
-import org.argeo.slc.build.NameVersion;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Constants;
import org.springframework.beans.factory.InitializingBean;
public Distribution getModuleDistribution(String moduleName,
String moduleVersion) {
- return distributions
- .get(new BasicNameVersion(moduleName, moduleVersion));
+ return distributions.get(new DefaultNameVersion(moduleName,
+ moduleVersion));
}
public String getDistributionId() {
return bundleContext.getBundle().getSymbolicName()
+ "-"
- + bundleContext.getBundle().getHeaders().get(
- Constants.BUNDLE_VERSION);
+ + bundleContext.getBundle().getHeaders()
+ .get(Constants.BUNDLE_VERSION);
}
public Set<NameVersion> listModulesNameVersions() {
return distributions.keySet();
}
+ public Iterator<NameVersion> nameVersions() {
+ return distributions.keySet().iterator();
+ }
+
public void setBundleContext(BundleContext bundleContext) {
this.bundleContext = bundleContext;
}
}
public String getVersion() {
- return bundleContext.getBundle().getHeaders().get(
- Constants.BUNDLE_VERSION).toString();
+ return bundleContext.getBundle().getHeaders()
+ .get(Constants.BUNDLE_VERSION).toString();
}
@Override
public String toString() {
- return new BasicNameVersion(this).toString();
+ return new DefaultNameVersion(this).toString();
}
public void setEclipseUpdateSite(EclipseUpdateSite eclipseUpdateSite) {