public class HTTPTransaction
extends java.lang.Thread
implements java.lang.Comparable
Modifier and Type | Field and Description |
---|---|
static org.apache.log4j.Logger |
log
Used for logging.
|
(package private) HTTPSession |
session
The HTTP session holding this transaction.
|
Constructor and Description |
---|
HTTPTransaction(int httpTransactionID)
Generates a new HTTPTransaction and loads it with its basic data based on its ID.
|
HTTPTransaction(int httpTransactionID,
HTTPSession session,
int sequence,
java.lang.String note)
Generates a new HTTPTransaction, loads it with its basic data, then loads it up with all of its HTTP requests and responses.
|
HTTPTransaction(int sequence,
java.net.Socket socket)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
block()
Blocks and stops the session.
|
int |
compareTo(java.lang.Object httpTransaction)
Required by the
Comparable interface. |
void |
delete()
Deletes the HTTP transaction.
|
void |
deleteRequestsAndResponses()
Deletes the requests and responses for this transaction.
|
void |
disconnect()
Kills the session.
|
HTTPRequest |
getHTTPRequest()
Gets the HTTP request received by the client for this session.
|
HTTPResponse |
getHTTPResponse()
Gets the HTTP response received by the server for this session.
|
HTTPSession |
getHTTPSession()
Gets the HTTP session associated with this transaction.
|
int |
getID()
Gets the ID.
|
java.lang.String |
getNote()
Gets the note associated with this transaction.
|
int |
getSequence()
Gets the sequence of this session.
|
java.lang.String |
getStatus()
Gets the current status of this transaction.
|
java.net.URL |
getURL()
Gets the URL this transaction is requesting.
|
boolean |
isBlocked()
Indicates whether or not the session is currently blocked.
|
protected void |
load()
Loads the HTTP transaction with its request and response.
|
void |
run()
Handles a single transaction.
|
void |
save()
Saves the information related to this transaction to the database.
|
void |
setHTTPSession(HTTPSession session)
Sets the HTTP session associated with this transaction.
|
void |
setID(int httpTransactionID)
Sets the ID.
|
void |
setNote(java.lang.String note)
Sets the note associated with this transaction.
|
void |
setNotifiable(HTTPSessionNotifiable notifiable)
Sets the object that will need to be notified when changes in the session take place.
|
void |
setSequence(int sequence)
Sets the sequence of this session.
|
boolean |
shouldBeFiltered()
Indicates whether or not the transaction should be filtered according to its usefulness.
|
java.lang.String |
toString() |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, yield
public static org.apache.log4j.Logger log
HTTPSession session
public HTTPTransaction(int sequence, @Nullable java.net.Socket socket)
sequence
- The sequence of this session.socket
- The socket used to communicate with the client.public HTTPTransaction(int httpTransactionID, HTTPSession session, int sequence, java.lang.String note)
httpTransactionID
- The ID.session
- The HTTP session holding this transaction.sequence
- The sequence of this transaction.note
- The note associated with the HTTP transaction.public HTTPTransaction(int httpTransactionID)
httpTransactionID
- The ID.public int getID()
public void setID(int httpTransactionID)
httpTransactionID
- The ID.public HTTPSession getHTTPSession()
HTTPSession
.public void setHTTPSession(HTTPSession session)
session
- The HTTPSession
.public int getSequence()
public void setSequence(int sequence)
sequence
- The sequence.public java.lang.String getNote()
public void setNote(java.lang.String note)
note
- The note.public HTTPRequest getHTTPRequest()
public HTTPResponse getHTTPResponse()
public java.net.URL getURL()
public java.lang.String getStatus()
public void setNotifiable(HTTPSessionNotifiable notifiable)
notifiable
- An HTTPSessionNotifiable
object.public void disconnect()
public void block()
public boolean isBlocked()
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public boolean shouldBeFiltered()
public void save()
protected void load()
public void delete()
public void deleteRequestsAndResponses()
public int compareTo(@NotNull java.lang.Object httpTransaction)
Comparable
interface.compareTo
in interface java.lang.Comparable
httpTransaction
- The transaction to compare to.public java.lang.String toString()
toString
in class java.lang.Thread