Package jade.mtp.http
Class HTTPIO
- java.lang.Object
-
- jade.mtp.http.HTTPIO
-
public class HTTPIO extends Object
-
-
Constructor Summary
Constructors Constructor Description HTTPIO()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]createHTTPBody(Envelope env, byte[] boundary, byte[] payload)Prepare the HTML bodystatic byte[]createHTTPHeader(HTTPAddress host, int length, String policy, byte[] boundary, boolean proxy)Prepare the HTML headerstatic byte[]createHTTPResponse(String msgCode, String type)Create a generic message of HTTP with the input msgCode and type of connection (close or Keep-Alive)static intgetResponseCode(InputStream input, StringBuffer type)Capture and return the code of response message, this message is received from clientstatic StringreadAll(InputStream input, StringBuffer xml, OutputStream acl, StringBuffer type)Parse the input message, this message is received from the master serverstatic voidwriteAll(OutputStream output, byte[] message)Write the message to the OutputStream associated to the Sender
-
-
-
Field Detail
-
OK
public static final String OK
- See Also:
- Constant Field Values
-
CLOSE
public static final String CLOSE
- See Also:
- Constant Field Values
-
KA
public static final String KA
- See Also:
- Constant Field Values
-
-
Method Detail
-
writeAll
public static void writeAll(OutputStream output, byte[] message) throws IOException
Write the message to the OutputStream associated to the Sender- Throws:
IOException
-
createHTTPResponse
public static byte[] createHTTPResponse(String msgCode, String type)
Create a generic message of HTTP with the input msgCode and type of connection (close or Keep-Alive)
-
createHTTPHeader
public static byte[] createHTTPHeader(HTTPAddress host, int length, String policy, byte[] boundary, boolean proxy)
Prepare the HTML header
-
createHTTPBody
public static byte[] createHTTPBody(Envelope env, byte[] boundary, byte[] payload)
Prepare the HTML body
-
readAll
public static String readAll(InputStream input, StringBuffer xml, OutputStream acl, StringBuffer type) throws IOException
Parse the input message, this message is received from the master server- Parameters:
type- return type of connection: close or Keep-Alive- Throws:
IOException
-
getResponseCode
public static int getResponseCode(InputStream input, StringBuffer type) throws IOException
Capture and return the code of response message, this message is received from client- Throws:
IOException
-
-