Package de.zib.scalaris

Examples of de.zib.scalaris.PubSub


        System.out.println("Reading values with the class `PubSub`:");

        try {
            System.out.println("  creating object...");
            final PubSub sc = new PubSub();
            System.out
                    .println("    `OtpErlangList getSubscribers(OtpErlangString)`...");
            otpSubscribers = (OtpErlangList) sc.getSubscribers(otpTopic).value();
            System.out.println("      getSubscribers(" + otpTopic.stringValue()
                    + ") == " + getSubscribers(otpSubscribers));
        } catch (final ConnectionException e) {
            System.out.println("      getSubscribers(" + otpTopic.stringValue()
                    + ") failed: " + e.getMessage());
        } catch (final UnknownException e) {
            System.out.println("    getSubscribers(" + otpTopic.stringValue()
                    + ") failed: " + e.getMessage());
        }

        try {
            System.out.println("  creating object...");
            final PubSub sc = new PubSub();
            System.out
                    .println("    `List<String> getSubscribers(String)`...");
            subscribers = sc.getSubscribers(topic).stringListValue();
            System.out.println("      getSubscribers(" + topic + ") == "
                    + getSubscribers(subscribers));
        } catch (final ConnectionException e) {
            System.out.println("      getSubscribers(" + topic + ") failed: "
                    + e.getMessage());
View Full Code Here


        System.out
                .println("Subscribing a URL to a topic with the class `PubSub`:");

        try {
            System.out.println("  creating object...");
            final PubSub sc = new PubSub();
            System.out
                    .println("    `void subscribe(OtpErlangString, OtpErlangString)`...");
            sc.subscribe(otpTopic, otpURL);
            System.out.println("      subscribe(" + otpTopic.stringValue()
                    + ", " + otpURL.stringValue() + ") succeeded");
        } catch (final ConnectionException e) {
            System.out.println("      subscribe(" + otpTopic.stringValue()
                    + ", " + otpURL.stringValue() + ") failed: "
                    + e.getMessage());
        } catch (final TimeoutException e) {
            System.out.println("      subscribe(" + otpTopic.stringValue()
                    + ", " + otpURL.stringValue() + ") failed with timeout: "
                    + e.getMessage());
        } catch (final AbortException e) {
            System.out.println("      subscribe(" + otpTopic.stringValue()
                    + ", " + otpURL.stringValue() + ") failed with abort: "
                    + e.getMessage());
        } catch (final UnknownException e) {
            System.out.println("      subscribe(" + otpTopic.stringValue()
                    + ", " + otpURL.stringValue() + ") failed with unknown: "
                    + e.getMessage());
        }

        try {
            System.out.println("  creating object...");
            final PubSub sc = new PubSub();
            System.out.println("    `void subscribe(String, String)`...");
            sc.subscribe(topic, URL);
            System.out.println("      subscribe(" + topic + ", " + URL
                    + ") succeeded");
        } catch (final ConnectionException e) {
            System.out.println("      subscribe(" + topic + ", " + URL
                    + ") failed: " + e.getMessage());
View Full Code Here

        System.out
                .println("Publishing content under a topic with the class `PubSub`:");

        try {
            System.out.println("  creating object...");
            final PubSub sc = new PubSub();
            System.out
                    .println("    `void publish(OtpErlangString, OtpErlangString)`...");
            sc.publish(otpTopic, otpContent);
            System.out.println("      publish(" + otpTopic.stringValue() + ", "
                    + otpContent.stringValue() + ") succeeded");
        } catch (final ConnectionException e) {
            System.out.println("      publish(" + otpTopic.stringValue() + ", "
                    + otpContent.stringValue() + ") failed: " + e.getMessage());
        }

        try {
            System.out.println("  creating object...");
            final PubSub sc = new PubSub();
            System.out.println("    `void publish(String, String)`...");
            sc.publish(topic, content);
            System.out.println("      publish(" + topic + ", " + content
                    + ") succeeded");
        } catch (final ConnectionException e) {
            System.out.println("      publish(" + topic + ", " + content
                    + ") failed: " + e.getMessage());
View Full Code Here

TOP

Related Classes of de.zib.scalaris.PubSub

Copyright © 2018 www.massapicom. 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.