fipaos.mts.http.internal
Class SenderThread


public class SenderThread
implements ThreadPool.Job

Implements POST for HTTP protocol


Field Summary
 final intACTIVE
           
 final intBOUNDARYLENGTH
           
 (package private) booleandebug
           
 (package private) Stringenvelope
           
 (package private) StringenvMime
           
 final intFAILED
           
 (package private) Stringhost
           
 final intINIT
           
 (package private) Stringmessage
           
 (package private) StringmessageID
           
 (package private) MessagemessageStore
           
 (package private) StringmsgMime
           
 (package private) ICallbackparent
           
 (package private) intresponseCode
           
 (package private) StringresponseMessage
           
 static StringSENDFAILURE
           
 static StringSENDSUCCESS
           
 final intSUCCESS
           
 final intUNKNOWN
           

Constructor Summary
SenderThread()
          Constructors ******************************************
SenderThread(Message msg, String host, ICallback parent)
           
SenderThread(Message msg, String host, ICallback parent, String id)
           
SenderThread(String host, String envelope, String message)
          Constructor
SenderThread(String host, String envelope, String message, String id, ICallback parent)
           

Method Summary
 StringboundaryString(int n)
          Returns MIME random boundary string.
 intgetResponseCode()
          Returns the response code of the post operation.
 StringgetResponseMessage()
           
 voidgo()
           
 Stringpost()
          Executes the post.
 synchronized Stringpost(Message msg, String site)
           
 synchronized Stringpost(String envelope, String message, String site)
           
 synchronized Stringpost(String envelope, String message, URL site)
          Executes the post.
 intrand(int l, int h)
          Return a random number between the given integers.
 StringrandomString(int n)
          Returns a randomize string of n characters 'a' - 'z'.
 voidrun()
          The process is started only and only if the initialization succeeded.
 voidsetEnvelope(String envelope)
          Sets the envelope.
 voidsetEnvMimeType(String t)
          Sets the envelope mime type
 voidsetHost(String host)
          Sets the host.
 voidsetID(String id)
           
 voidsetMessage(String message)
          Sets the message.
 voidsetMsgMimeType(String t)
          Sets the message mime type.
 voidshutdown()
          Shutdown this thread.

Field Detail

ACTIVE

public final int ACTIVE

BOUNDARYLENGTH

public final int BOUNDARYLENGTH

debug

boolean debug

envelope

String envelope

envMime

String envMime

FAILED

public final int FAILED

host

String host

INIT

public final int INIT

message

String message

messageID

String messageID

messageStore

Message messageStore

msgMime

String msgMime

parent

ICallback parent

responseCode

int responseCode

responseMessage

String responseMessage

SENDFAILURE

public static String SENDFAILURE

SENDSUCCESS

public static String SENDSUCCESS

SUCCESS

public final int SUCCESS

UNKNOWN

public final int UNKNOWN
Constructor Detail

SenderThread

public SenderThread()
Constructors ******************************************

SenderThread

public SenderThread(Message msg, String host, ICallback parent)

SenderThread

public SenderThread(Message msg, String host, ICallback parent, String id)

SenderThread

public SenderThread(String host, String envelope, String message)
Constructor
Parameters:
host - the host
envelope - the envelope of the message
message - the message

SenderThread

public SenderThread(String host, String envelope, String message, String id, ICallback parent)
Method Detail

boundaryString

public String boundaryString(int n)
Returns MIME random boundary string.
Parameters:
n - the length of the generated string
Returns: String the boundary string

getResponseCode

public int getResponseCode()
Returns the response code of the post operation.
Returns: int the response code

getResponseMessage

public String getResponseMessage()

go

public void go()

post

public String post()
Executes the post.
Returns: String the response

post

public synchronized String post(Message msg, String site)

post

public synchronized String post(String envelope, String message, String site)

post

public synchronized String post(String envelope, String message, URL site)
Executes the post.
Returns: String the response
site the host address (acc address)
message the message to post
envelope the envelope of the message

rand

public int rand(int l, int h)
Return a random number between the given integers.
Parameters:
int - low
int - high
Returns: int the random number

randomString

public String randomString(int n)
Returns a randomize string of n characters 'a' - 'z'.
Parameters:
n - the number of characters
Returns: String the random string

run

public void run()
The process is started only and only if the initialization succeeded.

setEnvelope

public void setEnvelope(String envelope)
Sets the envelope.
Parameters:
String - the envelope

setEnvMimeType

public void setEnvMimeType(String t)
Sets the envelope mime type
Parameters:
String - the mime type

setHost

public void setHost(String host)
Sets the host.
Parameters:
String - the host

setID

public void setID(String id)
Parameters:
id - sets the message id, used for distinguishing messages

setMessage

public void setMessage(String message)
Sets the message.
Parameters:
String - the message

setMsgMimeType

public void setMsgMimeType(String t)
Sets the message mime type.
Parameters:
String - the mime type

shutdown

public void shutdown()
Shutdown this thread.

Association Links

to Class fipaos.mts.Message

to Class java.lang.String

to Class fipaos.mts.http.internal.ICallback

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String