@Test public void testGetConfigDataTwiceYieldsSameObj() throws ApiException { final BindingConfig data = this.bundle.getBindingConfig(); assertSame(data, this.bundle.getBindingConfig()); }
@Override @Nonnull public synchronized BindingConfig getBindingConfig() throws ApiException { if (this.bindingConfig == null) { BindingConfig newBindingConfig; newBindingConfig = this.bindingRepository .getBindingConfigData(this.username, this.password, this.callSemaphore, this.sandboxOrg); String sessionId = newBindingConfig.getSessionId(); if (this.orgId == null) { this.orgId = newBindingConfig.getOrgId(); logger.trace("Setting the bundle's org id to <" + this.orgId + "> from its first connection"); } else { if (!this.orgId.equals(newBindingConfig.getOrgId())) { throw new IllegalStateException( "Somehow got a binding with a different organization Id: expected <" + this.orgId + ">, got <" + newBindingConfig.getOrgId() + ">. Did you update the credentials to those of a different org?"); } } logger.trace("User " + this.username + ", session id " + sessionId + " on metadata server" + newBindingConfig.getMetadataServerUrl()); this.bindingConfig = newBindingConfig; } return this.bindingConfig; }
ConnectionBundleImpl implements ConnectionBundle { @Override @Nonnull public synchronized BindingConfig getBindingConfig() throws ApiException { if (this.bindingConfig == null) { BindingConfig newBindingConfig; newBindingConfig = this.bindingRepository .getBindingConfigData(this.username, this.password, this.callSemaphore, this.sandboxOrg); String sessionId = newBindingConfig.getSessionId(); if (this.orgId == null) { this.orgId = newBindingConfig.getOrgId(); logger.trace("Setting the bundle's org id to <" + this.orgId + "> from its first connection"); } else { if (!this.orgId.equals(newBindingConfig.getOrgId())) { throw new IllegalStateException( "Somehow got a binding with a different organization Id: expected <" + this.orgId + ">, got <" + newBindingConfig.getOrgId() + ">. Did you update the credentials to those of a different org?"); } } logger.trace("User " + this.username + ", session id " + sessionId + " on metadata server" + newBindingConfig.getMetadataServerUrl()); this.bindingConfig = newBindingConfig; } return this.bindingConfig; } }
ConnectionBundleImpl implements ConnectionBundle { @Override @Nonnull public synchronized BindingConfig getBindingConfig() throws ApiException { if (this.bindingConfig == null) { BindingConfig newBindingConfig; newBindingConfig = this.bindingRepository .getBindingConfigData(this.username, this.password, this.callSemaphore, this.sandboxOrg); String sessionId = newBindingConfig.getSessionId(); if (this.orgId == null) { this.orgId = newBindingConfig.getOrgId(); logger.trace("Setting the bundle's org id to <" + this.orgId + "> from its first connection"); } else { if (!this.orgId.equals(newBindingConfig.getOrgId())) { throw new IllegalStateException( "Somehow got a binding with a different organization Id: expected <" + this.orgId + ">, got <" + newBindingConfig.getOrgId() + ">. Did you update the credentials to those of a different org?"); } } logger.trace("User " + this.username + ", session id " + sessionId + " on metadata server" + newBindingConfig.getMetadataServerUrl()); this.bindingConfig = newBindingConfig; } return this.bindingConfig; } private  ConnectionBundleImpl(@Nonnull String username, @Nonnull String password, int maxConcurrentApiCalls,
            @Nonnull BindingRepository bindingRepository, boolean sandboxOrg, MetricRegistry metricRegistry); }
ConnectionBundleImpl implements ConnectionBundle { @Override @Nonnull public synchronized BindingConfig getBindingConfig() throws ApiException { if (this.bindingConfig == null) { BindingConfig newBindingConfig; newBindingConfig = this.bindingRepository .getBindingConfigData(this.username, this.password, this.callSemaphore, this.sandboxOrg); String sessionId = newBindingConfig.getSessionId(); if (this.orgId == null) { this.orgId = newBindingConfig.getOrgId(); logger.trace("Setting the bundle's org id to <" + this.orgId + "> from its first connection"); } else { if (!this.orgId.equals(newBindingConfig.getOrgId())) { throw new IllegalStateException( "Somehow got a binding with a different organization Id: expected <" + this.orgId + ">, got <" + newBindingConfig.getOrgId() + ">. Did you update the credentials to those of a different org?"); } } logger.trace("User " + this.username + ", session id " + sessionId + " on metadata server" + newBindingConfig.getMetadataServerUrl()); this.bindingConfig = newBindingConfig; } return this.bindingConfig; } private  ConnectionBundleImpl(@Nonnull String username, @Nonnull String password, int maxConcurrentApiCalls,
            @Nonnull BindingRepository bindingRepository, boolean sandboxOrg, MetricRegistry metricRegistry); @Nonnull @Override synchronized PartnerConnection getPartnerConnection(); @Nonnull @Override synchronized MetadataConnection getMetadataConnection(); @Nonnull @Override synchronized ApexConnection getApexConnection(); @Override @Nonnull synchronized BindingConfig getBindingConfig(); }
ConnectionBundleImpl implements ConnectionBundle { @Override @Nonnull public synchronized BindingConfig getBindingConfig() throws ApiException { if (this.bindingConfig == null) { BindingConfig newBindingConfig; newBindingConfig = this.bindingRepository .getBindingConfigData(this.username, this.password, this.callSemaphore, this.sandboxOrg); String sessionId = newBindingConfig.getSessionId(); if (this.orgId == null) { this.orgId = newBindingConfig.getOrgId(); logger.trace("Setting the bundle's org id to <" + this.orgId + "> from its first connection"); } else { if (!this.orgId.equals(newBindingConfig.getOrgId())) { throw new IllegalStateException( "Somehow got a binding with a different organization Id: expected <" + this.orgId + ">, got <" + newBindingConfig.getOrgId() + ">. Did you update the credentials to those of a different org?"); } } logger.trace("User " + this.username + ", session id " + sessionId + " on metadata server" + newBindingConfig.getMetadataServerUrl()); this.bindingConfig = newBindingConfig; } return this.bindingConfig; } private  ConnectionBundleImpl(@Nonnull String username, @Nonnull String password, int maxConcurrentApiCalls,
            @Nonnull BindingRepository bindingRepository, boolean sandboxOrg, MetricRegistry metricRegistry); @Nonnull @Override synchronized PartnerConnection getPartnerConnection(); @Nonnull @Override synchronized MetadataConnection getMetadataConnection(); @Nonnull @Override synchronized ApexConnection getApexConnection(); @Override @Nonnull synchronized BindingConfig getBindingConfig();  }