public RequiredCapability(String namespace, String name, VersionRange range, String filter, boolean optional, boolean multiple, boolean greedy) { this(namespace, name, range, filter == null ? (IMatchExpression<IInstallableUnit>) null : InstallableUnit.parseFilter(filter), optional ? 0 : 1, multiple ? Integer.MAX_VALUE : 1, greedy, null); }
public Slicer(IQueryable<IInstallableUnit> input, Map<String, String> context, boolean considerMetaRequirements) { this(input, InstallableUnit.contextIU(context), considerMetaRequirements); }
public static IInstallableUnit contextIU(String ws, String os, String arch) { InstallableUnit ctxIU = new InstallableUnit(); ctxIU.setId("org.eclipse.equinox.p2.context.iu"); //$NON-NLS-1$ ctxIU.setProperty("osgi.ws", ws); //$NON-NLS-1$ ctxIU.setProperty("osgi.os", os); //$NON-NLS-1$ ctxIU.setProperty("osgi.arch", arch); //$NON-NLS-1$ return ctxIU; }
InstallableUnit unit() { if (unit == null) { unit = new InstallableUnit(); unit.setArtifacts(new IArtifactKey[0]); } return unit; }
public void setFilter(String filter) { setFilter(parseFilter(filter)); }
private static void addExtraProperties(IInstallableUnit iiu, Map<String, String> extraProperties) { if (iiu instanceof InstallableUnit) { InstallableUnit iu = (InstallableUnit) iiu; for (Entry<String, String> entry : extraProperties.entrySet()) { iu.setProperty(entry.getKey(), entry.getValue()); } } } }
private static void addExtraProperties(IInstallableUnit iiu, Map<String, String> extraProperties) { if (iiu instanceof InstallableUnit) { InstallableUnit iu = (InstallableUnit) iiu; for (Entry<String, String> entry : extraProperties.entrySet()) { iu.setProperty(entry.getKey(), entry.getValue()); } } } }
/** * Returns the LDAP filter form that matches the given config spec. Returns * an empty String if the spec does not identify an ws, os or arch. * @param configSpec a config spec to filter * @return the LDAP filter for the given spec. <code>null</code> if the given spec does not * parse into a filter. */ protected IMatchExpression<IInstallableUnit> createFilterSpec(String configSpec) { String ldap = createLDAPString(configSpec); if (ldap == null) return null; return InstallableUnit.parseFilter(ldap); }
public Slicer(IQueryable<IInstallableUnit> input, Map<String, String> context, boolean considerMetaRequirements) { this(input, InstallableUnit.contextIU(context), considerMetaRequirements); }
public static IInstallableUnit contextIU(Map<String, String> environment) { InstallableUnit ctxIU = new InstallableUnit(); ctxIU.setId("org.eclipse.equinox.p2.context.iu"); //$NON-NLS-1$ for (Map.Entry<String, String> entry : environment.entrySet()) ctxIU.setProperty(entry.getKey(), entry.getValue()); return ctxIU; } }
private static void addExtraProperties(IInstallableUnit iiu, Map<String, String> extraProperties) { if (iiu instanceof InstallableUnit) { InstallableUnit iu = (InstallableUnit) iiu; for (Entry<String, String> entry : extraProperties.entrySet()) { iu.setProperty(entry.getKey(), entry.getValue()); } } } }
/** * Returns the LDAP filter form that matches the given config spec. Returns * an empty String if the spec does not identify an ws, os or arch. * @param configSpec a config spec to filter * @return the LDAP filter for the given spec. <code>null</code> if the given spec does not * parse into a filter. */ protected IMatchExpression<IInstallableUnit> createFilterSpec(String configSpec) { String ldap = createLDAPString(configSpec); if (ldap == null) return null; return InstallableUnit.parseFilter(ldap); }
public Projector(IQueryable<IInstallableUnit> q, Map<String, String> context, Set<IInstallableUnit> nonGreedyIUs, boolean considerMetaRequirements) { picker = q; slice = new HashMap<>(); selectionContext = InstallableUnit.contextIU(context); abstractVariables = new ArrayList<>(); allOptionalAbstractRequirements = new ArrayList<>(); result = new MultiStatus(DirectorActivator.PI_DIRECTOR, IStatus.OK, Messages.Planner_Problems_resolving_plan, null); assumptions = new ArrayList<>(); this.nonGreedyIUs = nonGreedyIUs; this.considerMetaRequirements = considerMetaRequirements; }
/** * Set a property with a specified value for this installable unit. * @param key key with which the specified value is to be associated * @param value value to be associated with the specified key */ public void setProperty(String key, String value) { unit().setProperty(key, value); }
protected IRequirement createRequirement(String namespace, String name, VersionRange range, String filter, int min, int max, boolean greedy) { IMatchExpression<IInstallableUnit> filterExpression = InstallableUnit.parseFilter(filter); return MetadataFactory.createRequirement(namespace, name, range, filterExpression, min, max, greedy); }
protected boolean isApplicable(Map<String, String> selectionContext, IMatchExpression<IInstallableUnit> filter) { if (filter == null) { return true; } return filter.isMatch(InstallableUnit.contextIU(selectionContext)); }
protected IRequirement createRequirement(String namespace, String name, VersionRange range, String filter, int min, int max, boolean greedy) { IMatchExpression<IInstallableUnit> filterExpression = InstallableUnit.parseFilter(filter); return MetadataFactory.createRequirement(namespace, name, range, filterExpression, min, max, greedy); }
protected boolean filterMatches(IMatchExpression<IInstallableUnit> filter, String configSpec) { if (filter == null) return true; String[] config = parseConfigSpec(configSpec); return filter.isMatch(InstallableUnit.contextIU(config[0], config[1], config[2])); }
/** * Returns the LDAP filter form that matches the given config spec. Returns * an empty String if the spec does not identify an ws, os or arch. * @param configSpec a config spec to filter * @return the LDAP filter for the given spec. <code>null</code> if the given spec does not * parse into a filter. */ protected IMatchExpression<IInstallableUnit> createFilterSpec(String configSpec) { String ldap = createLDAPString(configSpec); if (ldap == null) return null; return InstallableUnit.parseFilter(ldap); }
protected boolean filterMatches(IMatchExpression<IInstallableUnit> filter, String configSpec) { if (filter == null) return true; String[] config = parseConfigSpec(configSpec); return filter.isMatch(InstallableUnit.contextIU(config[0], config[1], config[2])); }