Examples of QueryContext


Examples of org.wso2.carbon.component.mgt.core.query.QueryContext

        }
        return installedUnitsMap;
    }

    public static HashMap<String, IInstallableUnit> getAllInstalledUnitsMap() {
        QueryContext queryContext = new QueryContext();
        IInstallableUnit[] installedUnits = ProvisioningUtils.getAllInstalledIUs(queryContext);
        return getInstalledUnitsMap(installedUnits);
    }
View Full Code Here

Examples of org.wso2.carbon.component.mgt.core.query.QueryContext

     * @param features - list of features
     * @return - true if all are installed, else false
     */
    public static boolean areAllFeaturesInstalled(List<Feature> features) {
        for (Feature feature : features) {
            QueryContext queryContext = new QueryContext();
            queryContext.setQueryable(ProvisioningUtils.getProfile());
            queryContext.setQuery(new InstallableUnitQuery(feature.getId(),
                    feature.getVersionRange()));
            InstalledIUQuery installedIUQuery = new InstalledIUQuery(queryContext);
            IInstallableUnit[] installableUnits = ProvisioningUtils.
                    performIUQuery(installedIUQuery);
            if (installableUnits == null || installableUnits.length == 0) {
View Full Code Here

Examples of org.wso2.carbon.component.mgt.core.query.QueryContext

     * @throws AxisFault if an exception occurs while quering the list of features.
     */
    public Feature[] getAllInstalledFeatures() throws AxisFault {
        Feature[] features = null;
        try {
            QueryContext queryContext = new QueryContext();
            queryContext.setQueryable(ProvisioningUtils.getProfile());
            InstalledIUQuery installedIUQuery = new InstalledIUQuery(queryContext);
            features = ProvWSUtils.wrapInstalledFeatures(ProvisioningUtils.performIUQuery(installedIUQuery),
                    queryContext.getQueryable());
        } catch (Exception e) {
            handleException("Error occured quering installed features",
                    "failed.get.installed.features", e);
        }
        return features;
View Full Code Here

Examples of org.wso2.carbon.component.mgt.core.query.QueryContext

     * @throws AxisFault if an exception occurs while quering specified feature information
     */
    public FeatureInfo getInstalledFeatureInfo(String featureID, String featureVersion) throws AxisFault {
        FeatureInfo featureInfo = null;
        try {
            QueryContext queryContext = new QueryContext();
            queryContext.setQueryable(ProvisioningUtils.getProfile());
            queryContext.setQuery(new InstallableUnitQuery(featureID, Version.create(featureVersion)));
            InstalledIUQuery installedIUQuery = new InstalledIUQuery(queryContext);
            IInstallableUnit[] installableUnits = ProvisioningUtils.performIUQuery(installedIUQuery);
            if (installableUnits == null || installableUnits.length == 0) {
                log.error("Error occured while quering feature information :" + featureID + "-" + featureVersion);
                throw new AxisFault("failed.get.feature.information");
View Full Code Here

Examples of org.wso2.carbon.component.mgt.core.query.QueryContext

    private void removeConsoleOrServerFeatures(String propertyValue) throws Exception {
        List<IInstallableUnit> iusToUninstall = new ArrayList<IInstallableUnit>();
        List<IInstallableUnit> iusToInstall = new ArrayList<IInstallableUnit>();

        QueryContext queryContext = new QueryContext();
        IInstallableUnit[] allInstalledIUs = ProvisioningUtils.getAllInstalledIUs(queryContext);
        for (IInstallableUnit iu : allInstalledIUs) {
            String categoryPropValue = iu.getProperty("org.wso2.carbon.p2.category.type");

            if (iu.getId().startsWith("org.eclipse.equinox")) {
View Full Code Here

Examples of org.wso2.carbon.component.mgt.core.query.QueryContext

        Feature[] features = null;
        try {
            if (location != null) {
                repoURI = new URI(location);
            }
            QueryContext queryContext = new QueryContext();
            queryContext.setShowLatestVersionsOnly(showOnlyTheLatestFeatures);
            queryContext.setQueryable(RepositoryUtils.getQuerybleRepositoryManager(repoURI));
            AvailableIUQuery availableIUQuery = new AvailableIUQuery(queryContext);
            IInstallableUnit[] installableUnits = ProvisioningUtils.performIUQuery(availableIUQuery);
            features = ProvWSUtils.wrapAvailableFeatures(installableUnits, queryContext.getQueryable());
        } catch (URISyntaxException e) {
            handleException("Invalid Repository Location :" + location, "invalid.repo.location", e);
        } catch (Exception e) {
            handleException("Error occured while quering installable features",
                    "failed.get.installable.features", e);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.