+ " : " + this.loginResult.getSessionId() ); log.logDebug( BaseMessages.getString( PKG, "SalesforceInput.Log.NewServerURL" ) + " : " + this.loginResult.getServerUrl() ); pConnection.setSessionHeader( loginResult.getSessionId() ); config.setServiceEndpoint( loginResult.getServerUrl() );
public synchronized int hashCode() { if (__hashCodeCalc) { return 0; } __hashCodeCalc = true; int _hashCode = 1; if (getMetadataServerUrl() != null) { _hashCode += getMetadataServerUrl().hashCode(); } _hashCode += (isPasswordExpired() ? Boolean.TRUE : Boolean.FALSE).hashCode(); _hashCode += (isSandbox() ? Boolean.TRUE : Boolean.FALSE).hashCode(); if (getServerUrl() != null) { _hashCode += getServerUrl().hashCode(); } if (getSessionId() != null) { _hashCode += getSessionId().hashCode(); } if (getUserId() != null) { _hashCode += getUserId().hashCode(); } if (getUserInfo() != null) { _hashCode += getUserInfo().hashCode(); } __hashCodeCalc = false; return _hashCode; }
(this.serverUrl != null && this.serverUrl.equals(other.getServerUrl()))) && ((this.sessionId == null && other.getSessionId() == null) || (this.sessionId != null && this.sessionId.equals(other.getSessionId()))) && ((this.userId == null && other.getUserId() == null) || (this.userId != null &&
/** * Provides manual login as in {@link PartnerConnection} constructor, checks login result for valid connection/credentials. * * @param config connector configuration with endpoint/userId/password * @param connection to be used for login in Salesforce. * @throws ConnectionException if password has been expired or bad connection to Salesforce. * @see com.sforce.soap.partner.PartnerConnection#PartnerConnection(ConnectorConfig config) */ private void performLogin(ConnectorConfig config, PartnerConnection connection) throws ConnectionException { config.setServiceEndpoint(config.getAuthEndpoint()); LoginResult loginResult = connection.login(config.getUsername(), config.getPassword()); if (loginResult.isPasswordExpired()) { throw new ConnectionException(MESSAGES.getMessage("error.expiredPassword")); } config.setSessionId(loginResult.getSessionId()); config.setServiceEndpoint(loginResult.getServerUrl()); connection.setSessionHeader(loginResult.getSessionId()); }
/** * Provides manual login as in {@link PartnerConnection} constructor, checks login result for valid connection/credentials. * * @param config connector configuration with endpoint/userId/password * @param connection to be used for login in Salesforce. * @throws ConnectionException if password has been expired or bad connection to Salesforce. * @see com.sforce.soap.partner.PartnerConnection#PartnerConnection(ConnectorConfig config) */ private void performLogin(ConnectorConfig config, PartnerConnection connection) throws ConnectionException { config.setServiceEndpoint(config.getAuthEndpoint()); LoginResult loginResult = connection.login(config.getUsername(), config.getPassword()); if (loginResult.isPasswordExpired()) { throw new ConnectionException(MESSAGES.getMessage("error.expiredPassword")); } config.setSessionId(loginResult.getSessionId()); config.setServiceEndpoint(loginResult.getServerUrl()); connection.setSessionHeader(loginResult.getSessionId()); }
sh.setSessionId(loginResult.getSessionId());
public static MetadataConnection getMetadataConnection(PartnerConnection pc, SalesforceConfig config) throws ConnectionException { LoginResult lr = pc.login(config.getUsername(), config.getPassword()); ConnectorConfig cc = new ConnectorConfig(); cc.setUsername(config.getUsername()); cc.setPassword(config.getPassword()); cc.setSessionId(lr.getSessionId()); cc.setServiceEndpoint(lr.getMetadataServerUrl()); cc.setManualLogin(false); MetadataConnection connection = com.sforce.soap.metadata.Connector.newConnection(cc); return connection; }
public PartnerConnection(ConnectorConfig config) throws ConnectionException { this.__config = config; this.__typeMapper.setPackagePrefix(null); this.__typeMapper.setConfig(config); config.verifyPartnerEndpoint(); if (!config.isManualLogin()) { if (config.getSessionId()==null) { config.setServiceEndpoint(config.getAuthEndpoint()); com.sforce.soap.partner.LoginResult result = login(config.getUsername(), config.getPassword()); config.setSessionId(result.getSessionId()); config.setServiceEndpoint(result.getServerUrl()); } else { if (config.getServiceEndpoint() == null) { throw new com.sforce.ws.ConnectionException("Please set ServiceEndpoint"); } } } __SessionHeader = new SessionHeader_element(); __SessionHeader.setSessionId(config.getSessionId()); }