private String getPortIdentifier(final TransferDirection transferDirection) throws IOException { if (remoteDestination.getIdentifier() != null) { return remoteDestination.getIdentifier(); } return siteInfoProvider.getPortIdentifier(remoteDestination.getName(), transferDirection); }
@Override public long getYieldPeriod(final TimeUnit timeUnit) { return original.getYieldPeriod(timeUnit); }
@Override public boolean isUseCompression() { return original.isUseCompression(); } }
@Override public Transaction startTransaction(final Peer peer, final FlowFileCodec codec, final TransferDirection direction) throws IOException, ProtocolException { if (!handshakeComplete) { throw new IllegalStateException("Handshake has not been performed"); } if (!readyForFileTransfer) { throw new IllegalStateException("Cannot start transaction; handshake resolution was " + handshakeResponse); } return new SocketClientTransaction(versionNegotiator.getVersion(), destination.getIdentifier(), peer, codec, direction, useCompression, (int) destination.getYieldPeriod(TimeUnit.MILLISECONDS), eventReporter); }
@Override public String getName() { return original.getName(); }
@Override public void handshake(final Peer peer) throws IOException, HandshakeException { handshake(peer, destination.getIdentifier()); }
throw new IOException("Failed to determine the identifier of port " + remoteDestination.getName());
public void setDestination(final RemoteDestination destination) { this.destination = destination; this.useCompression = destination.isUseCompression(); }
protocol.setEventReporter(eventReporter); final long penalizationMillis = remoteDestination.getYieldPeriod(TimeUnit.MILLISECONDS); try { logger.debug("{} Establishing site-to-site connection with {}", this, peerStatus);