PeerAddress upa = peer.peerBean().serverPeerAddress();
upa = upa.changeFirewalledTCP(true).changeFirewalledUDP(true).changeSlow(relayType.isSlow());
peer.peerBean().serverPeerAddress(upa);
// find neighbors
FutureBootstrap futureBootstrap = bootstrapBuilder.start();
futureBootstrapNAT.futureBootstrap0(futureBootstrap);
futureBootstrap.addListener(new BaseFutureAdapter<FutureBootstrap>() {
@Override
public void operationComplete(FutureBootstrap future) throws Exception {
if (future.isSuccess()) {
// setup relay
LOG.debug("bootstrap completed");
final FutureRelay futureRelay = new FutureRelay();
final DistributedRelay distributedRelay = startSetupRelay(futureRelay);
futureBootstrapNAT.futureRelay(futureRelay);
futureRelay.addListener(new BaseFutureAdapter<FutureRelay>() {
@Override
public void operationComplete(FutureRelay future) throws Exception {
// find neighbors again
if (future.isSuccess()) {
FutureBootstrap futureBootstrap = bootstrapBuilder.start();
futureBootstrapNAT.futureBootstrap1(futureBootstrap);
futureBootstrap.addListener(new BaseFutureAdapter<FutureBootstrap>() {
@Override
public void operationComplete(FutureBootstrap future) throws Exception {
if (future.isSuccess()) {
Shutdown shutdown = startRelayMaintenance(futureRelay, bootstrapBuilder, distributedRelay);
futureBootstrapNAT.done(shutdown);