Package org.jgroups.protocols
Class SWIFT_PING.Utils
java.lang.Object
org.jgroups.protocols.SWIFT_PING.Utils
- Enclosing class:
SWIFT_PING
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SWIFT_PING.HttpResponsedoOperation(HttpURLConnection urlConnection, byte[] inputData, boolean hasOutput) Do a http operationstatic SWIFT_PING.HttpResponsedoReadOperation(HttpURLConnection urlConnection) Do a operation that reads from the httpconnectionstatic SWIFT_PING.HttpResponsedoSendOperation(HttpURLConnection urlConnection, byte[] content) Do a operation that writes content to the HttpURLConnectionstatic SWIFT_PING.HttpResponsedoVoidOperation(HttpURLConnection urlConnection) Do a operation that does not write or read from HttpURLConnection, except for the headersstatic byte[]getBytes(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(String arg, String argname)
-
Constructor Details
-
Utils
private Utils()
-
-
Method Details
-
validateNotEmpty
-
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 usedinputData- if not null,will be written to the urlconnection.hasOutput- if true, read content back from the urlconnection- Returns:
- Response
- Throws:
IOException
-
getBytes
Get bytes of thisInputStream- 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 connectioncontent- 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
-