Package com.force.sdk.connector

Examples of com.force.sdk.connector.ForceServiceConnector


            // Use the value from session and not the login endpoint
            request.setAttribute(LogoutSuccessHandler.FORCE_ENDPOINT_ATTRIBUTE, sc.getEndPoint());
            config.setServiceEndpoint(sc.getEndPoint());
            config.setSessionId(sc.getSessionId());
            config.setSessionRenewer(this);
            ForceServiceConnector connector = new ForceServiceConnector();
            connector.setConnectorConfig(config);
            //logout from the partner API
            connector.getConnection().logout();
        } catch (ConnectionException e) {
            if (config.getSessionId() != null) {
                // If the session id is null that means we visited the renewer method below and the session is dead anyways
                throw new AuthenticationServiceException("Unable to logout from Salesforce", e);
            }
View Full Code Here


    private PartnerConnection getPartnerConnection() throws ConnectionException {
        ForceConnectorConfig config = new ForceConnectorConfig();
        config.setAuthEndpoint(TestContext.get().getUserInfo().getServerEndpoint());
        config.setUsername(TestContext.get().getUserInfo().getUserName());
        config.setPassword(TestContext.get().getUserInfo().getPassword());
        return new ForceServiceConnector(config).getConnection();
    }
View Full Code Here

            createEntityManagerFactories();
            createAdditionalEntityManagers();
        }

        populateTestContext(getTestName(), UserInfo.loadFromPropertyFile(PropsUtil.FORCE_SDK_TEST_NAME));
        ForceServiceConnector connector = new ForceServiceConnector(PropsUtil.FORCE_SDK_TEST_NAME);
        service = connector.getConnection();
    }
View Full Code Here

       
        ForceConnectorConfig conf = new ForceConnectorConfig();
        conf.setUsername(username);
        conf.setPassword(password);
        conf.setAuthEndpoint(authEndpoint);
        ForceServiceConnector conn = new ForceServiceConnector(conf);
        PartnerConnection service = conn.getConnection();
        return service;
    }
View Full Code Here

        // This will instantiate a ForceSeviceConnector with the given connectionName.
        // ForceServiceConnector f = new ForceServiceConnector("integrationserver");

        // This will use ForceServiceConnector assigned to the ThreadLocal.
        ForceServiceConnector f = new ForceServiceConnector();
        PartnerConnection conn = f.getConnection();


        GetUserInfoResult userInfoResult = conn.getUserInfo();

        StringBuffer value = new StringBuffer();
View Full Code Here

            // (as defined in pom.xml under build-helper-maven-plugin)
            String generatedFileDir = props.getProperty("project.root") + File.separator + "target"
                                        + File.separator + "generated-test-files";
           
            // Load the connection information from java-sdk-test.properties
            ForceServiceConnector connector = new ForceServiceConnector(PropsUtil.FORCE_SDK_TEST_NAME);
           
            generator.generateCode(connector.getConnection(), new File(generatedFileDir));
        } finally {
            is.close();
        }
    }
View Full Code Here

    }

    @Test
    public void testLoginWithSessionIdAndEndpoint() throws Exception {
        MockHttpServletRequest request = new MockHttpServletRequest();
        ForceServiceConnector connector = new ForceServiceConnector("userInfo");
       
        // Add session id and endpoint cookies to the request
        Cookie sidCookie =
            new Cookie(SecurityContextUtil.FORCE_FORCE_SESSION, connector.getConnection().getSessionHeader().getSessionId());
        Cookie endpointCookie =
            new Cookie(SecurityContextUtil.FORCE_FORCE_ENDPOINT, connector.getConnection().getConfig().getServiceEndpoint());
        request.setCookies(sidCookie, endpointCookie);
       
        MockHttpServletResponse response = new MockHttpServletResponse();
       
        try {
View Full Code Here

    }
   
    @Test
    public void testLoginWithSessionIdAndEndpointNoUsername() throws Exception {
        MockHttpServletRequest request = new MockHttpServletRequest();
        ForceServiceConnector connector = new ForceServiceConnector("userInfo");
       
        // Add session id and endpoint cookies to the request
        Cookie sidCookie =
            new Cookie(SecurityContextUtil.FORCE_FORCE_SESSION, connector.getConnection().getSessionHeader().getSessionId());
        Cookie endpointCookie =
            new Cookie(SecurityContextUtil.FORCE_FORCE_ENDPOINT, connector.getConnection().getConfig().getServiceEndpoint());
        request.setCookies(sidCookie, endpointCookie);
       
        MockHttpServletResponse response = new MockHttpServletResponse();
       
        try {
View Full Code Here

            config.setUsername(userInfo.getUserName());
            config.setPassword(userInfo.getPassword());
            String userRole = null;
           
            try {
                ForceServiceConnector forceConn = new ForceServiceConnector(config);
                PartnerConnection partnerConn = forceConn.getConnection();
                QueryResult qr = partnerConn.query("select ProfileId from User where Id='" + userInfo.getUserId() + "'");
                String profileId = (String) qr.getRecords()[0].getField("ProfileId");
                qr = partnerConn.query("select Name from Profile where Id='" + profileId + "'");
                userRole = (String) qr.getRecords()[0].getField("Name");
            } catch (ConnectionException e) {
View Full Code Here

TOP

Related Classes of com.force.sdk.connector.ForceServiceConnector

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.