private FeatureParameterSpec(Builder builder) throws ProvisioningDescriptionException { if (builder.featureId && builder.nillable) { throw new ProvisioningDescriptionException("ID parameter " + builder.name + " cannot be nillable."); } this.name = builder.name; this.featureId = builder.featureId; this.nillable = builder.nillable; this.defaultValue = builder.defaultValue; this.type = builder.type; }
FeaturePackPackagesConfigParser10.readPackages(reader, depBuilder); } catch (ProvisioningDescriptionException e) { throw new XMLStreamException("Failed to parse " + Element.PACKAGES.getLocalName() + ": " + e.getLocalizedMessage(), reader.getLocation(), e);
throw new XMLStreamException("Failed to parse layers configuration: " + e.getMessage(), reader.getLocation());
FeaturePackPackagesConfigParser10.readPackages(reader, depBuilder); } catch (ProvisioningDescriptionException e) { throw new XMLStreamException("Failed to parse " + Element.PACKAGES.getLocalName() + ": " + e.getLocalizedMessage(), reader.getLocation(), e);
private FeatureParameterSpec(String name, boolean featureId, boolean nillable, String defaultValue) throws ProvisioningDescriptionException { if (featureId && nillable) { throw new ProvisioningDescriptionException("ID parameter " + name + " cannot be nillable."); } this.name = name; this.featureId = featureId; this.nillable = nillable; this.defaultValue = defaultValue; this.type = Constants.BUILT_IN_TYPE_STRING; }
FeaturePackPackagesConfigParser10.readPackages(reader, depBuilder); } catch (ProvisioningDescriptionException e) { throw new XMLStreamException("Failed to parse " + Element.PACKAGES.getLocalName() + ": " + e.getLocalizedMessage(), reader.getLocation(), e);
private static void formatException(String s) throws ProvisioningDescriptionException { throw new ProvisioningDescriptionException('\'' + s + "' does not follow format spec_name:param_name=value(,param_name=value)*"); }
private static void formatError(String str) throws ProvisioningDescriptionException { throw new ProvisioningDescriptionException("Capability '" + str + "' doesn't follow format [$]part[.[$]part]"); }
private void transitiveDoesNotDefineConfigs() throws ProvisioningDescriptionException { throw new ProvisioningDescriptionException("Transitive dependency does not define configs"); }
private static void formatException(String str) throws ProvisioningDescriptionException { throw new ProvisioningDescriptionException("'" + str + "' does not follow format {producer[@universe]:channel}spec_name:param_name=value(,param_name=value)*"); }
public UniverseSpec getUniverseSpec(String name) throws ProvisioningDescriptionException { final UniverseSpec universe = name == null ? defaultUniverse : universeSpecs.get(name); if(universe == null) { throw new ProvisioningDescriptionException((name == null ? "The default" : name) + " universe was not configured"); } return universe; }
public String getElement(String elem, boolean required) throws ProvisioningDescriptionException { final String value = elems.get(elem); if(value == null) { if(required) { throw new ProvisioningDescriptionException("Annotation " + name + " is missing required element " + elem); } return null; } return value; }
public static Path getLayerSpecXml(Path fpDir, String model, String name, boolean existing) throws ProvisioningDescriptionException { Path p = fpDir.resolve(Constants.LAYERS); if(model != null) { p = p.resolve(model); } p = p.resolve(name).resolve(Constants.LAYER_SPEC_XML); if(existing && !Files.exists(p)) { throw new ProvisioningDescriptionException("Failed to locate XML file describing configuration layer " + name + " at " + p); } return p; }
public Builder removeIncludedPackage(String pkg) throws ProvisioningDescriptionException { if (!includedPackages.containsKey(pkg)) { throw new ProvisioningDescriptionException("Package " + pkg + " is not included into the configuration"); } includedPackages = CollectionUtils.remove(includedPackages, pkg); return this; }
public FeatureReferenceSpec getFeatureRef(String name) throws ProvisioningDescriptionException { final FeatureReferenceSpec ref = featureRefs.get(name); if(ref == null) { throw new ProvisioningDescriptionException(Errors.featureRefNotInSpec(name, this.name)); } return ref; }
public FeatureParameterSpec getParam(String name) throws ProvisioningDescriptionException { final FeatureParameterSpec paramSpec = params.get(name); if(paramSpec == null) { throw new ProvisioningDescriptionException(Errors.unknownFeatureParameter(this.name, name)); } return paramSpec; }
@SuppressWarnings("unchecked") public B includeConfigModel(String name) throws ProvisioningDescriptionException { if(excludedModels.containsKey(name)) { throw new ProvisioningDescriptionException("Model " + name + " has been excluded"); } includedModels = CollectionUtils.add(includedModels, name); return (B) this; }
@SuppressWarnings("unchecked") public B includeDefaultConfig(ConfigId configId) throws ProvisioningDescriptionException { if(includedConfigs.contains(configId)) { throw new ProvisioningDescriptionException("Config model with id " + configId + " has already been included into the configuration"); } includedConfigs = CollectionUtils.add(includedConfigs, configId); return (B) this; }
private ResolvedFeatureSpec getFeatureSpec(FeaturePackRuntimeBuilder origin, String name, boolean switchOrigin) throws ProvisioningException { final ResolvedFeatureSpec resolvedSpec = findFeatureSpec(origin, name, switchOrigin); clearVisitedFPs(); if(resolvedSpec == null) { if(origin == null) { throw new ProvisioningDescriptionException("Failed to locate feature spec '" + name + "' in the installed feature-packs."); } throw new ProvisioningDescriptionException("Failed to locate feature spec '" + name + "' in " + origin.producer + " and its dependencies."); } return resolvedSpec; }
public Builder removeExcludedPackage(String pkg) throws ProvisioningDescriptionException { if (!excludedPackages.contains(pkg)) { throw new ProvisioningDescriptionException("Package " + pkg + " is not excluded from the configuration"); } excludedPackages = CollectionUtils.remove(excludedPackages, pkg); return this; }