private void initBulkConnection() throws ConnectionException, AsyncApiException { if (this.connection == null) { initConnection(); } ConnectorConfig configNew = new ConnectorConfig(); configNew.setSessionId(config.getSessionId()); configNew.setServiceEndpoint(config.getServiceEndpoint()); configNew.setRestEndpoint(RESTAPI_URI_PATTERN.matcher(config.getServiceEndpoint()).replaceFirst("$1/async/$2/")); this.bulkConnection = new BulkConnection(configNew); }
private void initBulkConnection() throws ConnectionException, AsyncApiException { if (this.connection == null) { initConnection(); } ConnectorConfig configNew = new ConnectorConfig(); configNew.setSessionId(config.getSessionId()); configNew.setServiceEndpoint(config.getServiceEndpoint()); configNew.setRestEndpoint(RESTAPI_URI_PATTERN.matcher(config.getServiceEndpoint()).replaceFirst("$1/async/$2/")); this.bulkConnection = new BulkConnection(configNew); }
private void initMetadataConnection() throws ConnectionException { if (this.connection == null) { initConnection(); } ConnectorConfig configNew = new ConnectorConfig(); configNew.setSessionId(config.getSessionId()); configNew.setServiceEndpoint(METADATA_URI_PATTERN.matcher(config.getServiceEndpoint()).replaceFirst("$1/m/$2")); this.metadataConnection = new MetadataConnection(configNew); // Give the metadata connection a client id if we have one if (this.clientId != null) { this.metadataConnection.setCallOptions(this.clientId); } else if (this.externalClientId != null) { // If we've constructed config from ForceServiceConnectionInfo state // then we've saved any client id for use here (see getConfig) this.metadataConnection.setCallOptions(this.externalClientId); } else { this.metadataConnection.setCallOptions(API_USER_AGENT); //just default to sdk version } this.metadataConnection.getConfig().setRequestHeader("User-Agent", API_USER_AGENT); }
private void initMetadataConnection() throws ConnectionException { if (this.connection == null) { initConnection(); } ConnectorConfig configNew = new ConnectorConfig(); configNew.setSessionId(config.getSessionId()); configNew.setServiceEndpoint(METADATA_URI_PATTERN.matcher(config.getServiceEndpoint()).replaceFirst("$1/m/$2")); this.metadataConnection = new MetadataConnection(configNew); // Give the metadata connection a client id if we have one if (this.clientId != null) { this.metadataConnection.setCallOptions(this.clientId); } else if (this.externalClientId != null) { // If we've constructed config from ForceServiceConnectionInfo state // then we've saved any client id for use here (see getConfig) this.metadataConnection.setCallOptions(this.externalClientId); } else { this.metadataConnection.setCallOptions(API_USER_AGENT); //just default to sdk version } this.metadataConnection.getConfig().setRequestHeader("User-Agent", API_USER_AGENT); }