当前位置: 首页>>代码示例>>Java>>正文


Java ConnectorConfig.setAuthEndpoint方法代码示例

本文整理汇总了Java中com.sforce.ws.ConnectorConfig.setAuthEndpoint方法的典型用法代码示例。如果您正苦于以下问题:Java ConnectorConfig.setAuthEndpoint方法的具体用法?Java ConnectorConfig.setAuthEndpoint怎么用?Java ConnectorConfig.setAuthEndpoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sforce.ws.ConnectorConfig的用法示例。


在下文中一共展示了ConnectorConfig.setAuthEndpoint方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createPartnerConnection

import com.sforce.ws.ConnectorConfig; //导入方法依赖的package包/类
private PartnerConnection createPartnerConnection() throws Exception {
    ConnectorConfig config = new ConnectorConfig();
    LOG.debug("Connecting SF Partner Connection using " + username);
    config.setUsername(username);
    config.setPassword(password);
    String authEndpoint = getAuthEndpoint(loginURL);
    LOG.info("loginURL : " + authEndpoint);
    config.setAuthEndpoint(authEndpoint);
    config.setServiceEndpoint(authEndpoint);

    try {
        return Connector.newConnection(config);
    } catch (ConnectionException ce) {
        LOG.error("Exception while creating connection", ce);
        throw new Exception(ce);
    }
}
 
开发者ID:springml,项目名称:salesforce-wave-api,代码行数:18,代码来源:SFConfig.java

示例2: fetchSFDCinfo

import com.sforce.ws.ConnectorConfig; //导入方法依赖的package包/类
/**
 * Fetching the Salesforce UserInfo along with session id.
 * @return
 */
public static SFDCInfo fetchSFDCinfo() {
	App.logInfo("Fetching SalesForce Data");
	if(App.sfdcInfo.getSessionId() != null) return App.sfdcInfo;
	try {
		ConnectorConfig config = new ConnectorConfig();
		config.setUsername(App.getUserName());
		config.setPassword(App.getUserPassword() + App.getSecurityToken());
		config.setAuthEndpoint(App.getPartnerUrl());
		partnerConnection = Connector.newConnection(config);
		GetUserInfoResult userInfo = partnerConnection.getUserInfo();
		
		App.sfdcInfo.setOrg(userInfo.getOrganizationId());
		App.sfdcInfo.setUserId(userInfo.getUserId());
		App.sfdcInfo.setSessionId(config.getSessionId());
		String sept = config.getServiceEndpoint();
		sept = sept.substring(0, sept.indexOf(".com") + 4);
		App.sfdcInfo.setEndpoint(sept);
		
		App.logInfo("SDCF Info:\n" + App.sfdcInfo.toString());
		return App.sfdcInfo;
	} catch (ConnectionException ce) {
		ce.printStackTrace();
		return null;
	}
}
 
开发者ID:sunand85,项目名称:DF14_Demo,代码行数:30,代码来源:SFDCUtil.java

示例3: initializeConnectorConfig

import com.sforce.ws.ConnectorConfig; //导入方法依赖的package包/类
private void initializeConnectorConfig(ConnectorConfig connectorConfig) {
    if (forceProject == null) {
        throw new IllegalArgumentException("Object containing connection details cannot be null");
    }

    connectorConfig.setCompression(true);
    if (Utils.isEmpty(forceProject.getSessionId())) {
        connectorConfig.setManualLogin(true);
        connectorConfig.setUsername(forceProject.getUserName());
        connectorConfig.setPassword(forceProject.getPassword() + forceProject.getToken());
    } else {
        connectorConfig.setManualLogin(false);
        connectorConfig.setSessionId(forceProject.getSessionId());
    }

    connectorConfig.setReadTimeout(forceProject.getReadTimeoutMillis());
    connectorConfig.setConnectionTimeout(forceProject.getReadTimeoutMillis());

    if (Utils.isNotEmpty(forceProject.getEndpointServer())) {
        final String endpointUrl =
                salesforceEndpoints.getFullEndpointUrl(forceProject.getEndpointServer(),
                    forceProject.isHttpsProtocol());
        connectorConfig.setAuthEndpoint(endpointUrl);
        connectorConfig.setServiceEndpoint(connectorConfig.getAuthEndpoint());
    } 
}
 
开发者ID:forcedotcom,项目名称:idecore,代码行数:27,代码来源:Connection.java

示例4: login

import com.sforce.ws.ConnectorConfig; //导入方法依赖的package包/类
public boolean login(String username, String password, String endpoint) {
  
  boolean success = false;
  
  String authEndPoint = (endpoint != null) ? endpoint : DEFAULT_ENDPOINT;

  try {
    ConnectorConfig config = new ConnectorConfig();
    config.setUsername(username);
    config.setPassword(password);
    
    config.setAuthEndpoint(authEndPoint);
    config.setTraceMessage(true);
    config.setPrettyPrintXml(true);

    conn = new PartnerConnection(config);          

    success = true;
  } catch (ConnectionException ce) {
    logger.log(Level.SEVERE, null, ce);
  } 
  
  return success;
}
 
开发者ID:PDI-DGS-Protolab,项目名称:esper-salesforce,代码行数:25,代码来源:SalesforceClient.java

示例5: loginToSalesforce

import com.sforce.ws.ConnectorConfig; //导入方法依赖的package包/类
private static LoginResult loginToSalesforce(
        final String username,
        final String password,
        final String loginUrl) throws ConnectionException {
    final ConnectorConfig config = new ConnectorConfig();
    config.setAuthEndpoint(loginUrl);
    config.setServiceEndpoint(loginUrl);
    config.setManualLogin(true);
    return (new PartnerConnection(config)).login(username, password);
}
 
开发者ID:shankar-ray,项目名称:mload,代码行数:11,代码来源:PartnerLogin.java

示例6: loginToSalesforce

import com.sforce.ws.ConnectorConfig; //导入方法依赖的package包/类
private static LoginResult loginToSalesforce(final String username, final String password, final String authEndPoint)
  throws ConnectionException {
    final ConnectorConfig config = new ConnectorConfig();
    config.setAuthEndpoint(authEndPoint);
    config.setServiceEndpoint(authEndPoint);
    config.setManualLogin(true);

    final PartnerConnection partnerConnection = new PartnerConnection(config);
    return partnerConnection.login(username, password);
}
 
开发者ID:takahitomiyamoto,项目名称:salesforce-manifest-generator,代码行数:11,代码来源:LoginUtils.java

示例7: getPartnerConnection

import com.sforce.ws.ConnectorConfig; //导入方法依赖的package包/类
public static PartnerConnection getPartnerConnection(SalesforceConfig config) throws ConnectionException {
	ConnectorConfig cc = new ConnectorConfig();
	cc.setUsername(config.getUsername());
	cc.setPassword(config.getPassword());
	cc.setManualLogin(false);
	String authEndpoint = String.format(ENDPOINT_SOAP, config.getServerUrl(), config.getApiVersion());
	cc.setAuthEndpoint(authEndpoint);
	PartnerConnection partnerConnection = com.sforce.soap.partner.Connector.newConnection(cc);
	partnerConnection.login(config.getUsername(), config.getPassword());
	return partnerConnection;
}
 
开发者ID:eroispaziali,项目名称:ForceFlow,代码行数:12,代码来源:ConnectionFactory.java

示例8: createPartnerConnection

import com.sforce.ws.ConnectorConfig; //导入方法依赖的package包/类
private PartnerConnection createPartnerConnection(
        String endpointUrl,
        String userName,
        String password)
        throws ConnectionException {

    ConnectorConfig partnerConfig = new ConnectorConfig();
    partnerConfig.setUsername(userName);
    partnerConfig.setPassword(password);
    partnerConfig.setAuthEndpoint(endpointUrl);

    return new PartnerConnection(partnerConfig);
}
 
开发者ID:mikoto2000,项目名称:embulk-input-salesforce_bulk,代码行数:14,代码来源:SalesforceBulkWrapper.java

示例9: getPartnerConfig

import com.sforce.ws.ConnectorConfig; //导入方法依赖的package包/类
public static ConnectorConfig getPartnerConfig(ForceConfigBean conf, SessionRenewer sessionRenewer) throws StageException {
  ConnectorConfig config = new ConnectorConfig();

  config.setUsername(conf.username.get());
  config.setPassword(conf.password.get());
  config.setAuthEndpoint("https://"+conf.authEndpoint+"/services/Soap/u/"+conf.apiVersion);
  config.setCompression(conf.useCompression);
  config.setTraceMessage(conf.showTrace);
  config.setSessionRenewer(sessionRenewer);

  setProxyConfig(conf, config);

  return config;
}
 
开发者ID:streamsets,项目名称:datacollector,代码行数:15,代码来源:ForceUtils.java

示例10: createConfig

import com.sforce.ws.ConnectorConfig; //导入方法依赖的package包/类
public ConnectorConfig createConfig() {
	CommonConnectorConfig commonConnConfig = new CommonConnectorConfig();
	ConnectorConfig config = commonConnConfig.createConfig();
	config.setAuthEndpoint(
			CommandLineArguments.getOrgUrl() + "/services/Soap/u/" + ConnectionHandler.SUPPORTED_VERSION);
	config.setSessionRenewer(new SFDCSessionRenewer());
	LOG.info("Default connection time out value is: " + config.getConnectionTimeout());
	config.setConnectionTimeout(ConnectionHandler.MAX_TIME_OUT_IN_MS_INT);
	LOG.info("Updated connection time out value(from config.properties file): " + config.getConnectionTimeout());
	return config;
}
 
开发者ID:forcedotcom,项目名称:ApexUnit,代码行数:12,代码来源:PartnerConnectionConnectorConfig.java

示例11: login

import com.sforce.ws.ConnectorConfig; //导入方法依赖的package包/类
private void login(String endpoint) throws ConnectionException {
    ConnectorConfig config = new ConnectorConfig();

    config.setAuthEndpoint(endpoint);
    config.setUsername(username);
    config.setPassword(password + securityKey);
    config.setConnectionTimeout(60000);
    config.setUseChunkedPost(true);

    partnerConnection = new PartnerConnection(config);
}
 
开发者ID:Talend,项目名称:components,代码行数:12,代码来源:SalesforceRuntimeTestUtil.java

示例12: doConnection

import com.sforce.ws.ConnectorConfig; //导入方法依赖的package包/类
/**
 * Create a connection with specified connector configuration
 *
 * @param config connector configuration with endpoint/userId/password
 * @param openNewSession whether need to create new session
 * @return PartnerConnection object with correct session id
 * @throws ConnectionException create connection fails
 */
protected PartnerConnection doConnection(ConnectorConfig config, boolean openNewSession) throws ConnectionException {
    if (!openNewSession) {
        config.setSessionId(this.sessionId);
        config.setServiceEndpoint(this.serviceEndPoint);
    } else {
        SalesforceConnectionProperties connProps = getConnectionProperties();
        String endpoint = connProps.endpoint.getStringValue();
        endpoint = StringUtils.strip(endpoint, "\"");
        if (SalesforceConnectionProperties.LoginType.OAuth.equals(connProps.loginType.getValue())) {
            SalesforceOAuthConnection oauthConnection = new SalesforceOAuthConnection(connProps, endpoint,
                    connProps.apiVersion.getValue());
            oauthConnection.login(config);
        } else {
            config.setAuthEndpoint(endpoint);
        }
    }

    config.setManualLogin(true);
    // Creating connection and not login there.
    PartnerConnection connection = new PartnerConnection(config);
    // Need to discard manual login parameter in configs to avoid execution errors.
    config.setManualLogin(false);
    if (null == config.getSessionId()) {
        performLogin(config, connection);
    }

    if (openNewSession && isReuseSession()) {
        this.sessionId = config.getSessionId();
        this.serviceEndPoint = config.getServiceEndpoint();
        if (this.sessionId != null && this.serviceEndPoint != null) {
            // update session file with current sessionId/serviceEndPoint
            setupSessionProperties(connection);
        }
    }
    return connection;
}
 
开发者ID:Talend,项目名称:components,代码行数:45,代码来源:SalesforceSourceOrSink.java

示例13: login

import com.sforce.ws.ConnectorConfig; //导入方法依赖的package包/类
public MetadataConnection login() throws ConnectionException {
	ConnectorConfig partnerConfig = new ConnectorConfig();
	partnerConfig.setAuthEndpoint(URL);
	partnerConfig.setServiceEndpoint(URL);
	partnerConfig.setUsername(USERNAME);
	partnerConfig.setPassword(PASSWORD);
    partnerConnection = com.sforce.soap.partner.Connector.newConnection(partnerConfig);
    LoginResult lr = partnerConnection.login(USERNAME,PASSWORD);
	
    ConnectorConfig metadataConfig = new ConnectorConfig();
    metadataConfig.setServiceEndpoint(lr.getMetadataServerUrl());
    metadataConfig.setSessionId(lr.getSessionId());
    metadataConnection = com.sforce.soap.metadata.Connector.newConnection(metadataConfig);
    return metadataConnection;
}
 
开发者ID:yippie,项目名称:Salesforce-Renamer,代码行数:16,代码来源:LoginUtility.java

示例14: loginToSalesforce

import com.sforce.ws.ConnectorConfig; //导入方法依赖的package包/类
private static LoginResult loginToSalesforce() throws ConnectionException {
	if(App.sfdcInfo.getLoginResult() == null) {
		ConnectorConfig config = new ConnectorConfig();
		config.setAuthEndpoint(App.getPartnerUrl());
		config.setUsername(App.getUserName());
		config.setPassword(App.getUserPassword() + App.getSecurityToken());
		partnerConnection = Connector.newConnection(config);
		return partnerConnection.login(App.getUserName(), App.getUserPassword() + App.getSecurityToken());
	}
	else
		return App.sfdcInfo.getLoginResult();
}
 
开发者ID:sunand85,项目名称:DF14_Demo,代码行数:13,代码来源:SFDCConnection.java

示例15: createConnectorConfig

import com.sforce.ws.ConnectorConfig; //导入方法依赖的package包/类
private ConnectorConfig createConnectorConfig(@NotNull InstanceCredentials instanceCredentials, boolean traceMessages) {
    ConnectorConfig config = new ConnectorConfig();
    // TODO: set proxy!
    config.setTraceMessage(traceMessages);
    config.setUsername(instanceCredentials.getUsername());
    config.setPassword(instanceCredentials.getPassword() + instanceCredentials.getSecurityToken());
    config.setAuthEndpoint(InstanceUtils.getSoapLoginUrlForEnvironment(instanceCredentials.getEnvironment()));
    return config;
}
 
开发者ID:polyglot-mark,项目名称:salesforce-plugin,代码行数:10,代码来源:SoapClient.java


注:本文中的com.sforce.ws.ConnectorConfig.setAuthEndpoint方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。