org.tranche.server.logs
Class AutoUploadingBinaryLog

java.lang.Object
  extended by org.tranche.server.logs.AutoUploadingBinaryLog
All Implemented Interfaces:
Submittable

public class AutoUploadingBinaryLog
extends java.lang.Object
implements Submittable

Uploads logs files to server in binary format.

Author:
Bryan E. Smith - bryanesmith@gmail.com, James "Augie" Hill - augman85@gmail.com

Method Summary
 void close()
          Close binary log.
 void flush()
          Coerces the log to flush contents and upload.
 void getConfiguration(java.lang.String ip)
          Retrieve configuration.
 void getData(BigHash hash, java.lang.String ip)
          Retrieve data.
static AutoUploadingBinaryLog getLogManager(java.lang.String serverURL)
          Factory method and registry.
 void getMetaData(BigHash hash, java.lang.String ip)
          Retrieve metadata.
 void getNonce(java.lang.String ip)
          Retrienve nonce.
 void setConfiguration(Signature sig, java.lang.String ip)
          Set configuration.
 void setData(BigHash hash, Signature sig, java.lang.String ip)
          Set data.
 void setMetaData(BigHash hash, Signature sig, java.lang.String ip)
          Set meta data.
 java.io.File writeMemoryToFile()
          Record everything to memory and return that file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getLogManager

public static AutoUploadingBinaryLog getLogManager(java.lang.String serverURL)
Factory method and registry. Creates a manager if not exist for serverURL, or retrieves logManager.

Parameters:
serverURL -
Returns:

setData

public void setData(BigHash hash,
                    Signature sig,
                    java.lang.String ip)
Set data.

Specified by:
setData in interface Submittable
Parameters:
hash -
sig -
ip -

setMetaData

public void setMetaData(BigHash hash,
                        Signature sig,
                        java.lang.String ip)
Set meta data.

Specified by:
setMetaData in interface Submittable
Parameters:
hash -
sig -
ip -

setConfiguration

public void setConfiguration(Signature sig,
                             java.lang.String ip)
Set configuration.

Specified by:
setConfiguration in interface Submittable
Parameters:
sig -
ip -

getData

public void getData(BigHash hash,
                    java.lang.String ip)
Retrieve data.

Specified by:
getData in interface Submittable
Parameters:
hash -
ip -

getMetaData

public void getMetaData(BigHash hash,
                        java.lang.String ip)
Retrieve metadata.

Specified by:
getMetaData in interface Submittable
Parameters:
hash -
ip -

getConfiguration

public void getConfiguration(java.lang.String ip)
Retrieve configuration.

Specified by:
getConfiguration in interface Submittable
Parameters:
ip -

getNonce

public void getNonce(java.lang.String ip)
Retrienve nonce.

Specified by:
getNonce in interface Submittable
Parameters:
ip -

flush

public void flush()
Coerces the log to flush contents and upload. Useful for testing or before a shutdown. Currently not called in any production code.


writeMemoryToFile

public java.io.File writeMemoryToFile()
                               throws java.lang.Exception
Record everything to memory and return that file. Doesn't upload file, doesn't impact contents of memory.

Returns:
Throws:
java.lang.Exception

close

public void close()
Close binary log.

Specified by:
close in interface Submittable


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