Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2018
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.51 KB | None | 0 0
  1. /*
  2. * PubSub.java
  3. * Author: rfronteddu@ihmc.us
  4. * This file is part of the IHMC NetSensor Library/Component
  5. * Copyright (c) 2010-2018 IHMC.
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License
  9. * version 3 (GPLv3) as published by the Free Software Foundation.
  10. *
  11. * U.S. Government agencies and organizations may redistribute
  12. * and/or modify this program under terms equivalent to
  13. * "Government Purpose Rights" as defined by DFARS
  14. * 252.227-7014(a)(12) (February 2014).
  15. *
  16. * Alternative licenses that allow for use within commercial products may be
  17. * available. Contact Niranjan Suri at IHMC (nsuri@ihmc.us) for details.
  18. *
  19. *
  20. */
  21.  
  22. package us.ihmc.anglova.protocols;
  23.  
  24. import java.util.List;
  25.  
  26. public interface PubSub
  27. {
  28.     /**
  29.      * @param brokerList list of brokers in the form addr:port
  30.      * @return true if successful
  31.      */
  32.     boolean connect (List<String> brokerList);
  33.  
  34.     /**
  35.      * Disconnect from all the brokers
  36.      * @return true if successful
  37.      */
  38.     boolean disconnect();
  39.  
  40.  
  41.     /**
  42.      * Publish msg to all the brokers
  43.      * @param msg
  44.      * @return
  45.      */
  46.     boolean publish (byte[] msg);
  47.  
  48.     /**
  49.      * Register the callback to be called when a message is received for the Topic topic
  50.      * @param topic topic to register to
  51.      * @param callback callback to call when a msg is received for the topic topic
  52.      * @return
  53.      */
  54.     boolean subscribe (String topic, SubscribeCallback callback);
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement