Package com.salesforce.ide.core.remote

Examples of com.salesforce.ide.core.remote.Connection


    public TreeSet<String> getRemotePackageNames(IProgressMonitor monitor) throws InterruptedException, Exception {
        TreeSet<String> packageNames = new TreeSet<String>();

        // temporarily set timeout
        int timeoutMillis = getProjectModel().getForceProject().getReadTimeoutMillis();
        Connection connection = null;
        try {
            monitorCheck(monitor);
            connection =
                    ContainerDelegate.getInstance().getFactoryLocator().getConnectionFactory()
                            .getConnection(getProjectModel().getForceProject());
            connection.setTimeoutMillis(Constants.INTERNAL_TIMEOUT_MILLIS);
            getProjectModel().setConnection(connection);

            monitorCheck(monitor);
            ProjectPackageList projectPackageList =
                    ContainerDelegate.getInstance().getServiceLocator().getProjectService().getProjectPackageFactory()
                            .getDevelopmentAndUnmanagedInstalledProjectPackages(connection);
            String[] packageNameArray = projectPackageList.getPackageNames();
            if (Utils.isNotEmpty(packageNameArray)) {
                packageNames.addAll(Arrays.asList(packageNameArray));
            }
        } catch (InterruptedException e) {
            throw e;
        } catch (Exception e) {
            logger.warn("Unable to get project packages for project '" + getProjectModel().getProjectName() + "': "
                    + ForceExceptionUtils.getRootExceptionMessage(e));
            throw e;
        } finally {
            // set timeout back to users desired limit
            if (connection != null) {
                connection.setTimeoutMillis(timeoutMillis);
            }
        }
        return packageNames;
    }
View Full Code Here


        if (getProjectModel() == null || getProjectModel().getForceProject() == null) {
            logger.warn("Unable to get enabled component types for project - Force project is null");
            return null;
        }

        Connection connection =
                ContainerDelegate.getInstance().getFactoryLocator().getConnectionFactory()
                        .getConnection(getProjectModel().getForceProject());
        getProjectModel().setConnection(connection);
        return ContainerDelegate.getInstance().getServiceLocator().getMetadataService()
                .listMetadata(connection, listMetadataQueryArray, monitor);
View Full Code Here

        packageManifestModel.setFileMetadatExt(fileMetadata);
    }

    // get list metadata types that cover default option
    public void prepareFileMetadataQueries(IProgressMonitor monitor) throws InterruptedException, Exception {
        Connection connection =
                ContainerDelegate.getInstance().getFactoryLocator().getConnectionFactory()
                        .getConnection(getProjectModel().getForceProject());
        getProjectModel().setConnection(connection);
        listMetadataQueries =
                ContainerDelegate.getInstance().getServiceLocator().getMetadataService()
View Full Code Here

        DeploymentComponentSet selectedDashboards =
                deploymentController.getDeploymentPayload().getDeploySelectedComponentsByType(Constants.DASHBOARD);
        replaceRunningUserSet = new DeploymentComponentSet();

        ForceProject destinationOrg = deploymentController.getDeploymentWizardModel().getDestinationOrg();
        Connection connection = ContainerDelegate.getInstance().getFactoryLocator().getConnectionFactory().getConnection(destinationOrg);
        for (DeploymentComponent selectedDashboard : selectedDashboards) {
            String currentRunningUser = selectedDashboard.getRunningUser();
            QueryResult result =
                    connection.query("select userName from user where userName='" + currentRunningUser + "'");
            if (Utils.isEmpty(result) || result.getRecords().length == 0) {
                replaceRunningUserSet.add(selectedDashboard);
            }
        }
    }
View Full Code Here

     * @return
     * @throws ForceRemoteException
     */
    public boolean replaceRunningUserWith(String userInputRunningUser) {
        ForceProject destinationOrg = deploymentController.getDeploymentWizardModel().getDestinationOrg();
        Connection connection;
        QueryResult result = null;
        try {
            connection = ContainerDelegate.getInstance().getFactoryLocator().getConnectionFactory().getConnection(destinationOrg);
            result = connection.query("select userName from user where userName='" + userInputRunningUser + "'");
        } catch (Exception e) {
            logger.warn(e);
            return false;
        }
        if (Utils.isEmpty(result) || result.getRecords().length == 0 || Utils.isEmpty(replaceRunningUserSet)) {
View Full Code Here

    public DeployResultExt deploy(ProjectPackageList projectPackageList, IProgressMonitor monitor)
            throws ServiceException, ForceRemoteException, InterruptedException, ForceConnectionException {
        if (Utils.isEmpty(projectPackageList) || projectPackageList.getProject() == null) {
            throw new IllegalArgumentException("Project and/or project package list cannot be null");
        }
        Connection connection = getConnectionFactory().getConnection(projectPackageList.getProject());
        return deploy(connection, projectPackageList, monitor);
    }
View Full Code Here

    public DeployResultExt deploy(ProjectPackageList projectPackageList, IProgressMonitor monitor, DeployOptions options)
            throws ServiceException, ForceRemoteException, InterruptedException, ForceConnectionException {
        if (Utils.isEmpty(projectPackageList) || projectPackageList.getProject() == null) {
            throw new IllegalArgumentException("Project and/or project package list cannot be null");
        }
        Connection connection = getConnectionFactory().getConnection(projectPackageList.getProject());
        return deploy(connection, projectPackageList, options, monitor);
    }
View Full Code Here

            IProgressMonitor monitor) throws ServiceException, ForceRemoteException, InterruptedException,
            ForceConnectionException {
        if (Utils.isEmpty(projectPackageList) || projectPackageList.getProject() == null) {
            throw new IllegalArgumentException("Project and/or project package list cannot be null");
        }
        Connection connection = getConnectionFactory().getConnection(projectPackageList.getProject());
        return deployDelete(connection, projectPackageList, checkOnly, monitor);
    }
View Full Code Here

TOP

Related Classes of com.salesforce.ide.core.remote.Connection

Copyright © 2018 www.massapicom. 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.