/** * @deprecated since 4.13, see * {@link BundleManagerLocal#createBundleVersion(org.rhq.core.domain.auth.Subject, int, String, String, String, String)} */ @Override @SuppressWarnings("unchecked") @Deprecated public BundleVersion createBundleVersion(Subject subject, int bundleId, String name, String description, String version, String recipe) throws Exception { if (null == name || "".equals(name.trim())) { throw new IllegalArgumentException("Invalid bundleVersionName: " + name); } Bundle bundle = entityManager.find(Bundle.class, bundleId); if (null == bundle) { throw new IllegalArgumentException("Invalid bundleId: " + bundleId); } checkCreateBundleVersionAuthz(subject, bundleId); // parse the recipe (validation occurs here) and get the config def and list of files BundleType bundleType = bundle.getBundleType(); RecipeParseResults results; try { results = BundleManagerHelper.getPluginContainer().getBundleServerPluginManager() .parseRecipe(bundleType.getName(), recipe); } catch (Exception e) { // ensure that we throw a runtime exception to force a rollback throw new RuntimeException("Failed to parse recipe", e); } return createBundleVersionInternal(bundle, name, version, description, recipe, results.getConfigurationDefinition()); }
BundleType bundleType = bundleVersion.getBundle().getBundleType(); RecipeParseResults parseResults = BundleManagerHelper.getPluginContainer().getBundleServerPluginManager() .parseRecipe(bundleType.getName(), bundleVersion.getRecipe());
.parseRecipe(bundleType.getName(), bundleVersion.getRecipe());
throw new IllegalArgumentException("Bundle of type [" + bundle.getBundleType().getName() + "] is incompatible with resource type " + group.getResourceType()); String bundleType = bundle.getBundleType().getName(); ResourceType rt = group.getResourceType(); ResourceTypeBundleConfiguration bundleConfig = rt.getResourceTypeBundleConfiguration();
.parseRecipe(bundleType.getName(), recipe); } catch (Exception e) {