Examples of BoundTransportAddress


Examples of org.elasticsearch.common.transport.BoundTransportAddress

    public void setUp() throws Exception {
        clusterService = mock(ClusterService.class);
        clusterIdService = mock(ClusterIdService.class);
        httpServerTransport = mock(HttpServerTransport.class);
        DiscoveryNode discoveryNode = mock(DiscoveryNode.class);
        BoundTransportAddress boundAddress = mock(BoundTransportAddress.class);
        TransportAddress transportAddress = new InetSocketTransportAddress(
                InetAddress.getLocalHost().getHostName(), 4200);

        SettableFuture<ClusterId> clusterIdFuture = SettableFuture.create();
        clusterIdFuture.set(new ClusterId(UUID.randomUUID()));
        when(clusterIdService.clusterId()).thenReturn(clusterIdFuture);
        when(clusterService.localNode()).thenReturn(discoveryNode);
        when(discoveryNode.isMasterNode()).thenReturn(true);
        when(httpServerTransport.boundAddress()).thenReturn(boundAddress);
        when(boundAddress.publishAddress()).thenReturn(transportAddress);
    }
View Full Code Here

Examples of org.elasticsearch.common.transport.BoundTransportAddress

                e.printStackTrace();
            }

            HttpInfo httpInfo = mock(HttpInfo.class);
            when(nodeInfo.getHttp()).thenReturn(httpInfo);
            BoundTransportAddress boundTransportAddress = new BoundTransportAddress(
                    new InetSocketTransportAddress("localhost", 44200),
                    new InetSocketTransportAddress("localhost", 44200)
            );
            when(httpInfo.address()).thenReturn(boundTransportAddress);
View Full Code Here

Examples of org.elasticsearch.common.transport.BoundTransportAddress

        try {
            publishAddress = new InetSocketAddress(networkService.resolvePublishHostAddress(publishHost), boundAddress.getPort());
        } catch (Exception e) {
            throw new BindTransportException("Failed to resolve publish address", e);
        }
        this.boundAddress = new BoundTransportAddress(new InetSocketTransportAddress(boundAddress), new InetSocketTransportAddress(publishAddress));
        final String httpAddress = "http://" + publishAddress.getAddress().getHostAddress() + ":" + publishAddress.getPort();

        discoveryNodeService.addCustomAttributeProvider(new DiscoveryNodeService.CustomAttributesProvider() {
            @Override
            public Map<String, String> buildAttributes() {
View Full Code Here

Examples of org.elasticsearch.common.transport.BoundTransportAddress

        try {
            publishAddress = new InetSocketAddress(networkService.resolvePublishHostAddress(publishHost), boundAddress.getPort());
        } catch (Exception e) {
            throw new BindTransportException("Failed to resolve publish address", e);
        }
        this.boundAddress = new BoundTransportAddress(new InetSocketTransportAddress(boundAddress), new InetSocketTransportAddress(publishAddress));
    }
View Full Code Here

Examples of org.elasticsearch.common.transport.BoundTransportAddress

        return this.boundAddress;
    }

    @Override
    public HttpInfo info() {
        BoundTransportAddress boundTransportAddress = boundAddress();
        if (boundTransportAddress == null) {
            return null;
        }
        return new HttpInfo(boundTransportAddress, maxContentLength.bytes());
    }
View Full Code Here

Examples of org.elasticsearch.common.transport.BoundTransportAddress

    public boolean addressSupported(Class<? extends TransportAddress> address) {
        return transport.addressSupported(address);
    }

    public TransportInfo info() {
        BoundTransportAddress boundTransportAddress = boundAddress();
        if (boundTransportAddress == null) {
            return null;
        }
        return new TransportInfo(boundTransportAddress);
    }
View Full Code Here

Examples of org.elasticsearch.common.transport.BoundTransportAddress

        localAddress = new LocalTransportAddress(address);
        LocalTransport previous = transports.put(localAddress, this);
        if (previous != null) {
            throw new ElasticsearchException("local address [" + address + "] is already bound");
        }
        boundAddress = new BoundTransportAddress(localAddress, localAddress);
    }
View Full Code Here

Examples of org.elasticsearch.common.transport.BoundTransportAddress

            String publishHost = componentSettings.get("publish_host", settings.get("transport.publish_host", settings.get("transport.host")));
            publishAddress = new InetSocketAddress(networkService.resolvePublishHostAddress(publishHost), publishPort);
        } catch (Exception e) {
            throw new BindTransportException("Failed to resolve publish address", e);
        }
        this.boundAddress = new BoundTransportAddress(new InetSocketTransportAddress(boundAddress), new InetSocketTransportAddress(publishAddress));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.