Package org.jgroups.protocols
Class SWIFT_PING.Utils
- java.lang.Object
-
- org.jgroups.protocols.SWIFT_PING.Utils
-
- Enclosing class:
- SWIFT_PING
private static class SWIFT_PING.Utils extends java.lang.Object
-
-
Constructor Summary
Constructors Modifier Constructor Description privateUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SWIFT_PING.HttpResponsedoOperation(java.net.HttpURLConnection urlConnection, byte[] inputData, boolean hasOutput)Do a http operationstatic SWIFT_PING.HttpResponsedoReadOperation(java.net.HttpURLConnection urlConnection)Do a operation that reads from the httpconnectionstatic SWIFT_PING.HttpResponsedoSendOperation(java.net.HttpURLConnection urlConnection, byte[] content)Do a operation that writes content to the HttpURLConnectionstatic SWIFT_PING.HttpResponsedoVoidOperation(java.net.HttpURLConnection urlConnection)Do a operation that does not write or read from HttpURLConnection, except for the headersstatic byte[]getBytes(java.io.InputStream inputStream)Get bytes of thisInputStreamstatic booleanisAuthDenied(int code)Is http Unauthorized response code ?static booleanisSuccessCode(int code)Is http response code in success range ?static voidvalidateNotEmpty(java.lang.String arg, java.lang.String argname)
-
-
-
Method Detail
-
validateNotEmpty
public static void validateNotEmpty(java.lang.String arg, java.lang.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(java.net.HttpURLConnection urlConnection, byte[] inputData, boolean hasOutput) throws java.io.IOException
Do a http operation- Parameters:
urlConnection- the HttpURLConnection to be usedinputData- if not null,will be written to the urlconnection.hasOutput- if true, read content back from the urlconnection- Returns:
- Response
- Throws:
java.io.IOException
-
getBytes
public static byte[] getBytes(java.io.InputStream inputStream) throws java.io.IOExceptionGet bytes of thisInputStream- Parameters:
inputStream-- Returns:
- Throws:
java.io.IOException
-
doVoidOperation
public static SWIFT_PING.HttpResponse doVoidOperation(java.net.HttpURLConnection urlConnection) throws java.io.IOException
Do a operation that does not write or read from HttpURLConnection, except for the headers- Parameters:
urlConnection- the connection- Returns:
- Response
- Throws:
java.io.IOException
-
doSendOperation
public static SWIFT_PING.HttpResponse doSendOperation(java.net.HttpURLConnection urlConnection, byte[] content) throws java.io.IOException
Do a operation that writes content to the HttpURLConnection- Parameters:
urlConnection- the connectioncontent- The content to send- Returns:
- Response
- Throws:
java.io.IOException
-
doReadOperation
public static SWIFT_PING.HttpResponse doReadOperation(java.net.HttpURLConnection urlConnection) throws java.io.IOException
Do a operation that reads from the httpconnection- Parameters:
urlConnection- The connections- Returns:
- Response
- Throws:
java.io.IOException
-
-