LOGGER.log(Level.INFO, status + " " + resource.getPresentationName() + " (" + resource.getVersion() + ")"); totalAddons++;
new ObrBundle(repoResource.getSymbolicName(), repoResource.getPresentationName(), repoResource.getSize(), repoResource.getVersion(), repoResource.getURI());
new ObrBundle(repoResource.getSymbolicName(), repoResource.getPresentationName(), repoResource.getSize(), repoResource.getVersion(), repoResource.getURI());
public String getPresentationName() { return resource.getPresentationName(); }
public String getPresentationName() { return resource.getPresentationName(); }
public String getPresentationName() { return resource.getPresentationName(); }
protected String getResourceId(Resource resource) { return resource.getPresentationName() != null ? resource.getPresentationName() : resource.getSymbolicName(); }
protected String getResourceId(Resource resource) { return resource.getPresentationName() != null ? resource.getPresentationName() : resource.getSymbolicName(); }
public boolean match(Resource resource) { return matchQuery(resource.getPresentationName()); }
private Bundle installBundle(Repository repo, Resource resource) { Bundle aBundle = null; if (!resource.getPresentationName().equals(PRESENTATION_NAME)) { try {
/** * Write out the resource element * * @param r * resource * @param writer * buffer writer * @throws IOException */ private static void writeResource(Resource r, String uri, Document doc, Element root) throws IOException { logger.debug(LOG_ENTRY, "writeResource", new Object[]{r, uri, doc, root}); Element resource = doc.createElement("resource"); resource.setAttribute(Resource.VERSION, r.getVersion().toString()); resource.setAttribute("uri", r.getURI()); resource.setAttribute(Resource.SYMBOLIC_NAME, r.getSymbolicName()); resource.setAttribute(Resource.ID, r.getSymbolicName() + "/" + r.getVersion()); resource.setAttribute(Resource.PRESENTATION_NAME, r.getPresentationName()); root.appendChild(resource); for (Capability c : r.getCapabilities()) writeCapability(c, doc, resource); for (Requirement req : r.getRequirements()) { writeRequirement(req, doc, resource); } logger.debug(LOG_EXIT, "writeResource"); }
/** * Write out the resource element * * @param r * resource * @param writer * buffer writer * @throws IOException */ private static void writeResource(Resource r, String uri, Document doc, Element root) throws IOException { logger.debug(LOG_ENTRY, "writeResource", new Object[]{r, uri, doc, root}); Element resource = doc.createElement("resource"); resource.setAttribute(Resource.VERSION, r.getVersion().toString()); resource.setAttribute("uri", r.getURI()); resource.setAttribute(Resource.SYMBOLIC_NAME, r.getSymbolicName()); resource.setAttribute(Resource.ID, r.getSymbolicName() + "/" + r.getVersion()); resource.setAttribute(Resource.PRESENTATION_NAME, r.getPresentationName()); root.appendChild(resource); for (Capability c : r.getCapabilities()) writeCapability(c, doc, resource); for (Requirement req : r.getRequirements()) { writeRequirement(req, doc, resource); } logger.debug(LOG_EXIT, "writeResource"); }
@Override protected void populateItem(ListItem<ResourceWrapper> item) { ResourceWrapper resourceWrapper = item.getModelObject(); Resource resource = resourceWrapper.getResource(); String name = resource.getSymbolicName(); item.add(new Label("name", name)); String description = (String) resource.getProperties().get(Resource.DESCRIPTION); if(description==null) description = resource.getPresentationName(); item.add(new Label("description", description)); item.add(new Label("version", resource.getVersion().toString())); item.add(new CheckBox("install",new PropertyModel<Boolean>(item.getModel(),"checked"))); } };
public TabularData getBundles() throws MBeanException { try { CompositeType bundleType = new CompositeType("OBR Resource", "Bundle available in the OBR", new String[]{"presentationname", "symbolicname", "version"}, new String[]{"Presentation Name", "Symbolic Name", "Version"}, new OpenType[]{SimpleType.STRING, SimpleType.STRING, SimpleType.STRING}); TabularType tableType = new TabularType("OBR Resources", "Table of all resources/bundles available in the OBR", bundleType, new String[]{"symbolicname", "version"}); TabularData table = new TabularDataSupport(tableType); Resource[] resources = repositoryAdmin.discoverResources("(|(presentationname=*)(symbolicname=*))"); for (Resource resource : resources) { try { CompositeData data = new CompositeDataSupport(bundleType, new String[]{"presentationname", "symbolicname", "version"}, new Object[]{resource.getPresentationName(), resource.getSymbolicName(), resource.getVersion().toString()}); table.put(data); } catch (Exception e) { e.printStackTrace(); } } return table; } catch (Exception e) { throw new MBeanException(null, e.toString()); } }
public TabularData getBundles() throws MBeanException { try { CompositeType bundleType = new CompositeType("OBR Resource", "Bundle available in the OBR", new String[]{"presentationname", "symbolicname", "version"}, new String[]{"Presentation Name", "Symbolic Name", "Version"}, new OpenType[]{SimpleType.STRING, SimpleType.STRING, SimpleType.STRING}); TabularType tableType = new TabularType("OBR Resources", "Table of all resources/bundles available in the OBR", bundleType, new String[]{"symbolicname", "version"}); TabularData table = new TabularDataSupport(tableType); Resource[] resources = repositoryAdmin.discoverResources("(|(presentationname=*)(symbolicname=*))"); for (Resource resource : resources) { try { CompositeData data = new CompositeDataSupport(bundleType, new String[]{"presentationname", "symbolicname", "version"}, new Object[]{resource.getPresentationName(), resource.getSymbolicName(), resource.getVersion().toString()}); table.put(data); } catch (Exception e) { e.printStackTrace(); } } return table; } catch (Exception e) { throw new MBeanException(null, e.toString()); } }
@Override void doExecute(RepositoryAdmin admin) throws Exception { StringBuilder substr = new StringBuilder(); if (packages != null) { for (String packageName : packages) { substr.append(" "); substr.append(packageName); } } String query; if ((substr == null) || (substr.length() == 0)) { query = "(|(presentationname=*)(symbolicname=*))"; } else { query = "(|(presentationname=*" + substr + "*)(symbolicname=*" + substr + "*))"; } Resource[] resources = admin.discoverResources(query); ShellTable table = new ShellTable(); table.column("Name"); table.column("Symbolic Name"); table.column("Version"); table.emptyTableText("No matching bundles"); for (Resource resource : resources) { table.addRow().addContent(emptyIfNull(resource.getPresentationName()), emptyIfNull(resource.getSymbolicName()), emptyIfNull(resource.getVersion())); } table.print(System.out, !noFormat); }
@Override void doExecute(RepositoryAdmin admin) throws Exception { StringBuilder substr = new StringBuilder(); if (packages != null) { for (String packageName : packages) { substr.append(" "); substr.append(packageName); } } String query; if ((substr == null) || (substr.length() == 0)) { query = "(|(presentationname=*)(symbolicname=*))"; } else { query = "(|(presentationname=*" + substr + "*)(symbolicname=*" + substr + "*))"; } Resource[] resources = admin.discoverResources(query); ShellTable table = new ShellTable(); table.column("Name"); table.column("Symbolic Name"); table.column("Version"); table.emptyTableText("No matching bundles"); for (Resource resource : resources) { table.addRow().addContent(emptyIfNull(resource.getPresentationName()), emptyIfNull(resource.getSymbolicName()), emptyIfNull(resource.getVersion())); } table.print(System.out, !noFormat); }
@Override public Object execute(CommandSession session) throws Exception { StringBuilder substr = new StringBuilder(); if (packages != null) { for (String packageName : packages) { substr.append(" "); substr.append(packageName); } } String query; if ((substr == null) || (substr.length() == 0)) { query = "(|(presentationname=*)(symbolicname=*))"; } else { query = "(|(presentationname=*" + substr + "*)(symbolicname=*" + substr + "*))"; } Resource[] resources = repoAdmin.discoverResources(query); ShellTable table = new ShellTable(); table.column("Name"); table.column("Symbolic Name"); table.column("Version"); table.emptyTableText("No matching bundles"); for (Resource resource : resources) { table.addRow().addContent(emptyIfNull(resource.getPresentationName()), emptyIfNull(resource.getSymbolicName()), emptyIfNull(resource.getVersion())); } table.print(System.out, !noFormat); return null; }
Resource[] resources = repository.getResources(); for (Resource resource : resources) { ObrBundleInfo info = new ObrBundleInfo(resource.getPresentationName(),resource.getSymbolicName(), resource.getVersion().toString()); bundles.remove(info);
Resource[] resources = repository.getResources(); for (Resource resource : resources) { ObrBundleInfo info = new ObrBundleInfo(resource.getPresentationName(), resource.getSymbolicName(), resource.getVersion().toString()); clusterBundles.add(info);