use of org.osgi.resource.dto.RequirementDTO in project bnd by bndtools.
the class AgentServer method toDTO.
/*
* Turn a bundle in a Bundle Revision dto. On a r6 framework we could do
* this with adapt but on earlier frameworks we're on our own
*/
private BundleRevisionDTO toDTO(BundleRevision resource) {
BundleRevisionDTO brd = new BundleRevisionDTO();
brd.bundle = resource.getBundle().getBundleId();
brd.id = sequence.getAndIncrement();
brd.symbolicName = resource.getSymbolicName();
brd.type = resource.getTypes();
brd.version = resource.getVersion().toString();
brd.requirements = new ArrayList<RequirementDTO>();
for (Requirement r : resource.getRequirements(null)) {
brd.requirements.add(toDTO(brd.id, r));
}
brd.capabilities = new ArrayList<CapabilityDTO>();
for (Capability c : resource.getCapabilities(null)) {
brd.capabilities.add(toDTO(brd.id, c));
}
return brd;
}
use of org.osgi.resource.dto.RequirementDTO in project bnd by bndtools.
the class AgentServer method toDTO.
private RequirementDTO toDTO(int resource, Requirement r) {
RequirementDTO rd = new RequirementDTO();
rd.id = sequence.getAndIncrement();
rd.resource = resource;
rd.namespace = r.getNamespace();
rd.directives = r.getDirectives();
rd.attributes = r.getAttributes();
return rd;
}
Aggregations