/** * @return the port that the remote instance is listening on for * RAW Socket 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 getSiteToSitePort() throws IOException { Integer listeningPort; remoteInfoReadLock.lock(); try { listeningPort = this.siteToSitePort; if (listeningPort != null && this.remoteRefreshTime > System.currentTimeMillis() - REMOTE_REFRESH_MILLIS) { return listeningPort; } } finally { remoteInfoReadLock.unlock(); } final ControllerDTO controller = refreshRemoteInfo(); listeningPort = controller.getRemoteSiteListeningPort(); return listeningPort; }
this.siteToSitePort = controller.getRemoteSiteListeningPort(); this.siteToSiteHttpPort = controller.getRemoteSiteHttpListeningPort(); this.siteToSiteSecure = controller.isSiteToSiteSecure();
final ControllerDTO dto = apiClient.getController(targetUris); if (dto.getRemoteSiteListeningPort() == null && SiteToSiteTransportProtocol.RAW.equals(transportProtocol)) { authorizationIssue = "Remote instance is not configured to allow RAW Site-to-Site communications at this time."; } else if (dto.getRemoteSiteHttpListeningPort() == null && SiteToSiteTransportProtocol.HTTP.equals(transportProtocol)) { listeningPort = dto.getRemoteSiteListeningPort(); listeningHttpPort = dto.getRemoteSiteHttpListeningPort(); destinationSecure = dto.isSiteToSiteSecure();
final PeerDescription rawTarget = new PeerDescription(siteToSiteHostname, controller.getRemoteSiteListeningPort(), isSiteToSiteSecure); final PeerDescription modifiedRawTarget = peerDescriptionModifier.modify(source, rawTarget, SiteToSiteTransportProtocol.RAW, PeerDescriptionModifier.RequestType.SiteToSiteDetail, new HashMap<>(httpHeaders));
this.listeningPort = dto.getRemoteSiteListeningPort(); this.listeningHttpPort = dto.getRemoteSiteHttpListeningPort(); this.destinationSecure = dto.isSiteToSiteSecure();