Examples of ConnectorConfig


Examples of com.sforce.ws.ConnectorConfig

public class Connector {

  public static final String END_POINT = "https://na3.salesforce.com/services/Soap/T/30.0";

  public static SoapConnection newConnection(String username, String password) throws ConnectionException {
    ConnectorConfig config = new ConnectorConfig();
    config.setUsername(username);
    config.setPassword(password);
    return newConnection(config);
  }
View Full Code Here

Examples of com.sforce.ws.ConnectorConfig

public class Connector {

  public static final String END_POINT = "https://login.salesforce.com/services/Soap/u/30.0";

  public static PartnerConnection newConnection(String username, String password) throws ConnectionException {
    ConnectorConfig config = new ConnectorConfig();
    config.setUsername(username);
    config.setPassword(password);
    return newConnection(config);
  }
View Full Code Here

Examples of com.sforce.ws.ConnectorConfig

    private final PartnerConnection _connection;

    public SalesforceDataContext(String endpoint, String username, String password, String securityToken) {
        try {
            ConnectorConfig config = new ConnectorConfig();
            config.setUsername(username);
            config.setPassword(password + securityToken);
            config.setAuthEndpoint(endpoint);
            config.setServiceEndpoint(endpoint);
            _connection = Connector.newConnection(config);
        } catch (ConnectionException e) {
            throw SalesforceUtils.wrapException(e, "Failed to log in to Salesforce service");
        }
    }
View Full Code Here

Examples of com.sforce.ws.ConnectorConfig

  public void setup() {
  }

  @Override
  public UserModel authenticate(String username, char[] password) {
    ConnectorConfig config = new ConnectorConfig();
    config.setUsername(username);
    config.setPassword(new String(password));

    try {
      PartnerConnection connection = Connector.newConnection(config);

      GetUserInfoResult info = connection.getUserInfo();
View Full Code Here

Examples of com.sforce.ws.ConnectorConfig

        verifyConnection(connector.getBulkConnection());
    }
   
    @Test
    public void testRenewSession() throws Exception {
        ConnectorConfig config = createConfig();
       
        ForceServiceConnector connector = new ForceServiceConnector();
        connector.renewSession(config);
        verifyConnection(connector.getConnection());
    }
View Full Code Here

Examples of com.sforce.ws.ConnectorConfig

public final class MockForceManagedConnection {
   
    @Mock
    public Object getConnection() {
        try {
            ConnectorConfig config = new ConnectorConfig();
            config.setManualLogin(true);
           
            // Just return a non-null PartnerConnection
            return new PartnerConnection(config);
        } catch (ConnectionException e) {
            throw new RuntimeException(e);
View Full Code Here

Examples of com.sforce.ws.ConnectorConfig

    }
   
    @Mock
    public MetadataConnection getMetadataConnection() throws ConnectionException {
        // Just return a non-null MetadataConnection
        return new MetadataConnection(new ConnectorConfig());
    }
View Full Code Here

Examples of com.sforce.ws.ConnectorConfig

    }
   
    @Mock
    public BulkConnection getBulkConnection() throws ConnectionException, AsyncApiException {
        // Just return a non-null BulkConnection
        return new BulkConnection(new ConnectorConfig());
    }
View Full Code Here

Examples of com.sforce.ws.ConnectorConfig

     * @param securityContext securityContext
     * @throws ConnectionException ConnectionException
     */
    public static void initializeSecurityContextFromApi(SecurityContext securityContext)
        throws ConnectionException {
        ConnectorConfig config = new ConnectorConfig();
        config.setServiceEndpoint(securityContext.getEndPoint());
        config.setSessionId(securityContext.getSessionId());
       
        GetUserInfoResult userInfoResult = Connector.newConnection(config).getUserInfo();
       
        securityContext.init(userInfoResult);

View Full Code Here

Examples of com.sforce.ws.ConnectorConfig

        Assert.assertNotNull(ForceServiceConnector.getThreadLocalConnectorConfig());
        SecurityContext sc = ForceSecurityContextHolder.get();
        Assert.assertEquals(sc.getUserName(), SpringSecurityTestData.SFDC_USERNAME);
        Assert.assertEquals(sc.getEndPoint(), SpringSecurityTestData.SFDC_ENDPOINT);
        Assert.assertEquals(sc.getSessionId(), SpringSecurityTestData.SFDC_SESSION_ID);
        ConnectorConfig cc = ForceServiceConnector.getThreadLocalConnectorConfig();
        Assert.assertEquals(cc.getServiceEndpoint(), SpringSecurityTestData.SFDC_ENDPOINT);
        Assert.assertNotNull(cc.getSessionRenewer());
    }
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.