/** * @return the port that the remote instance is listening on for * HTTP(S) site-to-site communication, or <code>null</code> if the remote instance * is not configured to allow site-to-site communications. * * @throws IOException if unable to communicate with the remote instance */ public Integer getSiteToSiteHttpPort() throws IOException { Integer listeningHttpPort; remoteInfoReadLock.lock(); try { listeningHttpPort = this.siteToSiteHttpPort; if (listeningHttpPort != null && this.remoteRefreshTime > System.currentTimeMillis() - REMOTE_REFRESH_MILLIS) { return listeningHttpPort; } } finally { remoteInfoReadLock.unlock(); } final ControllerDTO controller = refreshRemoteInfo(); listeningHttpPort = controller.getRemoteSiteHttpListeningPort(); return listeningHttpPort; }
try { this.siteToSitePort = controller.getRemoteSiteListeningPort(); this.siteToSiteHttpPort = controller.getRemoteSiteHttpListeningPort(); this.siteToSiteSecure = controller.isSiteToSiteSecure(); this.activeClusterUrl = connectedClusterUrl;
} else if (dto.getRemoteSiteHttpListeningPort() == null && SiteToSiteTransportProtocol.HTTP.equals(transportProtocol)) { authorizationIssue = "Remote instance is not configured to allow HTTP Site-to-Site communications at this time."; } else { try { listeningPort = dto.getRemoteSiteListeningPort(); listeningHttpPort = dto.getRemoteSiteHttpListeningPort(); destinationSecure = dto.isSiteToSiteSecure(); } finally {
final PeerDescription httpTarget = new PeerDescription(siteToSiteHostname, controller.getRemoteSiteHttpListeningPort(), isSiteToSiteSecure); final PeerDescription modifiedHttpTarget = peerDescriptionModifier.modify(source, httpTarget, SiteToSiteTransportProtocol.HTTP, PeerDescriptionModifier.RequestType.SiteToSiteDetail, new HashMap<>(httpHeaders));
this.listeningHttpPort = dto.getRemoteSiteHttpListeningPort(); this.destinationSecure = dto.isSiteToSiteSecure();