import org.argeo.slc.deploy.DeploymentData;
import org.argeo.slc.deploy.Module;
import org.argeo.slc.deploy.TargetData;
+import org.argeo.slc.process.RealizedFlow;
import org.osgi.framework.Bundle;
+import org.osgi.framework.Constants;
public class OsgiBundle implements Module<ResourceDistribution> {
private String name;
private String version;
private Distribution distribution;
+ private Long internalBundleId;
+
public OsgiBundle() {
}
public OsgiBundle(Bundle bundle) {
name = bundle.getSymbolicName();
- version = bundle.getHeaders().get("Bundle-Version").toString();
+ version = bundle.getHeaders().get(Constants.BUNDLE_VERSION).toString();
+ internalBundleId = bundle.getBundleId();
+ }
+
+ public OsgiBundle(RealizedFlow realizedFlow) {
+ name = realizedFlow.getModuleName();
+ version = realizedFlow.getModuleVersion();
}
public String getDeployedSystemId() {
}
public DeploymentData getDeploymentData() {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException();
}
public Distribution getDistribution() {
}
public TargetData getTargetData() {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException();
}
public String getName() {
this.distribution = distribution;
}
+ /**
+ * To be used for optimization when looking in the bundle context. Can
+ * therefore be null.
+ */
+ public Long getInternalBundleId() {
+ return internalBundleId;
+ }
+
+ /** Only package access for the time being. e.g. from {@link BundlesManager} */
+ void setInternalBundleId(Long internalBundleId) {
+ this.internalBundleId = internalBundleId;
+ }
+
}