public class Transmission extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Transmission.Status
Describes the status of a transmission in terms that can be
presented in the GUI.
|
Constructor and Description |
---|
Transmission(Client sender,
Client receiver,
Message msg,
String msgTag,
String msgId)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addChangeListener(ChangeListener listener)
Adds a listener which will be notified if the state of this transmission
changes (if a response or failure is signalled).
|
long |
getDoneTime()
Returns the epoch at which this transmission was completed.
|
Throwable |
getError()
Returns a Throwable which prevented normal resolution of this
transmission.
|
Message |
getMessage()
Returns the message which was sent.
|
String |
getMessageId()
Returns the message ID associated with this message.
|
String |
getMessageTag()
Returns the message tag corresponding to this transmission.
|
Client |
getReceiver()
Returns the client to which this transmission was sent.
|
Response |
getResponse()
Returns the response for this transmission.
|
Client |
getSender()
Returns the client which sent this transmission.
|
Transmission.Status |
getStatus()
Returns an object which describes the current status of this
transmission in terms which can be presented to the GUI.
|
boolean |
isDone()
Indicates whether further changes to the state of this object
are expected, that is if a response/failure is yet to be received.
|
void |
removeChangeListener(ChangeListener listener)
Removes a listener previously added by
addChangeListener(javax.swing.event.ChangeListener) . |
void |
setError(Throwable error)
Associates an error with this transmission.
|
void |
setReceiverUnregistered()
Indicates that the receiver of this transmission has unregistered.
|
void |
setResponse(Response response)
Sets the response for this transmission.
|
void |
setSenderUnregistered()
Indicates that the sender of this transmission has unregistered.
|
public Client getSender()
public Client getReceiver()
public Message getMessage()
public String getMessageTag()
public String getMessageId()
public void setResponse(Response response)
response
- responsepublic Response getResponse()
public void setError(Throwable error)
error
- throwable causing the failurepublic Throwable getError()
public void setSenderUnregistered()
public void setReceiverUnregistered()
public long getDoneTime()
isDone()
==false),
the returned value will be (way) in the future.System.currentTimeMillis()
at which
isDone()
first returned truepublic boolean isDone()
public Transmission.Status getStatus()
public void addChangeListener(ChangeListener listener)
ChangeEvent
s sent to these listeners
will have a source which is this Transmission.listener
- listener to addpublic void removeChangeListener(ChangeListener listener)
addChangeListener(javax.swing.event.ChangeListener)
.listener
- listener to removeCopyright © 2008–2024. All rights reserved.