Examples of discover()


Examples of net.tomp2p.p2p.Peer.discover()

        try {
            peer = new PeerBuilder(Number160.createHash(clientId)).ports(clientPort).behindFirewall().start();
            PeerNAT peerNAT = new PeerBuilderNAT(peer).start();
            PeerAddress masterNodeAddress = new PeerAddress(Number160.createHash(seedNodeId), seedNodeIP, seedNodePort,
                                                            seedNodePort);
            FutureDiscover futureDiscover = peer.discover().peerAddress(masterNodeAddress).start();
            FutureNAT futureNAT = peerNAT.startSetupPortforwarding(futureDiscover);
            futureNAT.awaitUninterruptibly();
            if (futureNAT.isSuccess()) {
                log.info("Automatic port forwarding is setup. Now we do a futureDiscover again. Address = " +
                                 futureNAT.peerAddress());
View Full Code Here

Examples of net.tomp2p.p2p.Peer.discover()

            FutureNAT futureNAT = peerNAT.startSetupPortforwarding(futureDiscover);
            futureNAT.awaitUninterruptibly();
            if (futureNAT.isSuccess()) {
                log.info("Automatic port forwarding is setup. Now we do a futureDiscover again. Address = " +
                                 futureNAT.peerAddress());
                futureDiscover = peer.discover().peerAddress(masterNodeAddress).start();
                futureDiscover.awaitUninterruptibly();
                if (futureDiscover.isSuccess()) {
                    log.info("Discover with automatic port forwarding was successful. Address = " + futureDiscover
                            .peerAddress());
                    //cachedPeers.put(id, peer);
View Full Code Here

Examples of net.tomp2p.p2p.Peer.discover()

        try {
            peer = new PeerBuilder(Number160.createHash(clientId)).ports(clientPort).behindFirewall().start();
            PeerNAT peerNAT = new PeerBuilderNAT(peer).start();
            PeerAddress masterNodeAddress = new PeerAddress(Number160.createHash(seedNodeId), seedNodeIP, seedNodePort,
                                                            seedNodePort);
            FutureDiscover futureDiscover = peer.discover().peerAddress(masterNodeAddress).start();
            FutureNAT futureNAT = peerNAT.startSetupPortforwarding(futureDiscover);
            FutureRelayNAT futureRelayNAT = peerNAT.startRelay(futureDiscover, futureNAT);
            futureRelayNAT.awaitUninterruptibly();
            if (futureRelayNAT.isSuccess()) {
                log.info("Bootstrap using relay was successful. Address = " + peer.peerAddress());
View Full Code Here

Examples of net.tomp2p.p2p.Peer.discover()

    PeerAddress pa = new PeerAddress(Number160.ZERO, address, masterPort, masterPort);

    System.out.println("PeerAddress: " + pa);
   
    // Future Discover
    FutureDiscover futureDiscover = client.discover().inetAddress(address).ports(masterPort).start();
    futureDiscover.awaitUninterruptibly();

    // Future Bootstrap - slave
    FutureBootstrap futureBootstrap = client.bootstrap().inetAddress(address).ports(masterPort).start();
    futureBootstrap.awaitUninterruptibly();
View Full Code Here

Examples of net.tomp2p.p2p.Peer.discover()

        Peer myPeer = new PeerBuilder(Number160.createHash("client peer")).behindFirewall(true).
                ports(port).enableMaintenance(false).start();
        PeerAddress bootstrapServerPeerAddress = new PeerAddress(Number160.ZERO, new InetSocketAddress(
                InetAddress.getByName(ipSuperPeer), port));

        FutureDiscover discovery = myPeer.discover().peerAddress(bootstrapServerPeerAddress).start();
        discovery.awaitUninterruptibly();
        if (!discovery.isSuccess()) {
            System.err.println("no success!");
        }
        System.err.println("Peer: " + discovery.reporter() + " told us about our address.");
View Full Code Here

Examples of net.tomp2p.p2p.Peer.discover()

    Random r = new Random(43L);
    Peer peer = new PeerBuilder(new Number160(r)).ports(PORT_CLIENT).behindFirewall().start();
    PeerNAT peerNAT = new PeerBuilderNAT(peer).start();
    PeerAddress pa = new PeerAddress(Number160.ZERO, InetAddress.getByName(ip), PORT_SERVER, PORT_SERVER);
   
    FutureDiscover fd = peer.discover().peerAddress(pa).start();
    FutureNAT fn = peerNAT.startSetupPortforwarding(fd);
    FutureRelayNAT frn = peerNAT.startRelay(fd, fn);
   
    frn.awaitUninterruptibly();
    if (fd.isSuccess()) {
View Full Code Here

Examples of net.xeoh.plugins.remotediscovery.RemoteDiscovery.discover()

        p.exportPlugin(p2);
        System.out.println("exported to " + p2);

        RemoteDiscovery plugin = this.pm.getPlugin(RemoteDiscovery.class);
        //while(true) {
        Collection<DiscoveredPlugin> discover = plugin.discover(Plugin.class, new OptionCallback(new OptionCallback.Callback() {

            public void pluginsDiscovered(Collection<DiscoveredPlugin> plugins) {
                ArrayList<DiscoveredPlugin> test = new ArrayList<DiscoveredPlugin>(plugins);
                for (DiscoveredPlugin discoveredPlugin : test) {
                    System.out.println("Callback says: " + discoveredPlugin.getPublishURI() + " @" + discoveredPlugin.getDistance());
View Full Code Here

Examples of net.xeoh.plugins.remotediscovery.RemoteDiscovery.discover()

        RemoteDiscovery p = this.pm.getPlugin(RemoteDiscovery.class);

        System.out.println(1);
        p.announcePlugin(p2, PublishMethod.ERMI, new URI("ermi://lala:123/Jojo"));
        System.out.println(2);
        Collection<DiscoveredPlugin> discover = p.discover(Plugin.class);
        System.out.println(3);
        for (DiscoveredPlugin dp : discover) {
            int distance = dp.getDistance();
            System.out.println(dp.getPublishURI() + " " + distance);
        }
View Full Code Here

Examples of org.andromda.core.namespace.NamespaceComponents.discover()

    extends TestCase
{
    public void testInstance()
    {
        final NamespaceComponents componentRegistry = NamespaceComponents.instance();
        componentRegistry.discover();
        assertEquals("3", Namespaces.instance().getPropertyValue("test", "definitionOne"));
        assertEquals("two", Namespaces.instance().getPropertyValue("test", "definitionTwo"));
    }
}
View Full Code Here

Examples of org.apache.amber.oauth2.ext.dynamicreg.server.request.OAuthServerRegistrationRequest.discover()


        OAuthServerRegistrationRequest oauthRequest = null;
        try {
            oauthRequest = new OAuthServerRegistrationRequest(new JSONHttpServletRequestWrapper(request));
            oauthRequest.discover();
            oauthRequest.getClientName();
            oauthRequest.getClientUrl();
            oauthRequest.getClientDescription();
            oauthRequest.getRedirectURI();
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.