Class MulticastUtil

java.lang.Object
org.jolokia.service.discovery.MulticastUtil

public final class MulticastUtil extends Object
Utility class for handling multicast stuff
Since:
28.01.14
Author:
roland
  • Method Details

    • sendQueryAndCollectAnswers

      public static List<DiscoveryIncomingMessage> sendQueryAndCollectAnswers(DiscoveryOutgoingMessage pOutMsg, int pTimeout, String pMulticastGroup, int pMulticastPort) throws IOException
      Sent out a message to Jolokia's multicast group over all network interfaces supporting multicast request (and no logging is used)
      Parameters:
      pOutMsg - the message to send
      pTimeout - timeout used for how long to wait for discovery messages
      Returns:
      list of received answers, never null
      Throws:
      IOException - if something fails during the discovery request
    • sendQueryAndCollectAnswers

      public static List<DiscoveryIncomingMessage> sendQueryAndCollectAnswers(DiscoveryOutgoingMessage pOutMsg, int pTimeout, String pMulticastGroup, int pMulticastPort, org.jolokia.server.core.service.api.LogHandler pLogHandler) throws IOException
      Sent out a message to Jolokia's multicast group over all network interfaces supporting multicasts
      Parameters:
      pOutMsg - the message to send
      pTimeout - timeout used for how long to wait for discovery messages
      pLogHandler - a log handler for printing out logging information
      Returns:
      list of received answers, never null
      Throws:
      IOException - if something fails during the discovery request
    • getReadableSocketName

      public static String getReadableSocketName(MulticastSocket socket)
    • getReadableSocketName

      public static String getReadableSocketName(InetAddress address, int port)