Class JxtaUtil


  • public class JxtaUtil
    extends java.lang.Object
    Utility class that can be used by any calling code to do common routines
    Author:
    shreedhar ganapathy
    • Method Detail

      • createByteArrayFromObject

        public static byte[] createByteArrayFromObject​(java.lang.Object object)
      • getObjectFromByteArray

        public static <T> T getObjectFromByteArray​(net.jxta.endpoint.MessageElement element)
      • setLogger

        public static void setLogger​(java.util.logging.Logger logger)
      • setupLogHandler

        public static void setupLogHandler()
      • printMessageStats

        public static void printMessageStats​(net.jxta.endpoint.Message msg,
                                             boolean verbose)
        Prints message element names and content and some stats
        Parameters:
        msg - message to print
        verbose - indicates whether to print elment content
      • getNetworkManagerProxy

        public static JxtaNetworkManagerProxy getNetworkManagerProxy​(java.lang.String groupName)
                                                              throws java.lang.IllegalArgumentException
        Throws:
        java.lang.IllegalArgumentException
      • appendChild

        public static void appendChild​(net.jxta.document.StructuredDocument adv,
                                       net.jxta.document.Element child)
      • configureJxtaLogging

        public static void configureJxtaLogging()
      • send

        public static boolean send​(net.jxta.pipe.OutputPipe pipe,
                                   net.jxta.endpoint.Message msg)
                            throws java.io.IOException
        Send msg over pipe.
        Parameters:
        pipe - the output pipe
        msg - the message
        Returns:
        boolean true if the message has been sent otherwise false. false. is commonly returned for non-error related congestion, meaning that you should be able to send the message after waiting some amount of time.
        Throws:
        java.io.IOException - the exception