Package com.salesforce.ide.core.remote

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


        }

        // not found in project, create one on fly
        if (packageManifest == null) {
            try {
                Connection connection = getConnectionFactory().getConnection(project);
                packageManifest = getDefaultPackageManifest(connection);
            } catch (Exception e) {
                logger.warn("Unable to create manifest from permissible object types.  Creating default manifest.");
                packageManifest = createDefaultPackageManifest();
            }
View Full Code Here


        genericManifest.setVersion(getProjectService().getLastSupportedEndpointVersion());
        return genericManifest;
    }

    public Package createPackageManifest(IProject project, boolean wildcard) throws ForceException {
        Connection connection = getConnectionFactory().getConnection(project);
        return createPackageManifest(connection, null);
    }
View Full Code Here

    }

    MetadataStubExt getNewMetadataStubExt(ForceProject forceProject) throws ForceConnectionException,
            ForceRemoteException {
        MetadataStubExt metadataStubExt = getMetadataStubExtInstance();
        Connection connection = getConnectionFactory().getConnection(forceProject);
        metadataStubExt.initializeMetadataConnection(connection);
        return metadataStubExt;
    }
View Full Code Here

    protected void refreshConnection(JoinPoint joinPoint) throws ForceConnectionException, ForceRemoteException {
        Object obj = joinPoint.getTarget();
        try {
            if (obj instanceof Connection) {
                Connection connection = (Connection) obj;
                connection = connectionFactory.refreshConnection(connection);
            } else if (obj instanceof MetadataStubExt) {
                MetadataStubExt metadataStubExt = (MetadataStubExt) obj;
                Connection connection = metadataStubExt.getConnection();
                connection = connectionFactory.refreshConnection(connection);
                metadataStubExt = metadataFactory.refreshMetadataStubExt(connection);
            } else if (obj instanceof ToolingStubExt) {
                ToolingStubExt toolingStubExt = (ToolingStubExt) obj;
                Connection connection = toolingStubExt.getConnection();
                connection = connectionFactory.refreshConnection(connection);
                toolingStubExt = toolingFactory.refreshToolingStubExt(connection);
            }
        } catch (Exception e) {
            logger.warn("Unable to refresh connection", e);
View Full Code Here

     *
     * @param joinPoint
     */
    public void setConnectionProxy(JoinPoint joinPoint) {
        // connection to-be inspect/adjusted
        Connection connection = null;

        if (joinPoint.getTarget() instanceof Connection) {
            connection = (Connection) joinPoint.getTarget();
        } else if (joinPoint.getTarget() instanceof MetadataStubExt) {
            MetadataStubExt stub = (MetadataStubExt) joinPoint.getTarget();
            connection = stub.getConnection();
        } else if (joinPoint.getTarget() instanceof ToolingStubExt) {
            ToolingStubExt stub = (ToolingStubExt) joinPoint.getTarget();
            connection = stub.getConnection();
        } else if (Utils.isNotEmpty(joinPoint.getArgs())) {
            Object[] objects = joinPoint.getArgs();
            for (Object object : objects) {
                if (object instanceof IProject && connectionFactory != null) {
                    try {
                        connection = connectionFactory.getConnection((IProject) object);
                    } catch (Exception e) {
                        logger.warn("Unable to get connection for project");
                    }
                    break;
                }
            }
        } else {
            logger.warn("Unable to set proxy settings - could not get Connection from joinpoint");
            return;
        }

        if (connection == null) {
            logger.warn("Unable to set proxy settings - could not get Connection from joinpoint");
            return;
        }

        // current proxy settings
        IProxy proxy = preferenceManager.getProxyManager().getProxy();

        // connection to-be inspect/adjusted

        // evaluate server root for exclusion
        String endpoint = connection.getServerName();
        if (Utils.isEmpty(endpoint)) {
            endpoint = connection.getForceProject().getEndpointServer();
        }

        if (proxy.isProxiesEnabled() && !proxy.isServerExcluded(endpoint)) {
            // update w/ last proxy settings
            updateConnectionProxy(connection, proxy);
        } else {
            // proxy is disabled, clear jvm-wide settings
            connection.getConnectorConfig().setProxy(Proxy.NO_PROXY);
            //clearConnectionProxySettings(connection);
        }

    }
View Full Code Here

    }

    private ToolingStubExt getNewToolingStubExt(ForceProject forceProject) throws ForceConnectionException,
            ForceRemoteException {
        ToolingStubExt stub = getToolingStubExtInstance();
        Connection connection = getConnectionFactory().getConnection(forceProject);
        stub.initializeToolingConnection(connection);
        return stub;
    }
View Full Code Here

        if (project == null) {
            logger.warn("Unable to load s-controls - project is null");
            return null;
        }

        Connection connection = getConnectionFactory().getConnection(project);
        SObject[] sobjects = connection.query(SoqlEnum.getScontrolsByContentSource("HTML")).getRecords();

        if (Utils.isEmpty(sobjects)) {
            logger.warn("Unable to load s-controls - returned s-controls of type 'HTML' is null or empty");
            return null;
        }
View Full Code Here

        if (project == null) {
            logger.warn("Unable to load snippets - project is null");
            return null;
        }

        Connection connection = getConnectionFactory().getConnection(project);
        SObject[] scontrols = connection.query(SoqlEnum.getScontrolsByContentSource("Snippet")).getRecords();

        if (Utils.isEmpty(scontrols)) {
            logger.warn("Unable to load snippets - returned scontrols is null or empty");
            return null;
        }
View Full Code Here

        this.salesforceEndpoints = salesforceEndpoints;
    }

    // lookup method injection by container
    public Connection getConnectionInstance() {
        return new Connection();
    }
View Full Code Here

        return new Connection();
    }

    protected Connection getNewConnection(ForceProject forceProject) throws ForceConnectionException,
            InsufficientPermissionsException {
        Connection connection = getConnectionInstance();
        connection.setForceProject(forceProject);
        connection.login();
        return connection;
    }
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.