Class SWIFT_PING.Utils

java.lang.Object
org.jgroups.protocols.SWIFT_PING.Utils
Enclosing class:
SWIFT_PING

private static class SWIFT_PING.Utils extends Object
  • Constructor Details

    • Utils

      private Utils()
  • Method Details

    • validateNotEmpty

      public static void validateNotEmpty(String arg, String argname)
    • isSuccessCode

      public static boolean isSuccessCode(int code)
      Is http response code in success range ?
      Parameters:
      code -
      Returns:
    • isAuthDenied

      public static boolean isAuthDenied(int code)
      Is http Unauthorized response code ?
      Parameters:
      code -
      Returns:
    • doOperation

      public static SWIFT_PING.HttpResponse doOperation(HttpURLConnection urlConnection, byte[] inputData, boolean hasOutput) throws IOException
      Do a http operation
      Parameters:
      urlConnection - the HttpURLConnection to be used
      inputData - if not null,will be written to the urlconnection.
      hasOutput - if true, read content back from the urlconnection
      Returns:
      Response
      Throws:
      IOException
    • getBytes

      public static byte[] getBytes(InputStream inputStream) throws IOException
      Get bytes of this InputStream
      Parameters:
      inputStream -
      Returns:
      Throws:
      IOException
    • doVoidOperation

      public static SWIFT_PING.HttpResponse doVoidOperation(HttpURLConnection urlConnection) throws IOException
      Do a operation that does not write or read from HttpURLConnection, except for the headers
      Parameters:
      urlConnection - the connection
      Returns:
      Response
      Throws:
      IOException
    • doSendOperation

      public static SWIFT_PING.HttpResponse doSendOperation(HttpURLConnection urlConnection, byte[] content) throws IOException
      Do a operation that writes content to the HttpURLConnection
      Parameters:
      urlConnection - the connection
      content - The content to send
      Returns:
      Response
      Throws:
      IOException
    • doReadOperation

      public static SWIFT_PING.HttpResponse doReadOperation(HttpURLConnection urlConnection) throws IOException
      Do a operation that reads from the httpconnection
      Parameters:
      urlConnection - The connections
      Returns:
      Response
      Throws:
      IOException