Package com.salesforce.ide.core.remote

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


    public boolean removeConnection(ForceProject forceProject) {
        if (forceProject == null) {
            return false;
        }

        Connection obsoleteConnection = connections.remove(forceProject);
        if (forceProject.getProject() != null && Utils.isNotEmpty(forceProject.getProject().getName())) {
            describeObjectRegistry.remove(forceProject.getProject().getName());
        }

        return obsoleteConnection != null ? true : false;
View Full Code Here


        if (logger.isDebugEnabled()) {
            logStoredConnections();
        }

        Connection connection = null;
        if (connections != null && Utils.isNotEmpty(connections.keySet())) {
            logger.debug("Checking cache for existing connection for force project:\n "
                    + forceProject.getFullLogDisplay() + ", hash = " + forceProject.hashCode());
            connection = connections.get(forceProject);
        }

        if (connection == null) {
            connection = storeConnection(forceProject);
        } else {
            if (logger.isDebugEnabled()) {
                logger.debug("Got cached connection");
            }

            // test connection's session
            if (connection.isStale()) {
                connection.relogin();
            }
            // ensure that force options, eg clientid, are set
                connection.setClientCallOptions();
        }

        return connection;
    }
View Full Code Here

        if (forceProject == null) {
            throw new ForceConnectionException("Connection info must be specific to get a connection.");
        }

        connections.remove(forceProject);
        Connection connection = getNewConnection(forceProject);
        connections.put(forceProject, connection);

        if (logger.isDebugEnabled()) {
            logger.debug("Add new connection to cache:\n " + connection.getLogDisplay());
            logStoredConnections();
        }

        return connection;
    }
View Full Code Here

        return connection;
    }

    public Connection refreshConnection(ForceProject forceProject) throws ForceConnectionException,
            InsufficientPermissionsException {
        Connection connection = connections.get(forceProject);
        connection.relogin();

        if (logger.isDebugEnabled()) {
            logger.debug("Refreshed cached connection:\n " + connection.getLogDisplay());
            logStoredConnections();
        }

        return connection;
    }
View Full Code Here

    }

    public String getSavedSessionId(ForceProject forceProject) throws ForceConnectionException,
            InsufficientPermissionsException {
        String sessionId = "";
        Connection connection = getConnection(forceProject);
        if (connection != null) {
            sessionId = connection.getSessionId();
        }
        return sessionId;
    }
View Full Code Here

        Set<ForceProject> forceProjects = connections.keySet();
        StringBuffer strBuffer = new StringBuffer();
        strBuffer.append("Cached connections [" + connections.size() + "] are:");
        int connectionCnt = 0;
        for (ForceProject forceProject : forceProjects) {
            Connection connection = connections.get(forceProject);
            strBuffer.append("\n (").append(++connectionCnt).append(") ").append("project: ").append(
                forceProject.getFullLogDisplay()).append(", hash = ").append(forceProject.hashCode()).append(
                "\n     connection: ");
            if (connection != null) {
                strBuffer.append(connection.getLogDisplay());
            } else {
                strBuffer.append("n/a");
            }
        }
        logger.info(strBuffer.toString());
View Full Code Here

        ForceProject forceProject = ContainerDelegate.getInstance().getServiceLocator().getProjectService().getForceProject(model.getProject());
        ContainerDelegate.getInstance().getFactoryLocator().getConnectionFactory().removeConnection(forceProject);
        ContainerDelegate.getInstance().getFactoryLocator().getMetadataFactory().removeMetadataStubExt(forceProject);
        ContainerDelegate.getInstance().getFactoryLocator().getToolingFactory().removeToolingStubExt(forceProject);
        forceProject.setEndpointApiVersion(installedIdeVersion);
        Connection connection = ContainerDelegate.getInstance().getFactoryLocator().getConnectionFactory().getConnection(forceProject);

        // perform retrieve
        RetrieveResultExt retrieveResultHandler = null;
        try {
            retrieveResultHandler = ContainerDelegate.getInstance().getServiceLocator().getPackageRetrieveService().retrieveSelective(connection,
View Full Code Here

                    project, monitor);
        } catch (ServiceTimeoutException ex) {
            retrieveResultHandler = ContainerDelegate.getInstance().getServiceLocator().getPackageRetrieveService().handleRetrieveServiceTimeoutException(
                    ex, "upgrade resource(s)", monitor);
            if (retrieveResultHandler != null) {
                Connection connection = ContainerDelegate.getInstance().getFactoryLocator().getConnectionFactory().getConnection(project);
                ProjectPackageList projectPackageList = ContainerDelegate.getInstance().getServiceLocator().getProjectService().getProjectPackageFactory().getManagedInstalledProjectPackages(
                        connection);
                if (projectPackageList != null) {
                    projectPackageList.setProject(project);
                }
View Full Code Here

    public ExecuteAnonymousResultExt executeAnonymous(String code, IProject project) {
        LogInfo[] apexLogInfo =
                getLoggingService().getAllApexApiLogInfo(project, LoggingInfo.SupportedFeatureEnum.ExecuteAnonymous);
        int readTimeout = getProjectService().getReadTimeoutInMilliSeconds(project);
        Connection connection = null;
        try {
            connection = getConnectionFactory().getConnection(project);
            return executeAnonymous(code, apexLogInfo, connection, readTimeout);
        } catch (Exception e) {
            ExecuteAnonymousResult er =
                    errorExecuteAnonymousResult(connection != null ? connection.getConnectorConfig() : null, e);
            return new ExecuteAnonymousResultExt(er, null);
        }
    }
View Full Code Here

            throws ForceConnectionException, ServiceException, ForceRemoteException, FactoryException,
            ForceRemoteException, InterruptedException {
        if (project == null) {
            throw new IllegalArgumentException("Project cannot be null");
        }
        Connection connection = getConnectionFactory().getConnection(project);
        Package defaultMainfest = null;
        if (includeDefaultManifest) {
            defaultMainfest = getPackageManifestFactory().getDefaultPackageManifest(project);
        }
        RetrieveResultExt retrieveResultHandler = retrieveAll(connection, defaultMainfest, 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.