+ " : " + this.loginResult.getSessionId() ); log.logDebug( BaseMessages.getString( PKG, "SalesforceInput.Log.NewServerURL" ) + " : " + this.loginResult.getServerUrl() ); 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.passwordExpired == other.isPasswordExpired() && this.sandbox == other.isSandbox() && ((this.serverUrl == null && other.getServerUrl() == null) || (this.serverUrl != null && this.serverUrl.equals(other.getServerUrl()))) && ((this.sessionId == null && other.getSessionId() == null) || (this.sessionId != null &&
public static SoapConnection getToolingConnection(PartnerConnection pc, SalesforceConfig config) throws ConnectionException { LoginResult lr = pc.login(config.getUsername(), config.getPassword()); ConnectorConfig toolingConfig = new ConnectorConfig(); toolingConfig.setSessionId(pc.getSessionHeader().getSessionId()); toolingConfig.setServiceEndpoint(lr.getServerUrl().replace("Soap/u/", "Soap/s/")); toolingConfig.setManualLogin(false); SoapConnection soapConnection = Connector.newConnection(toolingConfig); return soapConnection; }
loginResult.getServerUrl());
/** * 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()); }
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()); }