org.tranche.add
Class AddFileToolEvent

java.lang.Object
  extended by org.tranche.add.AddFileToolEvent

public class AddFileToolEvent
extends java.lang.Object

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

Field Summary
static short ACTION_FAILED
          Code for a failure action.
static short ACTION_FINISHED
          Code for a finished action.
static short ACTION_STARTED
          Code for a started action.
static short ACTION_STARTING
          Code for a starting action.
static short ACTION_TRYING
          Code for a trying action.
static short ACTION_UPLOADED
          Code for a uploaded action.
static int TYPE_DATA
          Code for a data chunk object.
static int TYPE_DIRECTORY
          Code for a directory object.
static int TYPE_FILE
          Code for a file object.
static int TYPE_METADATA
          Code for a meta data chunk object.
 
Constructor Summary
AddFileToolEvent(short action, int type, java.io.File file, java.lang.String fileName, BigHash fileHash, BigHash chunkHash, java.lang.String serverHostName)
           
 
Method Summary
 short getAction()
          The action that this event is reporting.
 java.lang.String getActionString()
          The human-readable version of the action that this event is reporting.
 BigHash getChunkHash()
          If this event references a data chunk, this returns that value.
 java.io.File getFile()
          If this event references a file, this returns the file.
 BigHash getFileHash()
           
 java.lang.String getFileName()
          If this event references a file, this returns the name of that file.
 java.lang.String getServer()
           
 long getTimestamp()
          The UNIX timestamp of when this object was created.
 int getType()
          The type of object that this event represents.
 java.lang.String getTypeString()
          The human-readable version of the type of object that this event represents.
static java.lang.String staticGetActionString(short action)
          The human-readable version of the given action value..
static java.lang.String staticGetTypeString(int type)
          The human-readable version of the type of object the given type value represents.
 java.lang.String toString()
          Printout of this object's information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE_METADATA

public static final int TYPE_METADATA

Code for a meta data chunk object.

See Also:
Constant Field Values

TYPE_DATA

public static final int TYPE_DATA

Code for a data chunk object.

See Also:
Constant Field Values

TYPE_FILE

public static final int TYPE_FILE

Code for a file object.

See Also:
Constant Field Values

TYPE_DIRECTORY

public static final int TYPE_DIRECTORY

Code for a directory object.

See Also:
Constant Field Values

ACTION_STARTING

public static final short ACTION_STARTING

Code for a starting action.

See Also:
Constant Field Values

ACTION_STARTED

public static final short ACTION_STARTED

Code for a started action.

See Also:
Constant Field Values

ACTION_TRYING

public static final short ACTION_TRYING

Code for a trying action.

See Also:
Constant Field Values

ACTION_UPLOADED

public static final short ACTION_UPLOADED

Code for a uploaded action.

See Also:
Constant Field Values

ACTION_FINISHED

public static final short ACTION_FINISHED

Code for a finished action.

See Also:
Constant Field Values

ACTION_FAILED

public static final short ACTION_FAILED

Code for a failure action.

See Also:
Constant Field Values
Constructor Detail

AddFileToolEvent

public AddFileToolEvent(short action,
                        int type,
                        java.io.File file,
                        java.lang.String fileName,
                        BigHash fileHash,
                        BigHash chunkHash,
                        java.lang.String serverHostName)
Parameters:
action -
type -
file -
fileName -
fileHash -
chunkHash -
serverHostName -
Method Detail

getFile

public java.io.File getFile()

If this event references a file, this returns the file. Otherwise, null.

Returns:

getFileName

public java.lang.String getFileName()

If this event references a file, this returns the name of that file. Otherwise, null.

Returns:

getFileHash

public BigHash getFileHash()
Returns:

getChunkHash

public BigHash getChunkHash()

If this event references a data chunk, this returns that value. Otherwise, null.

Returns:

getServer

public java.lang.String getServer()
Returns:

getType

public int getType()

The type of object that this event represents.

Returns:

getTypeString

public java.lang.String getTypeString()

The human-readable version of the type of object that this event represents.

Returns:

staticGetTypeString

public static java.lang.String staticGetTypeString(int type)

The human-readable version of the type of object the given type value represents.

Parameters:
type -
Returns:

getAction

public short getAction()

The action that this event is reporting.

Returns:

getActionString

public java.lang.String getActionString()

The human-readable version of the action that this event is reporting.

Returns:

staticGetActionString

public static java.lang.String staticGetActionString(short action)

The human-readable version of the given action value..

Parameters:
action -
Returns:

getTimestamp

public long getTimestamp()

The UNIX timestamp of when this object was created.

Returns:

toString

public java.lang.String toString()

Printout of this object's information.

Overrides:
toString in class java.lang.Object
Returns:


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