org.tranche.servers
Class ServerMessageUpEvent

java.lang.Object
  extended by org.tranche.servers.ServerEvent
      extended by org.tranche.servers.ServerMessageEvent
          extended by org.tranche.servers.ServerMessageUpEvent

public class ServerMessageUpEvent
extends ServerMessageEvent

Representation of a message being sent to a server.

Author:
James "Augie" Hill - augman85@gmail.com

Field Summary
static int TYPE_COMPLETED
          Represents a completed upload message
static int TYPE_CREATED
          Represents a created upload message.
static int TYPE_FAILED
          Represents a failed upload message.
static int TYPE_STARTED
          Represents a started upload message
 
Fields inherited from class org.tranche.servers.ServerEvent
AUTO_BAN, AUTO_UNBAN, CALLBACK, CONNECT, MESSAGE, USER_BAN, USER_UNBAN
 
Constructor Summary
ServerMessageUpEvent(java.lang.String url, long callbackId, int type)
           
ServerMessageUpEvent(java.lang.String url, long callbackId, int type, long bytesToUpload)
           
ServerMessageUpEvent(java.lang.String url, long callbackId, int type, long bytesToUpload, long bytesUploaded)
           
 
Method Summary
 long getBytesToUpload()
          Returns the number of bytes expected to be uploaded.
 long getBytesUploaded()
          Returns the number of bytes that have been uploaded.
 int getType()
          Returns the type of action this event represents.
 java.lang.String getTypeString()
          Returns the human-readable type of action this event represents.
 java.lang.String toString()
          Gets a human-readable printout of what this event represents.
 
Methods inherited from class org.tranche.servers.ServerMessageEvent
getCallbackId
 
Methods inherited from class org.tranche.servers.ServerEvent
getTimestamp, getUrl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE_CREATED

public static final int TYPE_CREATED

Represents a created upload message.

See Also:
Constant Field Values

TYPE_STARTED

public static final int TYPE_STARTED

Represents a started upload message

See Also:
Constant Field Values

TYPE_COMPLETED

public static final int TYPE_COMPLETED

Represents a completed upload message

See Also:
Constant Field Values

TYPE_FAILED

public static final int TYPE_FAILED

Represents a failed upload message.

See Also:
Constant Field Values
Constructor Detail

ServerMessageUpEvent

public ServerMessageUpEvent(java.lang.String url,
                            long callbackId,
                            int type)
Parameters:
url -
callbackId -
type -

ServerMessageUpEvent

public ServerMessageUpEvent(java.lang.String url,
                            long callbackId,
                            int type,
                            long bytesToUpload)
Parameters:
url -
callbackId -
type -
bytesToUpload -

ServerMessageUpEvent

public ServerMessageUpEvent(java.lang.String url,
                            long callbackId,
                            int type,
                            long bytesToUpload,
                            long bytesUploaded)
Parameters:
url -
callbackId -
type -
bytesToUpload -
bytesUploaded -
Method Detail

getType

public int getType()

Returns the type of action this event represents.

Overrides:
getType in class ServerEvent
Returns:

getTypeString

public java.lang.String getTypeString()

Returns the human-readable type of action this event represents.

Overrides:
getTypeString in class ServerEvent
Returns:

getBytesToUpload

public long getBytesToUpload()

Returns the number of bytes expected to be uploaded.

Returns:

getBytesUploaded

public long getBytesUploaded()

Returns the number of bytes that have been uploaded.

Returns:

toString

public java.lang.String toString()

Gets a human-readable printout of what this event represents.

Overrides:
toString in class ServerMessageEvent
Returns:


This code is free for use both commercially and non-commercially as stated in the project's license